[Top][All Lists]

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

addr2line stumbles upon the gap in the elf line information

From: Yuri
Subject: addr2line stumbles upon the gap in the elf line information
Date: Tue, 19 Aug 2014 01:01:35 -0700
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0

addr2line produces different address descriptions when addresses ran separately, and in a batch. Here is an example.

I supply two addresses to the standard input of this command: addr2line -f -C -e my.elf

Relevant sections of this elf dump:
<pc>        [row,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x00039e10  [ 111, 0] NS uri: "src1"
0x00039e27  [ 112,13] NS PE
0x00039e43  [ 111,46] NS
0x0003a386  [ 102, 5] NS
0x0003a388  [ 109, 5] NS    // here is the first address
0x0003a39e  [ 102, 5] NS
0x0003a3a5  [  99,44] NS
0x0003a3b4  [ 109, 5] NS
<pc>        [row,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x0004e3d0  [  15, 0] NS uri: "src2"
0x0004e3e5  [  16, 5] NS PE
0x0004e479  [  18, 0] NS
0x0004e482  [  16, 5] NS
0x0004e4a0  [ 177, 0] NS
0x0004e4a4  [ 178, 8] NS PE
<...here is a gap in line info ...> // second address is in this gap
0x0004e51e  [ 178, 5] NS
0x0004e5b4  [ 179, 0] NS

When both addresses are supplied in a batch, the output is wrong:

When addresses are supplied one by one, the output is different:


Technically, the second address doesn't have the line information. So both outputs are wrong. But for some reason, 'echo 000000000004e4f4 | addr2line -f -C -e my.elf' extrapolates (?) and comes up with the better answer. Not sure if this is supposed to be this way.

This is certainly a bug that the batch command produces the wrong output.
And I am not sure if standalone command is supposed to extrapolate or not. Probably not.



reply via email to

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