From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1407 invoked by alias); 17 Apr 2006 08:58:57 -0000 Received: (qmail 1396 invoked by uid 22791); 17 Apr 2006 08:58:56 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Apr 2006 08:58:55 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k3H8wiV9012552; Mon, 17 Apr 2006 10:58:44 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k3H8wiYi011771; Mon, 17 Apr 2006 10:58:44 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k3H8whgs007879; Mon, 17 Apr 2006 10:58:43 +0200 (CEST) Date: Mon, 17 Apr 2006 09:05:00 -0000 Message-Id: <200604170858.k3H8whgs007879@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: eliz@gnu.org CC: nickrob@snap.net.nz, gdb@sources.redhat.com In-reply-to: (message from Eli Zaretskii on Mon, 17 Apr 2006 10:05:50 +0300) Subject: Re: info frame References: <17474.53281.404673.189792@farnswood.snap.net.nz> <200604162333.k3GNXLeX004661@elgar.sibelius.xs4all.nl> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00233.txt.bz2 > Date: Mon, 17 Apr 2006 10:05:50 +0300 > From: Eli Zaretskii > > > Date: Mon, 17 Apr 2006 01:33:21 +0200 (CEST) > > From: Mark Kettenis > > CC: gdb@sources.redhat.com > > > > > (gdb) info frame > > > Stack level 0, frame at 0xbffff710: > > > eip = 0x80484a9 in main (myprog.c:47); saved eip 0x4006015a > > > source language c. > > > Arglist at 0xbffff708, args: argc=1, argv=0xbffff774 > > > Locals at 0xbffff708, Previous frame's sp is 0xbffff710 > > > Saved registers: > > > ebp at 0xbffff708, eip at 0xbffff70c > > > (gdb) p $fp > > > $1 = (void *) 0xbffff708 > > > > > > Can this be right? > > > > Yes, current GDB uses the convention that the frame address is the > > Canonical Frame Address (CFA) as used by the DWARF 2 Call Frame Info > > (CFI). > > Does this mean that, if the debug info is stabs or something other > than DWARF 2, a different frame address will be displayed for the same > code? No. All the different unwinders use the same convention. This is exactly why the convention changed on i386 when the DWARF 2 unwinder was introduced: to make the fallback unwinder match the DWARF 2 unwinder. > > In general the CFA is the value of the stack pointer when the > > current function was called. > > ``In general''? Does this mean that in some cases it will be > something else? If so, when that will happen, and what will we show > then? DWARF 2 doesn't specify exactly what the convention is. So most ISA's use the convention above, but other ISA's might use a different convention. Also different compilers for the same ISA might use different conventions when they generate DWARF 2 debug information. In that case you're screwed because the CFA returned from the DWARF 2 unwinder will no longer match the convention used by GDB's other unwinders. So far we haven't seen any other compilers that use a different convention, so things are safe for now. Mark