Re: [RFC] sh-tdep.c: Don't fetch FPSCR register if it doesn't exist

Thomas Schwinge
2012-03-01T10:30:43Z

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

Hi!

On Wed, 29 Feb 2012 22:09:32 -0700, Kevin Buettner <kevinb@redhat.com> wrote:
> * sh-tdep.c (sh_frame_cache): Don't fetch the FPSCR register
> unless it exists for this architecture.

Your reasoning and this patch look good to me. (But I didn't test it.)
Basically, you now relay the test to sh_register_reggroup_p, which
already contains the FPSCR existence test you first proposed. (The same
test exists in arch-utils.c:legacy_register_sim_regno, by the way.)

Still learning about GDB's code layout -- is there any benefit in
invoking gdbarch_register_reggroup_p (as you're doing) in contrast to
directly going for sh_register_reggroup_p?

Also, we assume that simply passing 0 for fpscr to sh_analyze_prologue
doesn't do any harm (which it doesn't). (Worth a comment, perhaps?)

Grüße,
Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]