gdbcpu-registers

How to print register values in GDB?


How do I print the value of %eax and %ebp?

(gdb) p $eax
$1 = void

Solution

  • info registers shows all the registers; info registers eax shows just the register eax. The command can be abbreviated as i r