Quiz Entry - updated: 2026.07.14
How do you use GDB breakpoints and stepping for assembly analysis?
break stops at a location; stepi/nexti then advance exactly one instruction — stepi enters calls, nexti steps over them.
Setting breakpoints:
(gdb) break phase_1
(gdb) break *0x400da0
(gdb) break explode_bomb
Running and stepping:
| Command | Short | Action |
|---|---|---|
run |
r |
Start program |
continue |
c |
Continue to next breakpoint |
stepi |
si |
Execute one instruction (enter calls) |
nexti |
ni |
Execute one instruction (skip over calls) |
finish |
fin |
Run until current function returns |
Practical workflow:
(gdb) break explode_bomb
(gdb) break phase_2
(gdb) run
> Enter input
(gdb) ni
(gdb) ni
(gdb) info registers
(gdb) x/6d $rsp
Tip: Always set break explode_bomb as a safety net — it stops before the bomb explodes so you can examine state and try again.
Go deeper: