Where does GDB store its general register layout?

82 Views Asked by At

I'm building my own GDB Server instance based on the Remote Protocol.

One command sent by GDB is 'g', which reads general registers. The layout of the response to this command is architecture specific (in my case I'm targeting armv8-m.main).

Where can I find the register layout information necessary to reconstruct a response to this command?

1

There are 1 best solutions below

0
Alistair Lowe On

After further digging, register definitions are found within xml profile files within "gdb\features\your_arch" e.g. "gdb\features\arm\arm-m-profile.xml".

These translate directly to the format used within the 'g' response, with padding for any registers not explicitly mentioned between the first and last entry.