From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1151 invoked by alias); 31 Dec 2003 19:58:27 -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 1144 invoked from network); 31 Dec 2003 19:58:27 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 31 Dec 2003 19:58:27 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 42D382B8F; Wed, 31 Dec 2003 14:58:26 -0500 (EST) Message-ID: <3FF32A62.8050607@gnu.org> Date: Wed, 31 Dec 2003 19:58:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 MIME-Version: 1.0 To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Remove zero PC check from blockframe.c:inside_main_func() References: <200312131509.hBDF9TLA035995@elgar.kettenis.dyndns.org> <3FDB6232.5040102@gnu.org> <200312132206.hBDM6p33006707@elgar.kettenis.dyndns.org> <3FDBAD57.7060906@gnu.org> <200312141822.hBEIMFZ7014165@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-12/txt/msg00538.txt.bz2 > Date: Sat, 13 Dec 2003 19:22:47 -0500 > From: Andrew Cagney > > > RCS file: /cvs/src/src/gdb/frame.c,v > > retrieving revision 1.153 > > diff -u -p -r1.153 frame.c > > --- frame.c 10 Dec 2003 17:40:42 -0000 1.153 > > +++ frame.c 13 Dec 2003 21:47:43 -0000 > > @@ -1732,6 +1732,7 @@ struct frame_info * > > get_prev_frame (struct frame_info *this_frame) > > { > > struct frame_info *prev_frame; > > + CORE_ADDR pc; > > > > if (frame_debug) > > { > > @@ -1961,7 +1962,8 @@ get_prev_frame (struct frame_info *this_ > > because (well ignoring the PPC) a dummy frame can be located > > using THIS_FRAME's frame ID. */ > > > > - if (frame_pc_unwind (this_frame) == 0) > > + pc = frame_pc_unwind (this_frame); > > + if (this_frame->level >= 0 && pc == 0) > > { > > /* The allocated PREV_FRAME will be reclaimed when the frame > > obstack is next purged. > > Can it be deleted? > > I think so. I tested i386-unknown-freebsd4.7, i386-pc-solaris2.9, > x86_64-unknown-freebsd5.2 and alpha-unknown-freenbsd5.2, and things > didn't change. > > This would likely affect the initial call sequence made to the unwinder > - frame_pc_unwind may not be called first (?). But I also think that > the reason for insisting on an explicit pc unwind may have also been > removed - the new code is written more robustly anyway. > > I think I agree. So shall I remove the code? Yes, just watch for comments claiming that the pc is unwound first though though. I believe it's now really entirely determined by the per-architecture frame sniffers. Andrew