From: "Michael Snyder" <michsnyd@cisco.com>
To: "Kevin Buettner" <kevinb@redhat.com>
Cc: <gdb-patches@sources.redhat.com>, "Wendy Peikes" <wendyp@cisco.com>
Subject: Re: [RFA] Tweak in skip_prologue for rs6000
Date: Thu, 11 Nov 2004 19:18:00 -0000 [thread overview]
Message-ID: <002601c4c823$36a06b70$5ca56b80@msnyder8600> (raw)
In-Reply-To: <20041111100404.715526e8@saguaro>
"Kevin Buettner" <kevinb@redhat.com> wrote:
> On Wed, 10 Nov 2004 17:11:21 -0800
> "Michael Snyder" <michsnyd@cisco.com> wrote:
>
>> If I'm right, this will prevent saving lr_offset twice. It looks like the
>> existing code intends to invalidate lr_reg, but setting it to zero is not
>> an invalid value.
>
> Yes, I agree with your analysis. Setting lr_reg to 0 will cause a
> match whenever doing a st[dw]{,u} r0, NUM(r1). While this is okay
> if the zero value comes from the mflr case, it is definitely not okay
> in the lr_reg invalidation code.
>
>> Probably the same is true for cr_reg and cr_offset...
>
> Yes, it appears so. Would you mind making the same fix for these?
> Consider such a patch to be preapproved.
OK, committed. Revised version attached below.
Thanks Kevin. Oh, and thanks to Wendy Peikes of Cisco
for her help in tracking this down.
2004-11-10 msnyder <msnyder@redhat.com>
* rs6000-tdep.c (skip_prologue): After saving lr_offset,
must invalidate lr_reg (so we don't try to save it again).
Ditto for cr_offset and cr_reg.
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.230
diff -p -r1.230 rs6000-tdep.c
*** rs6000-tdep.c 13 Oct 2004 16:38:22 -0000 1.230
--- rs6000-tdep.c 11 Nov 2004 19:14:29 -0000
*************** skip_prologue (CORE_ADDR pc, CORE_ADDR l
*** 981,987 ****
continue;
}
! else if (lr_reg != -1 &&
/* std Rx, NUM(r1) || stdu Rx, NUM(r1) */
(((op & 0xffff0000) == (lr_reg | 0xf8010000)) ||
/* stw Rx, NUM(r1) */
--- 981,987 ----
continue;
}
! else if (lr_reg >= 0 &&
/* std Rx, NUM(r1) || stdu Rx, NUM(r1) */
(((op & 0xffff0000) == (lr_reg | 0xf8010000)) ||
/* stw Rx, NUM(r1) */
*************** skip_prologue (CORE_ADDR pc, CORE_ADDR l
*** 991,997 ****
{ /* where Rx == lr */
fdata->lr_offset = offset;
fdata->nosavedpc = 0;
! lr_reg = 0;
if ((op & 0xfc000003) == 0xf8000000 || /* std */
(op & 0xfc000000) == 0x90000000) /* stw */
{
--- 991,999 ----
{ /* where Rx == lr */
fdata->lr_offset = offset;
fdata->nosavedpc = 0;
! /* Invalidate lr_reg, but don't set it to -1.
! That would mean that it had never been set. */
! lr_reg = -2;
if ((op & 0xfc000003) == 0xf8000000 || /* std */
(op & 0xfc000000) == 0x90000000) /* stw */
{
*************** skip_prologue (CORE_ADDR pc, CORE_ADDR l
*** 1001,1007 ****
continue;
}
! else if (cr_reg != -1 &&
/* std Rx, NUM(r1) || stdu Rx, NUM(r1) */
(((op & 0xffff0000) == (cr_reg | 0xf8010000)) ||
/* stw Rx, NUM(r1) */
--- 1003,1009 ----
continue;
}
! else if (cr_reg >= 0 &&
/* std Rx, NUM(r1) || stdu Rx, NUM(r1) */
(((op & 0xffff0000) == (cr_reg | 0xf8010000)) ||
/* stw Rx, NUM(r1) */
*************** skip_prologue (CORE_ADDR pc, CORE_ADDR l
*** 1010,1016 ****
((op & 0xffff0000) == (cr_reg | 0x94010000))))
{ /* where Rx == cr */
fdata->cr_offset = offset;
! cr_reg = 0;
if ((op & 0xfc000003) == 0xf8000000 ||
(op & 0xfc000000) == 0x90000000)
{
--- 1012,1020 ----
((op & 0xffff0000) == (cr_reg | 0x94010000))))
{ /* where Rx == cr */
fdata->cr_offset = offset;
! /* Invalidate cr_reg, but don't set it to -1.
! That would mean that it had never been set. */
! cr_reg = -2;
if ((op & 0xfc000003) == 0xf8000000 ||
(op & 0xfc000000) == 0x90000000)
{
prev parent reply other threads:[~2004-11-11 19:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-11 1:11 Michael Snyder
2004-11-11 17:04 ` Kevin Buettner
2004-11-11 19:18 ` Michael Snyder [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='002601c4c823$36a06b70$5ca56b80@msnyder8600' \
--to=michsnyd@cisco.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@redhat.com \
--cc=wendyp@cisco.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