From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49270 invoked by alias); 17 Jul 2017 17:16:12 -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 49189 invoked by uid 89); 17 Jul 2017 17:16:10 -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.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:15.01.1261.021, H*r:15.01.1261.021, Hx-spam-relays-external:15.01.1261.021, Hx-languages-length:2014 X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: smtpauth4.wiscmail.wisc.edu Received: from wmauth4.doit.wisc.edu (HELO smtpauth4.wiscmail.wisc.edu) (144.92.197.145) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Jul 2017 17:16:08 +0000 MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Received: from avs-daemon.smtpauth4.wiscmail.wisc.edu by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) id <0OT800F00VTO0W00@smtpauth4.wiscmail.wisc.edu> for elfutils-devel@sourceware.org; Mon, 17 Jul 2017 12:16:06 -0500 (CDT) X-Spam-Report: AuthenticatedSender=yes, SenderIP=207.46.163.87 X-Spam-PmxInfo: Server=avs-4, Version=6.3.3.2656215, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.7.17.170316, AntiVirus-Engine: 5.38.0, AntiVirus-Data: 2017.6.22.5380000, SenderIP=207.46.163.87 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02lp0087.outbound.protection.outlook.com [207.46.163.87]) by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) with ESMTPS id <0OT8009BQVYQV320@smtpauth4.wiscmail.wisc.edu>; Mon, 17 Jul 2017 12:16:02 -0500 (CDT) Received: from BN6PR06MB3090.namprd06.prod.outlook.com (10.174.95.164) by BN6PR06MB3091.namprd06.prod.outlook.com (10.174.95.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Mon, 17 Jul 2017 17:16:01 +0000 Received: from BN6PR06MB3090.namprd06.prod.outlook.com ([10.174.95.164]) by BN6PR06MB3090.namprd06.prod.outlook.com ([10.174.95.164]) with mapi id 15.01.1261.021; Mon, 17 Jul 2017 17:16:01 +0000 From: Sasha Da Rocha Pinheiro To: Mark Wielaard Cc: "elfutils-devel@sourceware.org" Subject: Re: Dwarf_FDE (libdw) Thread-topic: Dwarf_FDE (libdw) Thread-index: AQHS/QVpzQDxCHY/kUq1gBXo+u7+5aJVaRMAgAICk3CAAJuWAIAAPLxi Date: Mon, 17 Jul 2017 17:16:00 -0000 Message-id: References: <20170715213020.GA2445@stream> <1500298136.14595.368.camel@klomp.org> In-reply-to: <1500298136.14595.368.camel@klomp.org> Accept-Language: en-US, pt-BR Content-language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: X-Originating-IP: [128.105.14.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR06MB3091;7:ZHwkIFOOrHxoRNvbZsbBndPx4R5/3u4n4Qh6ib+vu0c5A0+bygYDZ2KC3ew45YVy+IDymltkaDdNucTK9fUA75P0bdAHY52qOnmJ8mFxLEi1/1Dl52Nd3tWsqHlyQWQm+hIt8CwufflHxQqlQpBlTeeofnCEgnf9dMifXncb/KSDXaOhw7W2MbvQg2UUurpjg9dDj3hLVfkWTUAndt+pVAZhL44gG3XdB5YFafS0w31lIHDKbJtyc0yF10kn/2WeKJsLiZV3oSBWUXtVEQO5l9VnqF3H4csRQKlvSa0J+y9i6OAWwLf4EBV2VKKPv8GJqeyMo46nEtsxdhYSl3euLZziOhXFHsWJ9v/O83Ec59mOLD+i3VVFcR8+0mUGvc9IPIF12lbKq5usbFKBWDtEw7Cr9e2pak2mEjfBL5ICzMYXgTysnwI7vIbAH9syYHy40b4XiELET1Swd8UJ3dQhw3KOqcrYlNyKFm+w4fKWDYReEsFUf74PhqGAsXwB94mbUNmGWlGrfhkuLTTiWv8IHqX2cR+bqWUBz+WfH/dmAQRuQPpKMTJmmK9O/Z2GaGVFArfrgqOTYoFRTkDEF4A0mivLY0tSFZUOgrGza5c0tnzl4SXpGYFbQ9eY4nIIK8pTJ+oTerKGWPUeIXI4G8dx1QN12DBXLtFS4ZoYtOeoRgyPuGd/2GZ6nK7+rg96IaCyXmnw4YMX8J5K45p9OAKTKtARDSgNeXqpjn8E6Tg3uG79w1QRzPePZVLazTfpy6wdaotCdrdW4YKLAnfh85Mbe8LB7sZZ5rBkk6d4QnMSms4= x-ms-office365-filtering-correlation-id: 81818e45-eb73-4354-0ea2-08d4cd377f84 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN6PR06MB3091; x-ms-traffictypediagnostic: BN6PR06MB3091: x-exchange-antispam-report-test: UriScan:(236129657087228); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR06MB3091;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR06MB3091; x-forefront-prvs: 0371762FE7 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39840400002)(39400400002)(39850400002)(39410400002)(39450400003)(39860400002)(377454003)(24454002)(377424004)(88552002)(2906002)(8936002)(3660700001)(4326008)(76176999)(7736002)(81166006)(50986999)(8676002)(33656002)(54356999)(6916009)(77096006)(93886004)(305945005)(229853002)(3280700002)(189998001)(74316002)(2950100002)(86362001)(5660300001)(25786009)(6246003)(110136004)(6116002)(6436002)(6306002)(99286003)(9686003)(53936002)(6506006)(55016002)(3846002)(102836003)(75432002)(14454004)(38730400002)(966005)(66066001)(7696004)(53546010)(2900100001)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR06MB3091;H:BN6PR06MB3090.namprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-transfer-encoding: quoted-printable X-OriginatorOrg: wisc.edu X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2017 17:16:00.9838 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 2ca68321-0eda-4908-88b2-424a8cb4b0f9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR06MB3091 X-SW-Source: 2017-q3/txt/msg00021.txt.bz2 So you're saying that the augmentation data of a FDE is the augmentation da= ta of its CIE? https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.= html says differently. The thing is I need to get catch blocks, and eh_frame is not exactly Dwarf = format. That's why I need FDE augmentation data also. Libdw doesn't do this, am I correct? =20=20=20 =20=20 From: Mark Wielaard Sent: Monday, July 17, 2017 8:28:56 AM To: Sasha Da Rocha Pinheiro Cc: elfutils-devel@sourceware.org Subject: Re: Dwarf_FDE (libdw) =A0=20=20=20 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)) =A0 { =A0=A0=A0=A0 cie_aug =3D entry.cie.augmentation_data; =A0=A0=A0=A0 cie_aug_size =3D entry.cie.augmentation_data_size; =A0 } else =A0 { =A0=A0=A0 Dwarf_Off off =3D entry.fde.CIE_pointer; =A0=A0=A0 dwarf_next_cfi (e_ident, d, true|false, off, &next, &entry); =A0=A0=A0 assert (dwarf_cfi_cie_p (&entry)); =A0=A0=A0 cie_aug =3D entry.cie.augmentation_data; =A0=A0=A0 cie_aug_size =3D entry.cie.augmentation_data_size; =A0 } 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 =20=20=20=20