From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31124 invoked by alias); 13 Feb 2003 17:08:01 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31117 invoked from network); 13 Feb 2003 17:08:01 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 13 Feb 2003 17:08:01 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18jOjC-0006OG-00; Thu, 13 Feb 2003 13:08:58 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18jMq3-0000R9-00; Thu, 13 Feb 2003 12:07:55 -0500 Date: Thu, 13 Feb 2003 17:08:00 -0000 From: Daniel Jacobowitz To: a2782@dis.ulpgc.es Cc: gdb@sources.redhat.com Subject: Re: Problems in the edge of functions Message-ID: <20030213170755.GA26208@nevyn.them.org> Mail-Followup-To: a2782@dis.ulpgc.es, gdb@sources.redhat.com References: <200302131757.h1DHvbE01132@siglo21.dis.ulpgc.es> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302131757.h1DHvbE01132@siglo21.dis.ulpgc.es> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-02/txt/msg00212.txt.bz2 On Thu, Feb 13, 2003 at 05:57:37PM +0000, a2782@dis.ulpgc.es wrote: > Hi to all! > > I\'m using GDB to design a didactic graphic environment over it (as > DDD). But I have found that, when I put a breakpoint in the first > machine instruction of a function (push %ebp) and I ask the debugger > for the information of the frames, GDB \"lies\". An example: > If I type \"info locals\" when the program stops in the breakpoint, GDB > returns: \"b = 10\" (it should return \"b = 14726457264\"). It\'s evident > that GDB is looking in the position where it thinks that \'b\' should be > (but in this position we find \'a\'). The reason why this occurs is that > the stack has not been updated (the stack updates with the > instructions \'mov %esp, %ebp\', and \'subl $8, %esp\', but they haven\'t > been executed). However, if I type \'x /1wx 0x0bfff...\' and \'info > registers\', I\'ll be able to discover the real state of the stack. > > There\'s a similar problem with the instruction \'leave\'. > > My question is: is this a bug? Or is there a way of solving it? It's a bug, but there's no real plans to fix it right now; eventually, better unwind information will probably fix it, and it's not a big deal. The locals don't have a value yet, after all. Sometimes this causes messed up backtraces, too. It's really less headache for everyone if you just stop after the prologue :) -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer