-
Notifications
You must be signed in to change notification settings - Fork 141
Interactive simulation with GDB
Firstly, you have to get GDB 8.3 sources and build MIPS GDB:
cd /path/to/gdb/sources
./configure --target=mips
make
First build may take long time, because external libraries are being built. Additionally, you have libsim.a
built with default simulator (not MIPT-MIPS). You have to build libsim.a
, which contains MIPT-MIPS simulator and GDB interfaces and linked to GDB, from our repository
mkdir mipt-mips/cmake-build
cd mipt-mips/cmake-build
cmake ../simulator -DGDB_SRC_PATH=/path/to/gdb/sources
make
After that, you may link GDB with MIPT-MIPS and get gdb
executable in gdb/
directory
cd /path/to/gdb/sources/gdb
make gdb
Unlike usual debugging with GDB, some additional steps are required to use the simulator. So, you launch GDB with some executable file:
./gdb -q /path/to/file
target sim [simulator-args]
load
target sim
tells GDB that we are going to execute program via built-in simulator (in our case it's MIPT-MIPS). You may pass arguments to simulator as well if needed. load
loads program to simulator memory. If target sim
fails with "Undefined target command: sim", make sure you are running the GDB you built with simulator, not the system installed one.
Workflow is perfectly described in this manual for the case of ARM simulation; however, there is no much difference for the MIPS case.
MIPT-V / MIPT-MIPS — Cycle-accurate pre-silicon simulation.