Note: make sure to compile with -g.
| Command | Description |
b <file>:<line> |
Breakpoint at file / line |
bt |
Show callstack |
fin |
Step out |
c |
Continue |
l |
Show lines around |
n |
Next line |
r |
Start program |
s |
Step in |
tbreak |
One-time breakpoint |
Formats:
b <file>:<line>Adds a breakpoint. Use tbreak for a one-time only break.
c. Go to the next breakpoint.
n or next.
r. Starts the binary.
bt or backtrace. Show the current call stack.
l or list. Shows 10 lines around the current position.
It’s possible to always skip certain functions, such as std::move().
skip function move
s or step. Enters the function.
fin or finish. Exits the current function and goes back to the immediate caller.