How do I print the value of %eax and %ebp?
(gdb) p $eax
$1 = void
Gdb commands:
i r : print a single register, e.g i r rax, i r eaxi r ... : print multiple registers, e.g i r rdi rsi,i r: print all register except floating point & vector register (xmm, ymm, zmm).i r a: print all register, include floating point & vector register (xmm, ymm, zmm).i r f: print all FPU floating registers (st0-7 and a few other f*) Other register groups besides a (all) and f (float) can be found with:
maint print reggroups
as documented at: https://sourceware.org/gdb/current/onlinedocs/gdb/Registers.html#Registers
Tips:
xmm0 ~ xmm15, are 128 bits, almost every modern machine has it, they are released in 1999.ymm0 ~ ymm15, are 256 bits, new machine usually have it, they are released in 2011.zmm0 ~ zmm31, are 512 bits, normal pc probably don't have it (as the year 2016), they are released in 2013, and mainly used in servers so far.