-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EhHdrTable::lookup
requires a base address to .eh_frame_hdr
in BaseAdresses::data
instead of a base address to .data
as the docs suggest
#350
Comments
EhHdrTable::lookup
requires a base address to .eh_frame_hdr
in BaseAdresses::data
instead of a base address to .data
as the docs suggestEhHdrTable::lookup
requires a base address to .eh_frame_hdr
in BaseAdresses::data
instead of a base address to .data
as the docs suggest
#316 (comment) is related I think, and I should have opened a bug for it at the time. So yeah, this is too easy to get wrong and we should fix it somehow. |
Perhaps we could have (at least in case of e.g. |
I think we only need to add The fact that you had to call |
Ok so ignore my previous comment, I hadn't looked into how this worked enough. From what I can tell, these pointer encodings are only used with
So based on my understanding now, this sounds to me like the right thing to do in order to handle I think this is a separate issue from what I was talking about in #316 (comment) though, and the above isn't enough to fix |
And they do for the |
I've been adding support for
.eh_frame_hdr
to our profiler; after a lot of debugging and tweaking I've managed to get it to work, but it was very confusing.First and foremost, currently
EhHdrTable::lookup
's prototype looks like this:I see this and think - great! Let's initialize the
bases
like I usually do -set_text
with the base address to.text
,set_data
with the base address to.data
andset_cfi
with the base address to.eh_frame
. However, this didn't work -EhHdrTable::lookup
(and consequently alsoEhHdrTable::lookup_and_parse
since it useslookup
) returned incorrect results! So after a lot of trial-and-error I got it to actually work correctly withBaseAddresses
initialized like this:The docs for
gimli::BaseAddresses::data
say that:...and yet here I am setting it to the base address of the
.eh_frame_hdr
instead of.data
. Is this correct? Or is this a bug ingimli
?Another minor issue is that the docs for
gimli::BaseAddresses::cfi
say that:However
EhFrameHdr::parse
requires thecfi
to be the address to.eh_frame_hdr
, which is not obvious from the docs.The text was updated successfully, but these errors were encountered: