From: Milian Wolff <mail@milianw.de>
To: Mark Wielaard <mark@klomp.org>
Cc: elfutils-devel@sourceware.org
Subject: Re: dwfl_attach_state alternative taking Ebl?
Date: Wed, 29 Mar 2017 21:57:00 -0000 [thread overview]
Message-ID: <1662463.uA56NKcFP1@agathebauer> (raw)
In-Reply-To: <1490816888.6461.155.camel@klomp.org>
[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]
On Mittwoch, 29. März 2017 21:48:08 CEST Mark Wielaard wrote:
> Hi Milian,
>
> On Wed, 2017-03-29 at 16:50 +0200, Milian Wolff wrote:
> > would you be willing to accept a patch that adds an alternative to
> > dwfl_attach_state taking an Ebl pointer instead of the Elf* to guess the
> > architecture from?
>
> I rather not expose an Ebl handle to the public interface.
> It is really an internal interface that we can change anytime.
> There is also no way a user can create or get at an Ebl handle using the
> public interfaces.
Ah right, I only looked at the implementation of dwfl_attach_state and related
sources without reading the comment saying that Ebl is internal. No-go then.
> > This would simplify the code for cases where we know the architecture, but
> > don't necessarily have a corresponding Elf* at hand (yet). If there'd be a
> > version that takes the Ebl pointer directly, one could use e.g.
> > ebl_openbackend_emulation or _machine to find the backend handle for the
> > known target architecture directly.
> >
> > If this would be acceptable, I will write a patch up for this. I would
> > need
> > suggestions for a fitting name though, in C++ I'd simply use an overload
> > but here with plain C... ;-)
>
> Would it help your use case if there was a dwfl_init_state (Dwfl *dwfl,
> int e_machine, unsigned char ei_class, unsigned char ei_data, ...)?
What magic values do I pass to e_machine, ei_class, ei_data? I guess the ebl
API that takes the Elf architecture or archicture name would be better.
> And what exactly is your use case? Maybe we can come up with a better
> interface.
The use-case is parsing profiler data, e.g. in perfparser by Ulf / TQC. We
don't mess with Elf* anywhere, but need it to let dwfl_attach_state figure out
the target architecture. We do know the architecture already so this is a lot
of jumping through hoops, to find a fitting Elf* that can be used for dwfl
then...
--
Milian Wolff
mail@milianw.de
http://milianw.de
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2017-03-29 21:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 14:50 Milian Wolff
2017-03-29 19:48 ` Mark Wielaard
2017-03-29 21:57 ` Milian Wolff [this message]
2017-03-30 10:57 ` Mark Wielaard
2017-03-30 11:14 ` Milian Wolff
2017-04-05 12:46 ` Mark Wielaard
2017-04-05 12:53 ` Ulf Hermann
2017-04-05 13:04 ` Milian Wolff
2017-04-11 12:10 ` Mark Wielaard
2017-04-11 12:28 ` Ulf Hermann
2017-04-19 19:50 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1662463.uA56NKcFP1@agathebauer \
--to=mail@milianw.de \
--cc=elfutils-devel@sourceware.org \
--cc=mark@klomp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).