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: NO_UNWIND error with libdw on Powerpc


On Tue, 2014-03-11 at 14:20 -0700, Sukadev Bhattiprolu wrote:
> When trying to add libdw support for Powerpc in the Linux perf tool,
> I am getting the DWARF error NO_UNWIND.

Which PowerPC is this (ppc32/ppc64/ELFv1/ELFv2)? elfutils supports
ppc32/ppc64 for ELFv1 abi, but has not yet been tested for ppc64/ELFv2
abi usage).

> Following is the rough sequence of calls to libdw are from the perf
> tool:
> 
> 	dwfl = dwfl_begin()
> 
> 	dwfl_addrmodule(dwfl, instruction_pointer);
> 
> 	dwfl_attach_state(dwfl, EM_NONE, thread_id, &callbacks, arg);
> 
> 	dwfl_getthread_frames(dwfl, thread_id, frame_callback, arg);
> 
> The call to dwfl_getthread_frames() results in the NO_UNWIND error
> (Unwinding not supported for this architecture), although the calls
> before it seem to succeed.

The dwfl_attach_state looks suspecious, the second argument should be an
Elf file. From the documentation:

        Architecture of DWFL modules is specified by ELF, ELF must
        remain valid during DWFL lifetime.  Use NULL ELF to detect
        architecture from DWFL, the function will then detect it from
        arbitrary Dwfl_Module of DWFL.

It is best to provide the actual Elf you are interested in, because
using NULL makes libdwfl guess at the architecture, which means it will
have to traverse the Dwfl_Modules already registered for the DWfl. So
you have to make sure a Dwfl_Module with the right architecture is
registered (also this might trigger the find_elf callback of the Dwfl to
be called, which depending on the callback might not yet be capable of
providing the Elf requested).

> Appreciate any input on how to resolve the NO_UNWIND error on
> Powerpc.

Does something like "eu-stack -p $$" work on your setup? If it does then
it might be helpful to see a bit more of the actual source code. Does it
work for other architectures?.

Cheers,

Mark


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