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: Mon, 17 Jul 2017 13:29:00 -0000 [thread overview]
Message-ID: <1500298136.14595.368.camel@klomp.org> (raw)
In-Reply-To: <CY1PR0601MB1691725CDCDB7CCA223EC055A6A00@CY1PR0601MB1691.namprd06.prod.outlook.com>
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?
>
> 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 = entry.cie.augmentation_data;
cie_aug_size = entry.cie.augmentation_data_size;
}
else
{
Dwarf_Off off = entry.fde.CIE_pointer;
dwarf_next_cfi (e_ident, d, true|false, off, &next, &entry);
assert (dwarf_cfi_cie_p (&entry));
cie_aug = entry.cie.augmentation_data;
cie_aug_size = 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
next prev parent reply other threads:[~2017-07-17 13:29 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
2017-07-17 4:13 ` Sasha Da Rocha Pinheiro
2017-07-17 13:29 ` Mark Wielaard [this message]
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=1500298136.14595.368.camel@klomp.org \
--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).