From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Cc: Orjan Friberg <orjanf@axis.com>, Hans-Peter Nilsson <hp@axis.com>
Subject: [rfc] Delay slots on cris
Date: Sun, 29 Jun 2008 05:37:00 -0000 [thread overview]
Message-ID: <20080629024031.GA26670@caradoc.them.org> (raw)
I've been auditing all uses of the frame unwind methods and this one
seems wrong. If I understand correctly, ERP/NRP have the low bit set
when the program was interrupted in the midst of a delay slot. While
ERP is rarely saved - so by default frame_unwind_register and
get_frame_register will find the same value - I believe the copy we
want is the current frame's (i.e. the one whose current PC is pointing
at the branch). Right?
If so, this patch fixes it.
[The cris target has no listed maintainers and has had no
non-mechanical changes in just over three years. Knowing the likely
culprits, CC'd, I assume that means it works fine :-)]
--
Daniel Jacobowitz
CodeSourcery
2008-06-28 Daniel Jacobowitz <dan@codesourcery.com>
* cris-tdep.c (crisv32_single_step_through_delay): Get this frame's
register, not the previous frame's.
---
gdb/cris-tdep.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
Index: src/gdb/cris-tdep.c
===================================================================
--- src.orig/gdb/cris-tdep.c 2008-06-28 22:32:08.000000000 -0400
+++ src/gdb/cris-tdep.c 2008-06-28 22:34:02.000000000 -0400
@@ -474,18 +474,11 @@ crisv32_single_step_through_delay (struc
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
ULONGEST erp;
int ret = 0;
- char buf[4];
if (cris_mode () == cris_mode_guru)
- {
- frame_unwind_register (this_frame, NRP_REGNUM, buf);
- }
+ erp = get_frame_register_unsigned (this_frame, NRP_REGNUM);
else
- {
- frame_unwind_register (this_frame, ERP_REGNUM, buf);
- }
-
- erp = extract_unsigned_integer (buf, 4);
+ erp = get_frame_register_unsigned (this_frame, ERP_REGNUM);
if (erp & 0x1)
{
next reply other threads:[~2008-06-29 2:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-29 5:37 Daniel Jacobowitz [this message]
2008-06-30 14:00 ` Hans-Peter Nilsson
2008-06-30 14:01 ` Orjan Friberg
2008-06-30 14:25 ` drow
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=20080629024031.GA26670@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=hp@axis.com \
--cc=orjanf@axis.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