From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16540 invoked by alias); 10 Nov 2004 22:48:33 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16204 invoked from network); 10 Nov 2004 22:48:04 -0000 Received: from unknown (HELO pippin.tausq.org) (64.81.244.94) by sourceware.org with SMTP; 10 Nov 2004 22:48:04 -0000 Received: by pippin.tausq.org (Postfix, from userid 1000) id 9BD80CEE67; Wed, 10 Nov 2004 14:48:01 -0800 (PST) Date: Wed, 10 Nov 2004 22:48:00 -0000 From: Randolph Chung To: gdb-patches@sources.redhat.com Subject: [patch] segfault in get_prev_frame Message-ID: <20041110224801.GN15714@tausq.org> Reply-To: Randolph Chung Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-11/txt/msg00217.txt.bz2 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 * 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/