- Published on
Use `gdb` to step through disassembled binary
- Authors

- Name
- Jenny Kim
Assembly using gdb
Start the debugger:
gdb [executable_name]Display assembly code:
layout asmDisplay registers:
layout regsSet a breakpoint:
b [function_name]Run the code:
run [name]Reload screen:
ctrl + lMove to the next instruction:
ni(pressing ENTER repeats the previous command).Continue:
cDisplay the function:
disas [function_name]Print value in register in:
hex:
x/x $[register]decimal:
x/d $[register]string:
x/s $[register]Print the value in array in decimal:
x/[size]wd $[register]