This is the mail archive of the
mailing list for the elfutils project.
Re: Dwarf_FDE (libdw)
- From: Sasha Da Rocha Pinheiro <darochapinhe at wisc dot edu>
- To: Mark Wielaard <mark at klomp dot org>
- Cc: "elfutils-devel at sourceware dot org" <elfutils-devel at sourceware dot org>
- Date: Mon, 17 Jul 2017 04:12:57 +0000
- Subject: Re: Dwarf_FDE (libdw)
- Accept-language: en-US, pt-BR
- Authentication-results: sourceware.org; auth=none
- References: <DM2PR06MB272B27552ECAA2BD3E967BCA6A20@DM2PR06MB272.namprd06.prod.outlook.com> <20170715213020.GA2445@stream>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
[Resending cause it seems it didn't go]
So how do you get the augmentation data out of a Dwarf_Frame? Or how do you "simulate" the two next functions as libdwarf do?
From: Mark Wielaard <email@example.com>
Sent: Saturday, July 15, 2017 4:30 PM
To: Sasha Da Rocha Pinheiro
Subject: Re: Dwarf_FDE (libdw)
On Sat, Jul 15, 2017 at 01:00:04AM +0000, Sasha Da Rocha Pinheiro wrote:
> I did not understand how to get the augmentation_data of a FDE.
> Could anyone explain me?
Dwarf_FDE is really low level. It might be easier to use a Dwarf_CFI to
get a Dwarf_Frame to extract the information.
You get a Dwarf_CFI_Entry from dwarf_next_cfi. This is a union.
Use dwarf_cfi_cie_p (entry) to see if it is an CIE, if so you can access
the augmentation data from the Dwarf_CIE cie. If not it is an FDE and you
can only access to Dwarf_FDE fde values. The Dwarf_Off CIE_pointer can
be used with dwarf_next_cfi () as offset to find the corresponding
> Also, is the start and end of Dwarf_FDE to be used as
> [initial_location, initial_location+address_range)??
No, it is the FDE instructions (encoded). How they are encoded is given
by the CIE augmentation data, so you would have to decode that first.
That is why you really should use Dwarf_CFI and Dwarf_Frame functions.
Those use this low level data structures to decode all the information.