Skip to content

GDB Reference

Reference

CommandDescription
break sumSet breakpoint at entry to function sum
break *0x8048394Set breakpoint at address 0x8048394
delete 1Delete breakpoint 1
deleteDelete all breakpoint
stepiExecute 1 instruction
stepi 4Execute four instructions
nextiLike stepi, but proceed through function calls
continueResume execution
disasDisassemble current function
disas sumDisassemble function sum
disas 0x400544Disassemble function arounad address 0x400544
disas 0x400540, 0x40054dDisassemble code within specified address range
print /x $eip print /x $ripPrint program counter in hex
print $eaxPrint contents of %eax in decimal
print /x $eaxPrint contents of %eax in hex
print /t $eaxPrint contents of %eax in binary
print 0x100Print decimal representation of 0x100
print /x 555Print hex representation of 555
print /x ($ebp + 8)Print contents of %ebp plus 8 in hex
print *(int *) 0xfff076b0Print integer at address 0xfff076b0
print *(int *) ($ebp + 8)Print integer at address %ebp + 8
x/2w 0xfff076b0Examine 2 words (4 bytes) starting at address 0xfff076b0
x/20b sumExamine first 20 bytes of function sum
info frameInformation about the current stack frame
info registersValues of all the registers