From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Subject: Re: gcc HEAD bad stabs (?)
Date: Fri, 12 Sep 2003 14:33:00 -0000 [thread overview]
Message-ID: <20030912143331.GB24071@nevyn.them.org> (raw)
In-Reply-To: <200309120811.h8C8BF3m017160@duracef.shout.net>
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
next prev parent reply other threads:[~2003-09-12 14:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-12 8:11 Michael Elizabeth Chastain
2003-09-12 14:33 ` Daniel Jacobowitz [this message]
2003-09-12 21:05 ` Christopher Faylor
2003-09-12 18:33 Michael Elizabeth Chastain
2003-09-12 22:24 Michael Elizabeth Chastain
2003-09-13 0:01 ` Christopher Faylor
2003-09-13 0:17 Michael Elizabeth Chastain
2003-09-13 0:36 ` Christopher Faylor
2003-09-13 0:40 Michael Elizabeth Chastain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030912143331.GB24071@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox