[patch/rfa] allow unwinding "past main" for dummy frames

Randolph Chung randolph@tausq.org
Mon Dec 6 03:31:00 GMT 2004


On hpux, we push a small bit of code on the stack to implement function
calls from gdb. The stack trampoline contains a return address that
points back to the current function. this is needed to properly restore
the space registers (see hppa_hpux_push_dummy_code in hppa-hpux-tdep.c
for a much more detailed explanation).  The upshot of all of this is
that when we do a backtrace from a gdb-called function, a backtrace can
be prematurely truncated at a dummy frame. Since it doesn't make sense
anyway to stop unwinding at dummy frames, this patch skips the "main
function" detection logic for dummy frames. The same logic is already
there for checking against the entry function a bit farther down in
get_prev_frame ().

ok?

randolph

2004-12-05  Randolph Chung  <tausq@debian.org>

	* frame.c (get_prev_frame): Don't terminate unwinding at main if we
	are unwinding through a dummy frame.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.195
diff -u -p -r1.195 frame.c
--- frame.c	10 Nov 2004 23:26:33 -0000	1.195
+++ frame.c	6 Dec 2004 03:19:46 -0000
@@ -1200,6 +1200,7 @@ get_prev_frame (struct frame_info *this_
   gdb_assert (this_frame != NULL);
 
   if (this_frame->level >= 0
+      && get_frame_type (this_frame) != DUMMY_FRAME
       && !backtrace_past_main
       && inside_main_func (this_frame))
     /* Don't unwind past main().  Note, this is done _before_ the
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/



More information about the Gdb-patches mailing list