From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123509 invoked by alias); 5 Apr 2017 13:04:52 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 123075 invoked by uid 89); 5 Apr 2017 13:04:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=our X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: dd17628.kasserver.com From: Milian Wolff To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: Re: dwfl_attach_state alternative taking Ebl? Date: Wed, 05 Apr 2017 13:04:00 -0000 Message-ID: <106538701.WLe4dG4fql@milian-kdab2> In-Reply-To: <1491396394.8380.78.camel@klomp.org> References: <2572422.AxEj1gHkJW@milian-kdab2> <1563796.tLH0IFhUAp@milian-kdab2> <1491396394.8380.78.camel@klomp.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2017-q2/txt/msg00024.txt.bz2 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.: > > > > http://code.qt.io/cgit/qt-creator/perfparser.git/tree/app/ > > 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. Cheers -- Milian Wolff mail@milianw.de http://milianw.de