From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@ges.redhat.com>,
Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Call FRAME_INIT_SAVED_REGS instead of mips_find_saved_regs
Date: Fri, 09 Aug 2002 13:37:00 -0000 [thread overview]
Message-ID: <1020809203705.ZM10959@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@ges.redhat.com> "Re: [RFA] Call FRAME_INIT_SAVED_REGS instead of mips_find_saved_regs" (Aug 9, 12:19am)
On Aug 9, 12:19am, Andrew Cagney wrote:
> Subject: Re: [RFA] Call FRAME_INIT_SAVED_REGS instead of mips_find_saved_r
>
> > In the course of multiarching FRAME_INIT_SAVED_REGS, I did consider
> > adding the necessary bits of code for setting
> > frame->saved_regs[SP_REGNUM] in mips_find_saved_regs, but decided it
> > would be more obvious if I did a straightforward translation of the
> > (now replaced) macro. The elimination of mips_find_saved_regs() can
> > wait for another day. After this patch though, there'll only be one
> > caller, so it'll be easier to merge mips_find_saved_regs into
> > mips_frame_init_saved_regs().
>
> Can you please add a comment to mips_find_saved_regs() indicating this.
>
> Otherwize approved.
Committed. For the record, here's what went in:
(Hmm... gotta fix the comment delimiter. I'll do that in a moment.)
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.94
diff -u -p -r1.94 mips-tdep.c
--- mips-tdep.c 9 Aug 2002 01:42:41 -0000 1.94
+++ mips-tdep.c 9 Aug 2002 20:28:30 -0000
@@ -1256,7 +1256,16 @@ mips_next_pc (CORE_ADDR pc)
}
/* Guaranteed to set fci->saved_regs to some values (it never leaves it
- NULL). */
+ NULL).
+
+ Note: kevinb/2002-08-09: The only caller of this function is (and
+ should remain) mips_frame_init_saved_regs(). In fact,
+ aside from calling mips_find_saved_regs(), mips_frame_init_saved_regs()
+ does nothing more than set frame->saved_regs[SP_REGNUM]. These two
+ functions should really be combined and now that there is only one
+ caller, it should be straightforward. (Watch out for multiple returns
+ though.)
+*/
static void
mips_find_saved_regs (struct frame_info *fci)
@@ -1465,7 +1474,7 @@ read_next_frame_reg (struct frame_info *
else
{
if (fi->saved_regs == NULL)
- mips_find_saved_regs (fi);
+ FRAME_INIT_SAVED_REGS (fi);
if (fi->saved_regs[regno])
return read_memory_integer (ADDR_BITS_REMOVE (fi->saved_regs[regno]), MIPS_SAVED_REGSIZE);
}
@@ -2890,7 +2905,7 @@ mips_pop_frame (void)
write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
if (frame->saved_regs == NULL)
- mips_find_saved_regs (frame);
+ FRAME_INIT_SAVED_REGS (frame);
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
if (regnum != SP_REGNUM && regnum != PC_REGNUM
prev parent reply other threads:[~2002-08-09 20:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-08 17:11 Kevin Buettner
2002-08-08 21:19 ` Andrew Cagney
2002-08-09 13:37 ` Kevin Buettner [this message]
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=1020809203705.ZM10959@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=ac131313@ges.redhat.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