This is the mail archive of the 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: dwfl_attach_state alternative taking Ebl?

On Wednesday, April 5, 2017 2:46:34 PM CEST Mark Wielaard wrote:
> On Thu, 2017-03-30 at 13:14 +0200, Milian Wolff wrote:
> > > OK. How do you know the Elf architecture in that case? How and by what
> > > is it given? Is that an EM constant or some architecture string?
> > 
> > In our case we either get it from perf, or the user specifies it directly
> > on the command line. In both cases it is a string like "x86_64", "arm" or
> > "aarch64". We map that to a list of architectures we know about, see
> > e.g.:
> > 
> >
> > perfregisterinfo.h#n29
> > 
> > So, any API that would allow us to map these architectures directly to a
> > dwfl/ elf counterpart would simplify our code, or at least would make it
> > easier to understand, as we wouldn't have to wait for an Elf file we can
> > open before calling dwfl_attach_state.
> So you map from simple architecture name like "x86" or "powerpc". But
> what mechanism do you have to whether that is 32 or 64 bit, and big or
> little endian?

As Ulf said, we can add the required mappings. So from my side, I guess your 
approach with the three machine/class/data constants would be a good 
improvement already.


Milian Wolff

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