From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12458 invoked by alias); 17 Oct 2007 22:09:50 -0000 Received: (qmail 12448 invoked by uid 22791); 17 Oct 2007 22:09:49 -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; Wed, 17 Oct 2007 22:09:47 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 360CC981F1 for ; Wed, 17 Oct 2007 22:09:45 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 098E3980A5 for ; Wed, 17 Oct 2007 22:09:45 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1IiH5D-0006Ub-Ud for gdb@sourceware.org; Wed, 17 Oct 2007 18:09:43 -0400 Date: Wed, 17 Oct 2007 22:09:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org Subject: Re: [RFC] Using values to handle unwinding Message-ID: <20071017220943.GA24607@caradoc.them.org> Mail-Followup-To: gdb@sourceware.org References: <20071017160350.GA26804@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071017160350.GA26804@caradoc.them.org> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00125.txt.bz2 There is one current use I know of for the NEXT_FRAME argument to unwinders, in s390-tdep.c: /* If the next frame is a NORMAL_FRAME, this frame *cannot* have frame size zero. This is only possible if the next frame is a sentinel frame, a dummy frame, or a signal trampoline frame. */ /* FIXME: cagney/2004-05-01: This sanity check shouldn't be needed, instead the code should simpliy rely on its analysis. */ if (get_frame_type (next_frame) == NORMAL_FRAME) return 0; Maybe this means we should either find a generic place to do this sort of check, or pass both this and next frame, or leave the frame argument alone after all. Or add a new frame function, like "frame_called_normally (this_frame)" which seems to be the question people are really asking when they write code like the above. I noticed this while looking at m68k-elf backtraces. It would be nice to add a check like the above, either there or somewhere more generic, because otherwise a garbage stack pointer leads to a near-infinite backtrace. Any time that the current frame's PC points to somewhere GDB has no symbol info, GDB will conclude that there is a frameless function which only stored its return address on the stack at the call. So each word of the stack is popped in turn and becomes a new PC. Not very useful! -- Daniel Jacobowitz CodeSourcery