From: Randolph Chung <randolph@tausq.org>
To: gdb-patches@sources.redhat.com
Subject: [RFA/hppa] Unwinding from noreturn functions
Date: Fri, 03 Mar 2006 01:26:00 -0000 [thread overview]
Message-ID: <44078901.2060609@tausq.org> (raw)
In-Reply-To: <20060302151526.GA7033@nevyn.them.org>
[-- Attachment #1: Type: text/plain, Size: 123 bytes --]
Thanks to Dan's hint about frame_unwind_address_in_block, the following
fixes the unwinding problem I saw. OK?
randolph
[-- Attachment #2: noret.diff --]
[-- Type: text/x-patch, Size: 1937 bytes --]
2006-03-03 Randolph Chung <tausq@debian.org>
* hppa-tdep.c (hppa_find_unwind_entry_in_block): New.
(hppa_frame_cache): Use new function to find unwind entry.
(hppa_frame_this_id): Likewise.
(hppa_frame_unwind_sniffer): Likewise.
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.221
diff -u -p -r1.221 hppa-tdep.c
--- hppa-tdep.c 1 Mar 2006 05:43:03 -0000 1.221
+++ hppa-tdep.c 3 Mar 2006 00:04:27 -0000
@@ -1782,6 +1782,17 @@ hppa_skip_prologue (CORE_ADDR pc)
return (skip_prologue_hard_way (pc, 1));
}
+/* Return an unwind entry that falls within the frame's code block. */
+static struct unwind_table_entry *
+hppa_find_unwind_entry_in_block (struct frame_info *f)
+{
+ CORE_ADDR pc;
+
+ pc = frame_unwind_address_in_block (f);
+ pc = gdbarch_addr_bits_remove (get_frame_arch (f), pc);
+ return find_unwind_entry (pc);
+}
+
struct hppa_frame_cache
{
CORE_ADDR base;
@@ -1817,7 +1828,7 @@ hppa_frame_cache (struct frame_info *nex
cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
/* Yow! */
- u = find_unwind_entry (frame_pc_unwind (next_frame));
+ u = hppa_find_unwind_entry_in_block (next_frame);
if (!u)
{
if (hppa_debug)
@@ -2197,7 +2208,7 @@ hppa_frame_this_id (struct frame_info *n
struct unwind_table_entry *u;
info = hppa_frame_cache (next_frame, this_cache);
- u = find_unwind_entry (pc);
+ u = hppa_find_unwind_entry_in_block (next_frame);
(*this_id) = frame_id_build (info->base, u->region_start);
}
@@ -2224,9 +2235,7 @@ static const struct frame_unwind hppa_fr
static const struct frame_unwind *
hppa_frame_unwind_sniffer (struct frame_info *next_frame)
{
- CORE_ADDR pc = frame_pc_unwind (next_frame);
-
- if (find_unwind_entry (pc))
+ if (hppa_find_unwind_entry_in_block (next_frame))
return &hppa_frame_unwind;
return NULL;
next parent reply other threads:[~2006-03-03 0:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <44070B97.2050707@tausq.org>
[not found] ` <20060302151526.GA7033@nevyn.them.org>
2006-03-03 1:26 ` Randolph Chung [this message]
2006-03-30 11:17 ` Daniel Jacobowitz
2006-03-30 16:17 ` Randolph Chung
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=44078901.2060609@tausq.org \
--to=randolph@tausq.org \
--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