public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Sasha Da Rocha Pinheiro <darochapinhe@wisc.edu>
Cc: "elfutils-devel@sourceware.org" <elfutils-devel@sourceware.org>
Subject: Re: Dwarf_FDE (libdw)
Date: Sat, 15 Jul 2017 21:30:00 -0000	[thread overview]
Message-ID: <20170715213020.GA2445@stream> (raw)
In-Reply-To: <DM2PR06MB272B27552ECAA2BD3E967BCA6A20@DM2PR06MB272.namprd06.prod.outlook.com>

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.

Cheers,

Mark

  reply	other threads:[~2017-07-15 21:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-15  1:01 Sasha Da Rocha Pinheiro
2017-07-15 21:30 ` Mark Wielaard [this message]
2017-07-17  4:13   ` Sasha Da Rocha Pinheiro
2017-07-17 13:29     ` Mark Wielaard
2017-07-17 17:16       ` Sasha Da Rocha Pinheiro
2017-07-17 17:48         ` Mark Wielaard
2017-07-17 17:53           ` Sasha Da Rocha Pinheiro
     [not found]           ` <BN6PR06MB30906C0218E8B06135F18B87A6A10@BN6PR06MB3090.namprd06.prod.outlook.com>
2017-07-21 19:39             ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170715213020.GA2445@stream \
    --to=mark@klomp.org \
    --cc=darochapinhe@wisc.edu \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).