A custom debugger for linux based operating systems built using ptrace syscall.
Compile the source code
g++ debugger.cpp -o debugger
Execute the debugger with the path to binary file to debug
./debugger path/to/binary_file
Command | Description |
---|---|
next/ nexti | To step to next instruction |
break 0x123456 | To set a break point at 0x123456 |
continue / c | To continue the execution, even c can be used |
exit | To exit the program |
infobreak/ i b | List of break points |
info registers/ i r | List of registers with their values |
- Playing with Ptrace
- Liz Rice's talk on debuggers from scratch part 1, part 2
- Reading registers of a traced process