* Wrong source location in symbols
@ 2006-12-11 10:16 Fabian Cenedese
2006-12-11 13:41 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Fabian Cenedese @ 2006-12-11 10:16 UTC (permalink / raw)
To: gdb
Hi
I seem to have a problem with the code loaction of symbols.
gdb 6.5, gcc 4.1.0, compiled for ppc-eabi, running on WinXP
Here's a snippet from the generated map file:
.text 0x0000f6f4 0x41c N:/Indel-PPC/Tests/gccext3/bin41/CTaskTemplateClass.603
0x0000fa28 _TASK_CLASS_NAME_::_TASK_CLASS_NAME_(char*)
...(snip)...
.text 0x00097bfc 0x14 N:/IMD/Lib41/libnosys.a(write.o)
0x00097bfc write
.ctors 0x00097c10 0x98
...(snip)...
.dtors 0x00097ca8 0x10
...(snip)...
.got
0x00097cb8 PROVIDE (__STARTUP_BEGIN, .)
.startup 0x00097cb8 0x12320
*(.startup)
.startup 0x00097cb8 0x6c N:/Indel-PPC/Tests/gccext3/bin41/CTaskTemplateClass.603
0x00097cb8 _INI_1000__TASK_CLASS_NAME_()
But when I dump the symbol tables I get this:
[1001] T 0xeb20 _ZN17_TASK_CLASS_NAME_6ActionEv section .text _TASK_CLASS_NAME_::Action() write.c
[1002] T 0xebdc _ZN17_TASK_CLASS_NAME_D0Ev section .text _TASK_CLASS_NAME_::~_TASK_CLASS_NAME_() write.c
...(snip)...
[3549] B 0x98d44 Reg_INI_0101_INOS_TGT section .bss write.c
[3550] B 0x98d50 Reg_INI_0145_INOS_TGT section .bss write.c
[3551] B 0x98d5c Reg_INI_0205_INOS_TGT section .bss write.c
[3552] B 0x98d68 Reg_INI_0160_INOS_TGT section .bss write.c
...(snip)...
[3567] T 0x99bec _Z27_INI_1000__TASK_CLASS_NAME_v section .startup _INI_1000__TASK_CLASS_NAME_() write.c
[3575] T 0x9a530 _Z18_INI_0002_INCO_NETv section .startup _INI_0002_INCO_NET() write.c
[3576] T 0x9a5fc _Z18_INI_0150_INCO_NETv section .startup _INI_0150_INCO_NET() write.c
[3577] T 0x9a744 _Z27_INI_0002_CSAMDeviceSioLoadv section .startup _INI_0002_CSAMDeviceSioLoad() write.c
No matter where they are defined, the symbols get as location the (wrong)
file write.c, so the last valid file from the .text section. I tried with both
-gstabs or -gdwarf-2, but that didn't change anything. I also tried with
forward and back slashes in the paths of the compiled files, no luck.
Where's the code in gdb that would set these locations?
Thanks
bye Fabi
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Wrong source location in symbols
2006-12-11 10:16 Wrong source location in symbols Fabian Cenedese
@ 2006-12-11 13:41 ` Daniel Jacobowitz
2006-12-11 16:49 ` Fabian Cenedese
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-12-11 13:41 UTC (permalink / raw)
To: Fabian Cenedese; +Cc: gdb
On Mon, Dec 11, 2006 at 11:14:52AM +0100, Fabian Cenedese wrote:
> No matter where they are defined, the symbols get as location the (wrong)
> file write.c, so the last valid file from the .text section. I tried with both
> -gstabs or -gdwarf-2, but that didn't change anything. I also tried with
> forward and back slashes in the paths of the compiled files, no luck.
>
> Where's the code in gdb that would set these locations?
In symtab.c. If you can build a relatively small testcase, we can
investigate.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Wrong source location in symbols
2006-12-11 13:41 ` Daniel Jacobowitz
@ 2006-12-11 16:49 ` Fabian Cenedese
2006-12-11 16:50 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Fabian Cenedese @ 2006-12-11 16:49 UTC (permalink / raw)
To: gdb
At 08:41 11.12.2006 -0500, Daniel Jacobowitz wrote:
>On Mon, Dec 11, 2006 at 11:14:52AM +0100, Fabian Cenedese wrote:
>> No matter where they are defined, the symbols get as location the (wrong)
>> file write.c, so the last valid file from the .text section. I tried with both
>> -gstabs or -gdwarf-2, but that didn't change anything. I also tried with
>> forward and back slashes in the paths of the compiled files, no luck.
>>
>> Where's the code in gdb that would set these locations?
>
>In symtab.c. If you can build a relatively small testcase, we can
>investigate.
It's not that easy to write a little sample. It may well be the used libs
or the whole tool-chain. That's why I try to find it myself.
I couldn't quite make out in symtab.c a place where the filenames
get set. But I saw in elfread.c, elf_symtab_read that quite some
minsyms got the filename write.c set though they are not in this
source file. I'll see what else I can find.
bye Fabi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Wrong source location in symbols
2006-12-11 16:49 ` Fabian Cenedese
@ 2006-12-11 16:50 ` Daniel Jacobowitz
2006-12-12 16:39 ` Fabian Cenedese
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-12-11 16:50 UTC (permalink / raw)
To: Fabian Cenedese; +Cc: gdb
On Mon, Dec 11, 2006 at 05:48:24PM +0100, Fabian Cenedese wrote:
> I couldn't quite make out in symtab.c a place where the filenames
> get set. But I saw in elfread.c, elf_symtab_read that quite some
> minsyms got the filename write.c set though they are not in this
> source file. I'll see what else I can find.
It's not set per se; it's looked up when needed. Start with the code
that prints out the dump and work from there.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Wrong source location in symbols
2006-12-11 16:50 ` Daniel Jacobowitz
@ 2006-12-12 16:39 ` Fabian Cenedese
0 siblings, 0 replies; 5+ messages in thread
From: Fabian Cenedese @ 2006-12-12 16:39 UTC (permalink / raw)
To: gdb
At 11:50 11.12.2006 -0500, Daniel Jacobowitz wrote:
>On Mon, Dec 11, 2006 at 05:48:24PM +0100, Fabian Cenedese wrote:
>> I couldn't quite make out in symtab.c a place where the filenames
>> get set. But I saw in elfread.c, elf_symtab_read that quite some
>> minsyms got the filename write.c set though they are not in this
>> source file. I'll see what else I can find.
>
>It's not set per se; it's looked up when needed. Start with the code
>that prints out the dump and work from there.
It's exactly the minsymbol filename which is set in above mentioned
function and always enclosed with SOFUN_ADDRESS_MAYBE_MISSING.
I found that many symbols get as filename the most recently used
filename (not only write.c) even if it's wrong. It seems like there
are some file symbols missing/not read or in wrong order or whatever.
Apart from one comparison this filename is only used for displaying,
so I guess I shouldn't rely on its content too much. But still...
I leave that for the moment and write in another post about other problems.
Thanks
bye Fabi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-12-12 16:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-11 10:16 Wrong source location in symbols Fabian Cenedese
2006-12-11 13:41 ` Daniel Jacobowitz
2006-12-11 16:49 ` Fabian Cenedese
2006-12-11 16:50 ` Daniel Jacobowitz
2006-12-12 16:39 ` Fabian Cenedese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox