From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Subject: Re: New stabs with gcc HEAD
Date: Tue, 26 Aug 2003 13:44:00 -0000 [thread overview]
Message-ID: <20030826134418.GA12859@nevyn.them.org> (raw)
In-Reply-To: <200308261012.h7QACZgo022761@duracef.shout.net>
On Tue, Aug 26, 2003 at 06:12:35AM -0400, Michael Elizabeth Chastain wrote:
> [Argh! I sent this to gcc@sources.redhat.com because I was thinking of gcc.
> But I really want to talk about the issue with gdb people first!]
>
> gcc HEAD changed its stabs and gdb is choking on the new stabs.
> This happens with C++ and type "char *".
>
> The test case is pretty simple:
>
> char * dm_type_char_star (char *p)
> {
> return p;
> }
>
> int main ()
> {
> return 0;
> }
>
> Compile this with "g++ -gstabs+" with an i386 target.
> (It's important to use an i386 because the bug depends on
> target-specific definition of __builtin_va_list).
>
> The old good stabs look like this:
>
> .stabs "char:t(0,2)=r(0,2);0;127;",128,0,0,0
> .stabs "__builtin_va_list:t(0,20)=*(0,2)",128,0,0,0
> .stabs "_Z17dm_type_char_starPc:F(0,24)=*(0,2)",36,0,2,_Z17dm_type_char_starPc
>
> There is a stab for "char" type. Then the types that use "char *"
> refer back to (0,2).
>
> The new bad stabs look like this:
>
> .stabs "__builtin_va_list:t(0,10)=*(0,11)=r(0,11);0;127;",128,0,0,0
> .stabs "_Z17dm_type_char_starPc:F(0,13)=*(0,11)",36,0,2,_Z17dm_type_char_starPc
>
> There is no more stab for the builtin type "char". So
> __builtin_va_list defines its own integral type as
> (0,11) with no name, and then dm_type_char_star refers to it.
>
> The lack of a name means gdb isn't going to print "char".
> In fact, gdb 5.3 gets unhappy:
>
> (gdb) print &'dm_type_char_star(char*)'
> $1 = (<invalid type code 7> *(*)(
> <invalid type code 7> *)) 0x80482f4 <dm_type_char_star(char*)>
>
> gdb HEAD behaves the same way.
>
> Over in gcc land, I found the critical patch, so it ought to
> be easy for gcc to revert their behavior if we ask them to.
> (In fact I even patched my own compiler but the patch is probably
> bogus).
>
> So my question is: should we enhance gdb to handle these stabs?
> It would be painful, because there is no type name, so we would
> have to infer from the "0;127" range that this is a "char".
> Or should we push back on gcc to emit an explicit stab for
> the "char" type?
I'd say GCC was broken. What patch broke it?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-08-26 13:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-26 10:12 Michael Elizabeth Chastain
2003-08-26 13:44 ` Daniel Jacobowitz [this message]
2003-08-26 13:56 Michael Elizabeth Chastain
2003-08-26 15:24 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=20030826134418.GA12859@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