dwfl_attach_state alternative taking Ebl?

Ulf Hermann ulf.hermann@qt.io
Tue Apr 11 12:28:00 GMT 2017


> /* [...] 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.  [...]  */
>
> So would that be an alternative for you? How do you create the Dwfl? Do
> you add modules to it (how?) and when do you need to call
> dwfl_attach_state?

This is what we do. We parse perf.data. perf.data may contain 
information about file mappings at any point, and it may take a while 
until the first valid one shows up. So we postpone dwfl_attach_state 
until we have a mapping we can resolve to a local elf file.

The code would be cleaner if we could attach_state before starting to 
parse. And there might be pathological cases where no valid elf file can 
ever be found but we can still unwind by frame pointer.

br,
Ulf



More information about the Elfutils-devel mailing list