avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] addr2line with wrong output, why?


From: Klaus Rudolph
Subject: Re: [avr-gcc-list] addr2line with wrong output, why?
Date: Fri, 4 Jul 2003 14:26:49 +0200 (MEST)

> Klaus Rudolph <address@hidden> wrote:
> 
> > Any idea how to get the source file name and line numbers out of a
> > elf file compiled from assembler-sources?
> 
> You can first verify the stabs in the ELF file using avr-objdump -G.
> Watch out the SLINE records.

Sorry, I got:pwm4.o:     file format elf32-avr

Contents of .stab section:

Symnum n_type n_othr n_desc n_value  n_strx String

-1     HdrSym 0      793    00000054 1     
0      SO     0      0      00000000 1      /tmp/ccBNgQrb.s
1      SOL    0      0      00000016 17     l0_komm.s
2      SLINE  0      7      00000016 0      
3      SLINE  0      8      00000018 0      
4      SLINE  0      9      0000001a 0      
5      SLINE  0      10     0000001c 0      
6      SLINE  0      11     0000001e 0      
7      SLINE  0      20     00000020 0      
8      SLINE  0      21     00000022 0      
9      SLINE  0      22     00000024 0      
10     SLINE  0      36     000000e8 0      

and what can I find here :-). I have no idea what this lines would tell me
:-( 

> 
> Did you properly use .function/.endfunc?
No, I never used them.

> 
> Also, i found that avr-gdb gets completely confused if there are
> globally visible symbols inside assembler functions. 

avr-gdb works very well and find all sybols and source lines quick an
precise.
So I think the source and the elf file are correct but addr2line is buggy.
Any idea in which file of the gdb sources I can find the address to source
decoder? If there is a own implementation in I can use this one instead of
the binutils variant.


> It's IMHO best
> to use completely local symbols for assembler jump targets.  Either
> use Unix (AT&T) assembler style local labels (just a small integer
> number only, can be re-used inside the file, reference gets a `f' or
> `b' appended to indicate the jump direction), or start the label with
> ".L".

if I list the file with avr-nm -l i got:

0000066c t Adr_BroadcastChannel pwm4_kernel.s:636
00000440 t Adr_BroadcastControllerId    pwm4_kernel.s:636
00000678 t Adr_Channel  pwm4_kernel.s:636
00000690 t Adr_ClearAll pwm4_kernel.s:636
00000444 t Adr_ControllerId     pwm4_kernel.s:636
<SNIP>
00000426 t wait_on_answer       l4_generic.s:324
00000436 t wait_on_answer_ohne_alles    l4_generic.s:363
000006fe t we_have_found        bitmask.s:397
0000034a t www  l4_generic.s:148
00000366 t www2 l4_generic.s:176
0000036e t www2a        l4_generic.s:184
00000378 t www2b        l4_generic.s:199

The first part before <snip> is wrong (all the same wrong line numbers)
after snip all infos are correct (other source files).

Let me repeat: avr-gdb is able to interpret the debugging information 
addr2line and all other binutils are not able to do this :-(

Bye  
    Klaus 



-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]