From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5241 invoked by alias); 12 Sep 2003 14:33:32 -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 5234 invoked from network); 12 Sep 2003 14:33:31 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 12 Sep 2003 14:33:31 -0000 Received: from drow by nevyn.them.org with local (Exim 4.22 #1 (Debian)) id 19xozL-0006HP-JB for ; Fri, 12 Sep 2003 10:33:31 -0400 Date: Fri, 12 Sep 2003 14:33:00 -0000 From: Daniel Jacobowitz To: gdb@sources.redhat.com Subject: Re: gcc HEAD bad stabs (?) Message-ID: <20030912143331.GB24071@nevyn.them.org> Mail-Followup-To: gdb@sources.redhat.com References: <200309120811.h8C8BF3m017160@duracef.shout.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309120811.h8C8BF3m017160@duracef.shout.net> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-09/txt/msg00170.txt.bz2 On Fri, Sep 12, 2003 at 04:11:15AM -0400, Michael Elizabeth Chastain wrote: > I think gcc HEAD is emitting bad stabs again, > and need some confirmation before I can file a bug report. > > The questionable stabs happen when 'main' calls 'factorial', > but there is no prototype for 'factorial' yet. Here are all > the stabs after the boilerplate stabs. The full source code > and assembly code are at the end of the message. > > # some stabs for factorial > .stabs "factorial:F(0,3)",36,0,13,factorial > .stabs "value:p(0,3)",160,0,12,8 > .stabs "value:r(0,3)",64,0,12,3 > .stabs "",36,0,0,.Lscope0-factorial > # some stabs for main > .stabs "main:F(0,3)",36,0,6,main > .stabs "argc:p(0,3)",160,0,5,8 > .stabs "argv:p(0,21)=*(3,36)",160,0,5,12 > .stabs "envp:p(0,21)",160,0,5,16 > .stabs "/usr/include/stdlib.h",132,0,0,.Ltext1 > .stabs "z0.c",132,0,0,.Ltext2 > # stray stab for factorial!! > .stabs "factorial:F(0,3)",36,0,13,factorial > # end of main > .stabs "",36,0,0,.Lscope1-main > .stabs "",100,0,0,.Letext > > Look at that stray stab for factorial, which occurs just > before the stab for .Lscope1-main! > > This causes a subtle problem in gdb. gdb gets a bogus endaddr > for the block with main in it, so find_function_start_sal fails > to adjust for the prologue properly, so the breakpoint at the > beginning of an instruction happens too early. The bad block > probably causes more problems, too. I agree that this is a bug. Factorial is not inside of main, so stabs with its address shouldn't be either. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer