From: Andrew Cagney <ac131313@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Use correct register names for MIPS n32/n64 ABIs
Date: Wed, 19 Mar 2003 01:46:00 -0000 [thread overview]
Message-ID: <3E77CBE4.4090009@redhat.com> (raw)
In-Reply-To: <1030318234150.ZM25965@localhost.localdomain>
> For an Irix 6 target, when debugging an o32 program, gdb does not
> provide the correct register names when using "info registers".
> It does however, use the correct names for n32/n64. Conversely, for
> all other MIPS targets, o32 register names are always used regardless
> of the ABI.
+ if (i < 32 && (abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64))
+ return mips_n32_n64_gpr_names[i];
+ else
+ return mips_processor_reg_names[i];
Having mips_register_name() only handle half the ABIs (n32/n64) is, I
think, weird.
> The patch below causes the correct ABI-dependent register names to be
> used.
>
> I considered at least one other approach for fixing this problem. I
> considered providing new register name arrays for each of the ABIs,
> but that seemed unwieldy, and quite unnecessary too since the GPR
> register numbers are always 0-31. Also, all mips cores (that gdb
> knows about) agree on what these names should be for the o32 ABI. As
> such, it seemed easier to remap just the names of the GPRs in
> mips_register_name().
>
> Another follow on patch to this one would be to encode the knowledge
> of what the GPRs should be entirely within mips_register_name() and
> relegate the register name arrays to describing (only) the names of
> registers whose numbers are 32 or greater. (I'll wait to do this
> until I find out the reaction to the patch below.)
Can you please just do this, and consider it pre-approved. When (regnum
< 32) have mips_register_name() always generate the name directly, only
refering to mips_processor_reg_names[] when i>=32.
A bounds check on mips_processor_reg_names[i] probably wouldn't hurt.
Andrew
next prev parent reply other threads:[~2003-03-19 1:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-18 23:41 Kevin Buettner
2003-03-19 1:46 ` Andrew Cagney [this message]
2003-03-19 6:39 ` Kevin Buettner
2003-03-19 6:51 ` Kevin Buettner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E77CBE4.4090009@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox