This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using dwfl to enumerate frames of current thread


Mark Wielaard <mjw@redhat.com> writes:

> On Thu, 2015-08-20 at 16:13 +0200, Ben Gamari wrote:
>> Mark Wielaard <mjw@redhat.com> writes:
>> > Could you post the binary somewhere?
>> > Then I will take a look at what is going wrong.
>> >
>> It can be found here (sorry for the size),
>> 
>>     http://home.smart-cactus.org/~ben/ghc-stage2
>
> Thanks.
>
>> With binutils I find,
>> 
>>     $ addr2line -e inplace/lib/bin/ghc-stage2 -f 0x12011b8
>>     ghc_Util_maybeReadFuzzzzy_info
>>     /opt/exp/ghc/ghc//compiler/utils/Util.hs:955
>> 
>> If I'm interpretting gdb correctly, elfutils seems to think there is
>> only one CU, which sounds like it could be the issue. By my count there
>> should be over 700,
>> 
>>     $ readelf -e  inplace/lib/bin/ghc-stage2 -w | grep -i  "File Name Table (" | wc -l
>>     742
>
> Still debugging, but the debug_info and line_info seem to be parsed
> correctly. The output is just slightly different between eu-readelf and
> binutils readelf:
>
> $ eu-readelf --debug-dump=info -N ./ghc-stage2 | grep "Compilation unit
> at offset" | wc --lines
> 742
>
> $ eu-readelf --debug-dump=decodedline -N ./ghc-stage2 | grep ^\ CU\  |
> wc --lines
> 742
>
Fair enough. However, I was basing my original statement not on the
output of elfutils' readelf but instead on libdwfl data structures
dumped in gdb.

As you may have realized by now, the problem begins in
dwfl_module_getsrc, which returns DWFL_E_ADDR_OUTOFRANGE.
If you look at the Dwfl_Module that gets passed to dwfl_module_getsrc,
you'll find that mod->ncu == 1 (which is confirmed by traversing the
mod->cu list). This struct me as rather odd.

Cheers,

- Ben

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]