From: Andrew Cagney <ac131313@redhat.com>
To: Fred Fish <fnf@intrinsity.com>, Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Testing REGISTER_NAME in mips-linux-nat.c
Date: Fri, 27 Jun 2003 19:31:00 -0000 [thread overview]
Message-ID: <3EFC9B86.5060300@redhat.com> (raw)
In-Reply-To: <20030627172013.54F648B5FD@bletchley.vert.intrinsity.com>
> A recent change to mips_register_name to return a empty string for
> register numbers < NUM_REGS is causing problems with the native mips
> linux port. The change in mips_register_name is:
Arrgh, they keep turning up :-(
> + /* Map [NUM_REGS .. 2*NUM_REGS) onto the raw registers, but then
> + don't make the raw register names visible. */
> + int rawnum = regno % NUM_REGS;
> + if (regno < NUM_REGS)
> + return "";
>
> Now for example when mips_linux_cannot_fetch_register() is called with
> regno == PC_REGNUM, it will return 1 and reading of the PC will return
> zero as the PC value.
>
> I think this is the correct patch, but I'm not 100% sure. Perhaps we
> can just eliminate the REGISTER_NAME check completely.
The assertion:
gdb_assert (regno >= 0 && regno < NUM_REGS);
holds so, yes, eliminating REGISTER_NAME would make sense.
Hmm, how come this doesn't just use PTRACE_GETREGS?
Daniel?
Andrew
> ============================================================================
>
>
> 2003-06-27 Fred Fish <fnf@intrinsity.com>
>
> * mips-linux-nat.c (mips_linux_cannot_fetch_register): Only test
> register name if it is a pseudo register.
>
>
> Index: mips-linux-nat.c
> ===================================================================
> RCS file: /mips/newtools/fsf/gdb/gdb/mips-linux-nat.c,v
> retrieving revision 1.2
> diff -c -p -r1.2 mips-linux-nat.c
> *** mips-linux-nat.c 2003/02/18 21:36:24 1.2
> --- mips-linux-nat.c 2003/06/27 17:11:38
> ***************
> *** 29,35 ****
> int
> mips_linux_cannot_fetch_register (int regno)
> {
> ! if (REGISTER_NAME (regno)[0] == 0)
> return 1;
> if (regno == PS_REGNUM)
> return 1;
> --- 29,35 ----
> int
> mips_linux_cannot_fetch_register (int regno)
> {
> ! if (regno >= NUM_REGS && REGISTER_NAME (regno)[0] == 0)
> return 1;
> if (regno == PS_REGNUM)
> return 1;
> *************** mips_linux_cannot_fetch_register (int re
> *** 42,48 ****
> int
> mips_linux_cannot_store_register (int regno)
> {
> ! if (REGISTER_NAME (regno)[0] == 0)
> return 1;
> if (regno == PS_REGNUM)
> return 1;
> --- 42,48 ----
> int
> mips_linux_cannot_store_register (int regno)
> {
> ! if (regno >= NUM_REGS && REGISTER_NAME (regno)[0] == 0)
> return 1;
> if (regno == PS_REGNUM)
> return 1;
>
next prev parent reply other threads:[~2003-06-27 19:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-27 17:20 Fred Fish
2003-06-27 19:31 ` Andrew Cagney [this message]
2003-06-28 18:36 ` Daniel Jacobowitz
2003-07-03 0:44 ` Fred Fish
2003-07-07 18:09 ` Daniel Jacobowitz
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=3EFC9B86.5060300@redhat.com \
--to=ac131313@redhat.com \
--cc=drow@mvista.com \
--cc=fnf@intrinsity.com \
--cc=gdb-patches@sources.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