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]

Re: A better register interface


Andrew Cagney wrote:

>         cooked_register_name(frame, REGNUM)
>         cooked_register_type(frame, REGNUM)
>                 provides the size implicitly
>         read_cooked_register(frame, REGNUM, buf, sizeof buf)
>         write_cooked_register(frame, REGNUM, buf, sizeof buf)
>         along with a few others such as:
>         cooked_register_attrib_p (frame, REGNUM, some attribute - is FP?)

I should expand a little.  Attatching the frame to the COOKED register
methods is so that GDB can clearly handle the situtation where the
ISA/ABI change as you move up/down the stack.

Given the frame you can determine the PC and SP and hence the actual
mode of the CPU at that point.  That in turn allows you to correctly
display the registers that apply to that frame.

Eventually, the architecture/abi objects could be simply attatched to
the frame, rather than having to look them up.

Andrew


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