Mini C++ debugger for Linux with basic debugging operations:
- Stepping (step in, step out, step over)
- Reading & writing variables
- Setting function/source line/memory breakpoints
- Stack unwinding
- Reading functions/lines/registers
After cloning the repository, run cmake:
cmake -DCMAKE_CXX_COMPILER="$(which clang++)" -DCMAKE_C_COMPILER="$(which clang)" -S <source_folder> -B <build_folder>
You need to compile your code in clang with the following flags to remove different optimizations: -g
, -O0
, -fno-omit-frame-pointer
. For details, see this.
Then, simply run debugger like this:
/path/to/mdb_executable your_executable
See handleCommand
function in debugger.cc
for details.
- Huge thanks to Tartan Llama for the tutorial