public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Re: GCC, stabs, mangled names
@ 2003-03-11 17:24 Michael Elizabeth Chastain
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Elizabeth Chastain @ 2003-03-11 17:24 UTC (permalink / raw)
  To: carlton; +Cc: drow, gdb

Okay, your issue is different than my issue, so I'll forget about
my issue here.

Input is:

  namespace C {
    namespace D {
      int cd = 1;
    }
  }

Output with gcc 3.2.2 binutils 2.13.2.1 -gstabs+ -S -dA is below.

With gcc gcc-3_2-branch%20030308, I get identical output, except for the
.ident string.

Michael C

	.file	"cd.cc"
	.stabs	"/berman/home/mgnu/gdb/nested-namespace/",100,0,0,.Ltext0
	.stabs	"cd.cc",100,0,0,.Ltext0
	.text
.Ltext0:
	.stabs	"gcc2_compiled.",60,0,0,0
	.stabs	"int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0
	.stabs	"char:t(0,2)=r(0,2);0;127;",128,0,0,0
	.stabs	"long int:t(0,3)=r(0,3);-2147483648;2147483647;",128,0,0,0
	.stabs	"unsigned int:t(0,4)=r(0,4);0000000000000;0037777777777;",128,0,0,0
	.stabs	"long unsigned int:t(0,5)=r(0,5);0000000000000;0037777777777;",128,0,0,0
	.stabs	"long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0,0
	.stabs	"long long unsigned int:t(0,7)=@s64;r(0,7);0000000000000;01777777777777777777777;",128,0,0,0
	.stabs	"short int:t(0,8)=@s16;r(0,8);-32768;32767;",128,0,0,0
	.stabs	"short unsigned int:t(0,9)=@s16;r(0,9);0;65535;",128,0,0,0
	.stabs	"signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0
	.stabs	"unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0
	.stabs	"float:t(0,12)=r(0,1);4;0;",128,0,0,0
	.stabs	"double:t(0,13)=r(0,1);8;0;",128,0,0,0
	.stabs	"long double:t(0,14)=r(0,1);12;0;",128,0,0,0
	.stabs	"complex int:t(0,15)=s8real:(0,1),0,32;imag:(0,1),32,32;;",128,0,0,0
	.stabs	"complex float:t(0,16)=R3;8;0;",128,0,0,0
	.stabs	"complex double:t(0,17)=R4;16;0;",128,0,0,0
	.stabs	"complex long double:t(0,18)=R5;24;0;",128,0,0,0
	.stabs	"wchar_t:t(0,19)=r(0,19);-2147483648;2147483647;",128,0,0,0
	.stabs	"__builtin_va_list:t(0,20)=*(0,2)",128,0,0,0
	.stabs	"bool:t(0,21)=@s8;-16;",128,0,0,0
	.stabs	"__vtbl_ptr_type:t(0,22)=*(0,23)=f(0,1)",128,0,0,0
	.stabs	"cd.cc",130,0,0,0
.globl _ZN1C1D2cdE
	.data
	.align 4
	.type	_ZN1C1D2cdE,@object
	.size	_ZN1C1D2cdE,4
_ZN1C1D2cdE:
	.long	1
	.stabs	"cd:G(0,1)",32,0,3,0
	.text
	.stabs "",100,0,0,.Letext
.Letext:
	.ident	"GCC: (GNU) 3.2.2"

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GCC, stabs, mangled names
  2003-03-11  6:07 Michael Elizabeth Chastain
@ 2003-03-11 20:33 ` David Carlton
  0 siblings, 0 replies; 9+ messages in thread
From: David Carlton @ 2003-03-11 20:33 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: drow, gdb

On Tue, 11 Mar 2003 00:07:08 -0600, Michael Elizabeth Chastain <mec@shout.net> said:

> My opinion: gdb's goal should be that we have no regressions in stabs+
> support, so that everything that worked in 5.3 continues to work in
> 5.4/6.0.  It's important that *almost every* user of gdb 5.3 has a good
> experience if they upgrade, so that we don't get users that are stuck
> on old versions of gdb.  After that, though, fixing existing stabs+
> bugs is low priority to me.

I think that's reasonable enough, and I'm even willing to expend some
effort to make add new features to stabs as well as DWARF when it's
not too hard.  Unfortunately, this particular situation runs into
problems on the GCC end of things; the added amount of effort to get
all _that_ resolved isn't something that thrills me too much.

David Carlton
carlton@math.stanford.edu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GCC, stabs, mangled names
  2003-03-11  5:55 Michael Elizabeth Chastain
@ 2003-03-11 17:06 ` David Carlton
  0 siblings, 0 replies; 9+ messages in thread
From: David Carlton @ 2003-03-11 17:06 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb, drow

On Mon, 10 Mar 2003 23:55:05 -0600, Michael Elizabeth Chastain <mec@shout.net> said:
> Hi David,

>> Is there a problem with gcc -gstabs+ and mangled names in recent
>> GCC's?

> What do you mean by "recent GCC's"?

> gcc 3.2.2 and gcc gcc-3_2-branch are fine.

I tested 3.1 and saw that stabs doesn't give mangled names.  I don't
have 3.2.2 on this machine; but, according to your tests there are
regressions on namespace.exp tests with -gstabs+ from 2.95.3 to 3.2.2,
which makes me suspect that the same problem is still there in 3.2.2.

What's the output of gcc -gstabs+ -S -dA on this file for 3.2.2?

namespace C {
  namespace D {
    int cd = 1;
  }
}

David Carlton
carlton@math.stanford.edu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GCC, stabs, mangled names
@ 2003-03-11  6:07 Michael Elizabeth Chastain
  2003-03-11 20:33 ` David Carlton
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Elizabeth Chastain @ 2003-03-11  6:07 UTC (permalink / raw)
  To: carlton, drow; +Cc: gdb

Daniel Jacobowitz writes:

drow> FYI, my position on stabs has crystalized over time: I don't care, use
drow> DWARF-2.  Even on Solaris if you use the GNU tools I believe DWARF-2 is
drow> available as an option.

I just built gcc 3.2.2 on sparc-sun-solaris2.7 and stabs+ is the default
and dwarf-2 is available as an option.

The last time I checked (December 2002 with gcc 3.2.1), I found that
Cygwin has stabs+ but not dwarf-2.

  http://sources.redhat.com/ml/gdb/2002-12/msg00128.html

My opinion: gdb's goal should be that we have no regressions in stabs+
support, so that everything that worked in 5.3 continues to work in
5.4/6.0.  It's important that *almost every* user of gdb 5.3 has a good
experience if they upgrade, so that we don't get users that are stuck
on old versions of gdb.  After that, though, fixing existing stabs+
bugs is low priority to me.

Michael C

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GCC, stabs, mangled names
@ 2003-03-11  5:55 Michael Elizabeth Chastain
  2003-03-11 17:06 ` David Carlton
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Elizabeth Chastain @ 2003-03-11  5:55 UTC (permalink / raw)
  To: carlton, gdb; +Cc: drow

Hi David,

> Is there a problem with gcc -gstabs+ and mangled names in recent
> GCC's?

What do you mean by "recent GCC's"?

gcc 3.2.2 and gcc gcc-3_2-branch are fine.

I'm getting dozens of new regressions with gcc HEAD -gstabs+,
regressions from 2003-02-28 to 2003-03-08.

gcc gcc-3_3-branch has a non-stabs regression where programs that
include standard header files don't compile (pr gcc/10018).
I suspect that most of the people who test gcc test a built,
non-installed version, because it shows up quick when I install
gcc and set my $PATH to use it.

Michael C

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GCC, stabs, mangled names
  2003-03-11  1:20   ` David Carlton
@ 2003-03-11  1:24     ` Daniel Jacobowitz
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Jacobowitz @ 2003-03-11  1:24 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb, Michael Elizabeth Chastain

On Mon, Mar 10, 2003 at 05:20:32PM -0800, David Carlton wrote:
> On Mon, 10 Mar 2003 19:56:56 -0500, Daniel Jacobowitz <drow@mvista.com> said:
> 
> > It's unclear what the right thing to do is.  Stabs is underspecified
> > (and underimplemented too).  Someone needs to decide what would be
> > useful.
> 
> I compared this with 2.95.3, and it seems that GCC switched from only
> using mangled names to only using demangled names.  If we can't have
> both, it seems to me that only having mangled names is more useful.
> 
> Did anybody from the GDB side ask them to switch the output that they
> produced?  If so, what was the rationale?

FYI, my position on stabs has crystalized over time: I don't care, use
DWARF-2.  Even on Solaris if you use the GNU tools I believe DWARF-2 is
available as an option.  If someone hits a platform that they care
about where this isn't an option, and they want to make the stabs
support work again, then we can deal with it - only then.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GCC, stabs, mangled names
  2003-03-11  0:57 ` Daniel Jacobowitz
@ 2003-03-11  1:20   ` David Carlton
  2003-03-11  1:24     ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: David Carlton @ 2003-03-11  1:20 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb, Michael Elizabeth Chastain

On Mon, 10 Mar 2003 19:56:56 -0500, Daniel Jacobowitz <drow@mvista.com> said:

> It's unclear what the right thing to do is.  Stabs is underspecified
> (and underimplemented too).  Someone needs to decide what would be
> useful.

I compared this with 2.95.3, and it seems that GCC switched from only
using mangled names to only using demangled names.  If we can't have
both, it seems to me that only having mangled names is more useful.

Did anybody from the GDB side ask them to switch the output that they
produced?  If so, what was the rationale?

David Carlton
carlton@math.stanford.edu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GCC, stabs, mangled names
  2003-03-11  0:53 David Carlton
@ 2003-03-11  0:57 ` Daniel Jacobowitz
  2003-03-11  1:20   ` David Carlton
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2003-03-11  0:57 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb, Michael Elizabeth Chastain

On Mon, Mar 10, 2003 at 04:53:26PM -0800, David Carlton wrote:
> Is there a problem with gcc -gstabs+ and mangled names in recent
> GCC's?  I'm no stabs expert, but when I compile this file:
> 
> namespace C {
>   namespace D {
>     int cd = 1;
>   }
> }
> 
> with GCC 3.1 with g++ -gstabs+ -S -dA, I get output where the only
> bits that mention the variable in question are:
> 
> .globl _ZN1C1D2cdE
> 	.data
> 	.align 4
> 	.type	_ZN1C1D2cdE,@object
> 	.size	_ZN1C1D2cdE,4
> _ZN1C1D2cdE:
> 	.long	1
> 	.stabs	"cd:G(0,1)",32,0,3,0
> 
> Is GDB supposed to be able to figure out the mangled name for C::D::cd
> from that?  Or does stabs not contain that sort of info?  (Or is this
> a bug that more recent GCC's have fixed?)
> 
> I seem to recall a discussion about this earlier, but I can't remember
> the outcome, and I couldn't find anything relevant in GDB's or GCC's
> bug database.

It's unclear what the right thing to do is.  Stabs is underspecified
(and underimplemented too).  Someone needs to decide what would be
useful.

Sun has namespace markers in their stabs output.  Maybe we should just
make GCC generate them.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* GCC, stabs, mangled names
@ 2003-03-11  0:53 David Carlton
  2003-03-11  0:57 ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: David Carlton @ 2003-03-11  0:53 UTC (permalink / raw)
  To: gdb; +Cc: Michael Elizabeth Chastain, Daniel Jacobowitz

Is there a problem with gcc -gstabs+ and mangled names in recent
GCC's?  I'm no stabs expert, but when I compile this file:

namespace C {
  namespace D {
    int cd = 1;
  }
}

with GCC 3.1 with g++ -gstabs+ -S -dA, I get output where the only
bits that mention the variable in question are:

.globl _ZN1C1D2cdE
	.data
	.align 4
	.type	_ZN1C1D2cdE,@object
	.size	_ZN1C1D2cdE,4
_ZN1C1D2cdE:
	.long	1
	.stabs	"cd:G(0,1)",32,0,3,0

Is GDB supposed to be able to figure out the mangled name for C::D::cd
from that?  Or does stabs not contain that sort of info?  (Or is this
a bug that more recent GCC's have fixed?)

I seem to recall a discussion about this earlier, but I can't remember
the outcome, and I couldn't find anything relevant in GDB's or GCC's
bug database.

Thanks,
David Carlton
carlton@math.stanford.edu

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-03-11 20:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-11 17:24 GCC, stabs, mangled names Michael Elizabeth Chastain
  -- strict thread matches above, loose matches on Subject: below --
2003-03-11  6:07 Michael Elizabeth Chastain
2003-03-11 20:33 ` David Carlton
2003-03-11  5:55 Michael Elizabeth Chastain
2003-03-11 17:06 ` David Carlton
2003-03-11  0:53 David Carlton
2003-03-11  0:57 ` Daniel Jacobowitz
2003-03-11  1:20   ` David Carlton
2003-03-11  1:24     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).