-
Notifications
You must be signed in to change notification settings - Fork 9
DWARF5 Support #87
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
DWARF5 Support #87
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic PR - nice job ferreting all this out.
Some comments for your consideration, but nothing blocking.
// | ||
// A note on SPECREF: | ||
// | ||
// SPECREF (specification references) are bookmarks to the specification where more context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very cool. Might be worth a link to the specref ref. (Although that is super meta.) But this one: https://github.com/tobie/specref?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pulled that term out of thin air. It's an actual thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I poked around it for a bit; looks limited to Web specs, and contains no information for DWARF :(
That said, I could certainly put a link to the "official" PDFs here in this file.
// addrx has changed to be a single ULEB; | ||
// therefore we need to return the length | ||
// of the ULEB instead of its value. | ||
return temp_seek(s, [&]{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you actually capturing anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - the ULEB is variable-length binary data. In this case we're reading it just to see how big it is on disk, and returning that length.
// Do nothing. We started this project with DWARF4 | ||
// so the baseline implementation should match that. | ||
} else if (_version == 5) { | ||
// SPECREF: DWARF5 page 218 (200) line 15 -- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loving the SPECREF
// the offset, then to get the string. The 0th string immediately follows the last | ||
// entry offset. | ||
|
||
const std::size_t entry_offset = temp_seek(_s, _debug_str_offsets._offset, [&] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to capture anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure what you mean with the question? I'm using the lambda to convert the string entry that comes in to an offset with a specific DWARF5 data section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh capturing within the lambda? The [&]
gives the compiler the freedom to capture whatever it needs by reference. Since this lambda's lifetime is limited to the temp_seek
call, everything its referencing is alive when used within the lambda.
This is the initial set of changes required to get
orc
compatible with DWARF5-formatted data. I only did what was necessary to getorc_test
passing its current battery of tests (which were pretty useful!) Likely more changes will be required as DWARF5 issues are found in the wild.