A collection of notes and tips that works for me. Pull Requests are welcome.
GDB provides the most powerful tools for debugging, such as viewing specific memory addresses using a certain format. The only problem is the terminal output often breaks, especially if there are problems in the code.
If GDB does not give you the above layout by default, try the following:
$ gdb <executable>
layout regs
Not as powerful as GDB but might be more reliable.
- Follow installation and usage instructions for Native Debug
- An example workspace is configured in
examples/hello-world/hello-world.code-workspace
- Watch registers using
$rax
,$rsp
, etc