This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] segfault in get_prev_frame


sigh, found a bug in the inside_entry_func logic that i just
committed...

if you jump backwards in a backtrace (i.e you are at frame 0, and you
do "frame 4") you will get a segfault because the frame unwinder is not
yet filled in. using get_frame_type will do the necessary lazy
initialization.

ok to check in?

randolph


2004-11-10  Randolph Chung  <tausq@debian.org>

	* frame.c (get_prev_frame): Use get_frame_type to retrieve the frame's
	type.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.194
diff -u -p -r1.194 frame.c
--- frame.c	10 Nov 2004 21:17:56 -0000	1.194
+++ frame.c	10 Nov 2004 22:41:40 -0000
@@ -1239,7 +1239,7 @@ get_prev_frame (struct frame_info *this_
      stop at main, we should at least stop at the entry point of the
      application.  */
   if (!backtrace_past_entry
-      && this_frame->unwind->type != DUMMY_FRAME && this_frame->level >= 0
+      && get_frame_type (this_frame) != DUMMY_FRAME && this_frame->level >= 0
       && inside_entry_func (this_frame))
     {
       frame_debug_got_null_frame (gdb_stdlog, this_frame, "inside entry func");

-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]