From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8005 invoked by alias); 10 Nov 2004 23:23:20 -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 7992 invoked from network); 10 Nov 2004 23:23:14 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 10 Nov 2004 23:23:14 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iAANN97A022922 for ; Wed, 10 Nov 2004 18:23:09 -0500 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iAANN8r31498; Wed, 10 Nov 2004 18:23:08 -0500 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id EC694129D8C; Wed, 10 Nov 2004 18:22:00 -0500 (EST) Message-ID: <4192A296.2040708@gnu.org> Date: Wed, 10 Nov 2004 23:23:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 0.8 (X11/20041020) MIME-Version: 1.0 To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] segfault in get_prev_frame References: <20041110224801.GN15714@tausq.org> In-Reply-To: <20041110224801.GN15714@tausq.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00218.txt.bz2 Randolph Chung wrote: > 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? Yes (add it to your raincheck :-). Andrew > 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"); >