Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/hppa] Unwinding from noreturn functions
       [not found] ` <20060302151526.GA7033@nevyn.them.org>
@ 2006-03-03  1:26   ` Randolph Chung
  2006-03-30 11:17     ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Randolph Chung @ 2006-03-03  1:26 UTC (permalink / raw)
  To: gdb-patches

[-- 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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA/hppa] Unwinding from noreturn functions
  2006-03-03  1:26   ` [RFA/hppa] Unwinding from noreturn functions Randolph Chung
@ 2006-03-30 11:17     ` Daniel Jacobowitz
  2006-03-30 16:17       ` Randolph Chung
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2006-03-30 11:17 UTC (permalink / raw)
  To: Randolph Chung; +Cc: gdb-patches

On Fri, Mar 03, 2006 at 08:08:33AM +0800, Randolph Chung wrote:
> Thanks to Dan's hint about frame_unwind_address_in_block, the following 
> fixes the unwinding problem I saw. OK?
> 
> randolph
> 

> 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.

This looks right to me, and you can approve patches to this file
anyway, so that's two votes in favor :-)

OK.


-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA/hppa] Unwinding from noreturn functions
  2006-03-30 11:17     ` Daniel Jacobowitz
@ 2006-03-30 16:17       ` Randolph Chung
  0 siblings, 0 replies; 3+ messages in thread
From: Randolph Chung @ 2006-03-30 16:17 UTC (permalink / raw)
  To: gdb-patches

> This looks right to me, and you can approve patches to this file
> anyway, so that's two votes in favor :-)
> 
> OK.

committed, thanks
randolph


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-30 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <44070B97.2050707@tausq.org>
     [not found] ` <20060302151526.GA7033@nevyn.them.org>
2006-03-03  1:26   ` [RFA/hppa] Unwinding from noreturn functions Randolph Chung
2006-03-30 11:17     ` Daniel Jacobowitz
2006-03-30 16:17       ` Randolph Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox