Improved GDB info commands for general, single, double and vector registers for Armv8a and AArch64 - StevenLwcz/gdb-python GitHub Wiki

These are an improvement over the default GDB info register, float and vector commands allowing control of the range of registers and the format they are displayed in, which should make them more useful when debugging assembler.

Specify a range and specific registers

(gdb) info general x0 - x3 x7 pc
x0        1                       
x1        2                       
x2        3                       
x3        4                       
x7        5  
pc        0x4000cc <_start+28>    

Display in hex

(gdb) info ge /x x5 - x7
x5        0x64                    
x6        0xff                    
x7        0x5  

For vector registers, d, q on Armv8a and s, d, v on AArch64 the /FMT option can be used to control how the registers are displayed

V registers 16 bit integer unsigned.

(gdb) info vec /hu v0 - v3
v0        {65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535}
v1        {244, 244, 244, 244, 244, 244, 244, 244}
v2        {3, 0, 3, 0, 3, 0, 3, 0}
v3        {255, 0, 0, 0, 255, 0, 0, 0}

Display d registers unsigned (default is float).

(gdb) info do /u d9 - d11
d9        1000100
d10       3001000
d11       4001100

The /FMT option is sticky, if unspecified next time the info command is used, the previous setting is remembered.

If no arguments are specified the info command will display the full list of registers.

See each command's help.

(gdb) help info general
(gdb) help info single
(gdb) help info double
(gdb) help info vector

You could place the info command in break point hooks and GDB command hooks.

(gdb) b 73
Breakpoint 2 at 0x400174: file a1.s, line 73.

command 2
>inf vec /bu v2
>end

(gdb) c

Breakpoint 2, _start () at a1.s:73
v2        {121, 16, 125, 127, 129, 131, 133, 135, 0, 0, 0, 0, 0, 0, 0, 0}
⚠️ **GitHub.com Fallback** ⚠️