Your question: why is (gdb) info register eax displaying the contents of EAX with hexadecimal and decimal, and (gdb) info register ebx uses only hexadecimal numbers for EBP, right?
This is not only the case for EBP, but also for ESP, EFLAGS and EIP. I think it does not really matter. gdb is just trying to display it in a useful way. For example, for EFLAGS you want to see the status of the flags, not the decimal number (in the IF example below). In the case of EBP and ESP, we are talking about registers, which are usually used to indicate the address in the stack / memory. So you usually don't want to know the decimal value. Well, in this case, showing the hexadecimal twice is useless though.
Here is an example that displays the contents of all registers using the info registers command ( ir is a short form, I just found out: P).
(gdb) ir
eax 0x0 0
ecx 0x0 0
edx 0x0 0
ebx 0x0 0
esp 0xbffff234 0xbffff234
ebp 0x0 0x0
esi 0x0 0
edi 0x0 0
eip 0x804822d 0x804822d
eflags 0x202 [IF]
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x0 0
Additional information: https://sourceware.org/gdb/onlinedocs/gdb/Registers.html
source share