Supported on windows
Supported on linux
Supported on embedded
Supported on android

info registers command

Displays the contents of general-purpose processor registers


info registers
info registers [Register name]


Register name
If specified, the info registers command will show the contents of a given register only. If omitted, the command will show the contents of all general-purpose CPU registers.


Note that the info registers does not display the contents of the vector and FPU registers. To view them use the info all-registers and info vector commands.


Below is a basic output of the info registers command:

(gdb) start
Temporary breakpoint 1 at 0x80483f0: file test.cpp, line 5.
Starting program: /home/bazis/test

Temporary breakpoint 1, main (argc=1, argv=0xbffff064) at test.cpp:5
5 return 0;
(gdb) info registers
eax 0x1 1
ecx 0xbffff064 -1073745820
edx 0x80483ed 134513645
ebx 0xb7fbe000 -1208229888
esp 0xbfffefc8 0xbfffefc8
ebp 0xbfffefc8 0xbfffefc8
esi 0x0 0
edi 0x0 0
eip 0x80483f0 0x80483f0 <main(int, char**)+3>
eflags 0x246 [ PF ZF IF ]
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
(gdb) info registers eax
eax 0x1 1
(gdb) info registers cx
cx 0xf064 -3996

Common errors

If you run the info registers command without starting your program, you will get the The program has no registers now message:

(gdb) info registers
The program has no registers now.

To resolve it, run your program using the run or start command or attach to a running program using the attach command.

Compatibility with VisualGDB

You can execute the info registers command under VisualGDB using the GDB Session window in Visual Studio. However it is recommended to use the Debug->Windows->Registers window instead (right-click in it to enable register groups).

See also