This is the mail archive of the
mailing list for the elfutils project.
Re: dwfl_attach_state alternative taking Ebl?
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: <elfutils-devel at sourceware dot org>
- Date: Tue, 11 Apr 2017 14:27:56 +0200
- Subject: Re: dwfl_attach_state alternative taking Ebl?
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=qt.io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=po+FMe7GgHkCnfrwCWI3YNFGEaNvPimMdISl1CtKfAs=; b=hSZxOQxlSIuDLVS7FtNkTq8/EOL5AmSxFEaiUWJLeaMJFQRx8+vH47rfbAiOb0Q7fNoLwlL2rTyKo7MekjG5kgOZxPLbjN5pYZLNSFJ6KtQlSyQBDUXhvDF8z4gEKs/XylrHhMYxENT4v1XK3bWQM7DttZeu2GKORtPWZ1EqVVc=
- References: <2572422.AxEj1gHkJW@milian-kdab2> <1563796.tLH0IFhUAp@milian-kdab2> <email@example.com> <106538701.WLe4dG4fql@milian-kdab2> <firstname.lastname@example.org>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
/* [...] 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
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.