From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28444 invoked by alias); 17 Jul 2017 13:29:01 -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 26912 invoked by uid 89); 17 Jul 2017 13:29:00 -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=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy= X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY 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: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Jul 2017 13:28:58 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 16F42302758C; Mon, 17 Jul 2017 15:28:57 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 0A7A240E39E1; Mon, 17 Jul 2017 15:28:57 +0200 (CEST) Message-ID: <1500298136.14595.368.camel@klomp.org> Subject: Re: Dwarf_FDE (libdw) From: Mark Wielaard To: Sasha Da Rocha Pinheiro Cc: "elfutils-devel@sourceware.org" Date: Mon, 17 Jul 2017 13:29:00 -0000 In-Reply-To: References: <20170715213020.GA2445@stream> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.12.11 (3.12.11-22.el7) Mime-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00017.txt.bz2 On Mon, 2017-07-17 at 04:12 +0000, Sasha Da Rocha Pinheiro wrote: > So how do you get the augmentation data out of a Dwarf_Frame? You don't. You can only get the actual information relevant for the frame through the augmentation data from the Dwarf_Frame. Is there information missing you need? > Or how do you "simulate" the two next functions as libdwarf do? >=20 > dwarf_get_cie_augmentation_data > dwarf_get_fde_augmentation_data I don't know what those functions do precisely. But if you really want to do something low level like get the CIE augmentation data you could do it through dwarf_next_cfi and DWarf_CFI_entry: Dwarf_CFI_Entry entry; dwarf_next_cfi (e_ident, d, true|false, off, &next, &entry); if (dwarf_cfi_cie_p (&entry)) { cie_aug =3D entry.cie.augmentation_data; cie_aug_size =3D entry.cie.augmentation_data_size; } else { Dwarf_Off off =3D entry.fde.CIE_pointer; dwarf_next_cfi (e_ident, d, true|false, off, &next, &entry); assert (dwarf_cfi_cie_p (&entry)); cie_aug =3D entry.cie.augmentation_data; cie_aug_size =3D entry.cie.augmentation_data_size; } Plus some error handling. If you then also want to get the FDE augmentation data it is a bit more work since you'll have to decode the FDE data yourself (based on the CIE augmentation data you now got). But instead of trying to extract the exact encoding of the low level data it is probably better to see how we can make all the information you need available through Dwarf_Frames. Cheers, Mark