This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

x86_64 register cache layout


Hello gdb,

I am trying to implement a simple remote protocol server for an AMD
Opteron based system.  I am happily getting exchanges back and forth,
I'm ignoring a whole bunch of comands but eventually gdb settles down
and says it's attached to the remote process.  I can modify memory on
the target and see the effects on the process.

What I'd like to do is have the 'g' command actually provide register
contents, preferably all the registers and preferably the real data. :)

To do this I'll need to find the right packing order for the reply
frame.  From my reading so far I believe this is, with a couple of minor
exceptions, the hex string representation of the register cache.

So I follow the bouncing ball and get down to supply_register which
calls register data which uses reg_defs to define the order and length
of entries in the cache.

Now reg_defs seems to be set set_register_cache but I can't find where
that is called.  I did attach to a gdbserver and found that the caller
seems to give regs_x86_64 as the initialiser.  But I can find neither
hide nor hair of that variable in the gdb source I have and the
gdbserver is sans symbols.  So I'm stuffed.

Can anyone help me join the final dot and locate the table?

Thanks for your time.

Anthony Booker



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]