-
Notifications
You must be signed in to change notification settings - Fork 137
Interactive simulation with GDB
Firstly, you have to get our GDB fork with submodule and configure it:
git clone --recursive https://github.com/MIPT-ILab/mipt-sim-gdb
cd mipt-sim-gdb
./configure --target=mips
makeFirst build may take long time, because external libraries are being built. Next time you may call make from gdb/ directory and it would only re-link files.
Finally, you should have gdb executable in gdb/ directory.
If you are confused how to work with git submodules, you may have a look at this.
Then, you have to build libsim.a, which contains MIPT-MIPS simulator and GDB interfaces and linked to GDB:
mkdir mipt-mips/cmake-build
cd mipt-mips/cmake-build
cmake ../simulator
make mipt-mips-srcUnlike 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. To be continued
MIPT-V / MIPT-MIPS — Cycle-accurate pre-silicon simulation.