From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15368 invoked by alias); 19 Oct 2007 11:42:07 -0000 Received: (qmail 15355 invoked by uid 22791); 19 Oct 2007 11:42:06 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 19 Oct 2007 11:42:04 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id l9JBfpTF115806 for ; Fri, 19 Oct 2007 11:41:51 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l9JBfpUd1650798 for ; Fri, 19 Oct 2007 13:41:51 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l9JBfo3a014970 for ; Fri, 19 Oct 2007 13:41:51 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l9JBfok4014965; Fri, 19 Oct 2007 13:41:50 +0200 Message-Id: <200710191141.l9JBfok4014965@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 19 Oct 2007 13:41:50 +0200 Subject: Re: [RFC] Using values to handle unwinding To: drow@false.org (Daniel Jacobowitz) Date: Fri, 19 Oct 2007 11:42:00 -0000 From: "Ulrich Weigand" Cc: gdb@sourceware.org In-Reply-To: <20071017220943.GA24607@caradoc.them.org> from "Daniel Jacobowitz" at Oct 17, 2007 06:09:43 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00165.txt.bz2 Daniel Jacobowitz wrote: > 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. Well, we can always just use "get_next_frame (this_frame)" instead of next_frame. Getting the next frame is always well-defined. So I don't think this influences the this_frame vs. next_frame discussion one way or the other ... > 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! Yes, situations similar to that were what prompted my addition of the above sanity check (Andrew's comment nonwithstanding :-/). Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com