public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* stabs difference gcc 2.95.3 -> 3.4.3
@ 2006-03-30 14:00 Fabian Cenedese
  2006-03-30 15:20 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Fabian Cenedese @ 2006-03-30 14:00 UTC (permalink / raw)
  To: gdb

Hi

The following is about a cross-compiled tool chain, both gcc and gdb are
running on cygwin but the target is a PPC embedded board. I don't know
if the problem lies with gcc or gdb.

We have an older tool chain with gcc 2.95.3. We compile our cpp files
in two steps, basically
1. gcc -S file.cpp -o file.s
2. gcc file.s -o file.o

We do this as we need both the assembler file and binary. These binaries
get then linked together with ld and a linker script. This works fine.

This is the working file of gcc 2.95.3, looking up _TASK_CLASS_NAME_::Action:
GNU gdb 6.2.50_2004-10-14-cvs
Copyright 2004 Free Software Foundation, Inc.
This GDB was configured as "--host=i686-pc-cygwin --target=powerpc-eabi"...
(gdb) info address _TASK_CLASS_NAME_::Action
Symbol "Action__17_TASK_CLASS_NAME_" is a function at address 0x153c.
(gdb) info line '_TASK_CLASS_NAME_::Action(void)'
Line 128 of "N:\Indel-PPC\Tests\gcc3\applicat\src\CTaskTemplateClass.cpp"
   starts at address 0x153c <Action__17_TASK_CLASS_NAME_> and ends at 0x155c <Action__17_TASK_CLASS_NAME_+32>.

We now wanted to upgrade and tried the same with gcc 3.4.3. To stay
as much compatible to our other tools as possible we use -gstabs+ even
if this is not the default format. However this gives some different results.

Now doing the same with the result of gcc 3.4.3:
GNU gdb 6.2.50_2004-10-14-cvs
Copyright 2004 Free Software Foundation, Inc.
This GDB was configured as "--host=i686-pc-cygwin --target=powerpc-eabi"...
(gdb) info address _TASK_CLASS_NAME_::Action
Symbol "_TASK_CLASS_NAME_::Action" is at 0x1650 in a file compiled without debugging.
(gdb) info line '_TASK_CLASS_NAME_::Action()'
Line 128 of "N:\Indel-PPC\Tests\gcc3\bin343\CTaskTemplateClass.s"
   starts at address 0x1650 <_ZN17_TASK_CLASS_NAME_6ActionEv> and ends at 0x1668 <_ZN17_TASK_CLASS_NAME_6ActionEv+24>.

First thing: why does gdb say that the function is in a file compiled without
debugging when it still knows where to find it?
Second thing: why is the assembler file given as source file? Of course it
_is_ the source file given our two steps compiling. But the same was true
with the old tool chain where it worked fine. Also, in the generated assembler
file is the first line a directive:
 	.file	"CTaskTemplateClass.cpp"
so it should be clear where this code comes from.

Now: Is this a gdb or a gcc problem? Is there some switch or something
that may help me further or is the stabs support in gcc regressing as
mentioned in this post by Michael Chastain:

http://gcc.gnu.org/ml/gcc/2004-07/msg00479.html

Is there sense in posting this to the gcc list?

Just for checking if this would work better I also tried -gdwarf-2. Got even worse:
GNU gdb 6.2.50_2004-10-14-cvs
This GDB was configured as "--host=i686-pc-cygwin --target=powerpc-eabi"...Dwarf Error: Could not find abbrev number 128
 [in module /cygdrive/n/IMD/Bin/Gnu32_new/gcc3.x]

As we would like to stay on stabs I didn't pursue this further but it wasn't
very promising.

Thanks for reading this lengthy mail.

bye  Fabi


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

end of thread, other threads:[~2006-04-03  8:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-30 14:00 stabs difference gcc 2.95.3 -> 3.4.3 Fabian Cenedese
2006-03-30 15:20 ` Daniel Jacobowitz
2006-03-30 18:22   ` Fabian Cenedese
2006-03-30 21:52     ` Daniel Jacobowitz
2006-03-31 14:01       ` Fabian Cenedese
2006-03-31 14:20         ` Daniel Jacobowitz
2006-04-03  8:40           ` Fabian Cenedese

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).