-
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
Add GnuDebuglink #262
Add GnuDebuglink #262
Conversation
Closes gimli-rs#260
/// Returns the CRC32 checksum of the debug information file. | ||
pub fn crc32(&self) -> Result<u32> { | ||
let mut section = self.gnu_debuglink_section.clone(); | ||
let base = section.len() - ReaderOffset::from_u32(4); |
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 works fine for valid data, but doesn't handle invalid data very well. It'd be better to have a single method that reads both the filename and crc32. I guess it doesn't matter too much though because the crc won't match if it's wrong.
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.
Yeah, I wasn't sure what the right API is here - is there another section type that's similar? It seems like the others currently supported are all sequences.
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 didn't see any other sections that are similar. I think just a fn read(&self) -> Result<(R, u32)>
would be fine.
Is there a compatible implementation of the crc32 that we can use in conjunction with this? |
I think https://docs.rs/crc/1.5.0/crc/crc32/fn.checksum_ieee.html is the right crc variant? |
I wonder if this should be in moria, not gimli. It doesn't really seem DWARF-related to me. OTOH I suppose it wouldn't be too bad to just move it to moria when that has some content. |
Yeah it might make sense for this to live in Moria. We'll also need to pull |
I checked and goblin can already extract this: https://github.com/m4b/goblin/blob/master/src/elf/note.rs |
I'm going to submit a PR to make |
My moria PR is up: gimli-rs/locate-dwarf#2 I wound up adding APIs to You'll probably want to implement |
Implemented in the object crate instead (and used by moria). |
Closes #260