Re: RFC: partially available registers

Daniel Jacobowitz
2011-07-13T20:52:29Z

I'm too stale to properly review this patch, but I have some comments.

On Wed, Jul 13, 2011 at 1:44 PM, Tom Tromey <tromey@redhat.com> wrote:
> This patch fixes the problem by letting an arch register a new
> pseudo_register_read_value method, which is responsible for constructing
> a struct value for the register.  This gives us a chance to mark
> just some bits unavailable.

I think this is the right approach. We should move more towards
values, not away; in particular, I do not prefer this alternative:

> * Rather than a way to return values, have a different API, say one
>  where gdb requests the first N bytes of a register.

As for the patch itself:

* Some documentation on the gdbarch method would be nice, in
particular, the return value. Does 0 mean "not a pseudo"?

* Stale comment in sentinel_frame_prev_register.

* I am not happy about having to implement both
gdbarch_pseudo_register_read and gdbarch_pseudo_register_read_value,
depending on which regcache read function was called. So for a final
version, is it practical to push this down and only call the value
version if it is registered? That means implementing the existing
regcache read in terms of the new one, instead of the other way
around.

--
Thanks,
Daniel