From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9947 invoked by alias); 22 Feb 2008 17:21:25 -0000 Received: (qmail 9937 invoked by uid 22791); 22 Feb 2008 17:21:24 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Feb 2008 17:20:59 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id C12D798259; Fri, 22 Feb 2008 17:20:57 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 24249981FC; Fri, 22 Feb 2008 17:20:57 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JSbZw-0000SA-DS; Fri, 22 Feb 2008 12:20:56 -0500 Date: Fri, 22 Feb 2008 18:31:00 -0000 From: Daniel Jacobowitz To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org, Nigel Stephens , "Maciej W. Rozycki" Subject: Re: Do not unwind frames past NULL PC Message-ID: <20080222172056.GA1693@caradoc.them.org> Mail-Followup-To: "Maciej W. Rozycki" , gdb-patches@sourceware.org, Nigel Stephens , "Maciej W. Rozycki" References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00360.txt.bz2 On Fri, Feb 22, 2008 at 05:12:18PM +0000, Maciej W. Rozycki wrote: > Hello, > > Some architectures, like MIPS, specify in the ABI that the value of the > return address in a frame (or in other words the value of the PC the frame > would have been called from) being zero denotes the outermost frame. At > the moment GDB does not seem to have a way to terminate frame unwinding in > an architecture-specific way (or to that matter any that would not imply > an error condition) in get_prev_frame_1(), which is where such a check > would be needed. > > However even for these architectures which may not necessarily specify in > the relevant ABI that a NULL PC is the terminating value it seems rather > unlikely for a function to have been called in a way which would make its > return address to be zero and yet it having a genuine caller with an > associated frame. Therefore I propose the following check to be > introduced to get_prev_frame_1(). It removes the confusing bogus frame at > the bottom of a backtrace like below: Similar changes have been proposed several times, but were controversial. http://sourceware.org/ml/gdb-patches/2006-05/msg00196.html http://sourceware.org/ml/gdb-patches/2006-07/msg00296.html and more recently: http://sourceware.org/ml/gdb-patches/2007-12/msg00004.html -- Daniel Jacobowitz CodeSourcery