Skip to content
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

fix(debuginfo): Decompress GNU compressed debug sections correctly #192

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Mar 3, 2020

This fixes decompression of .zdebug* GNU sections.

@jan-auer jan-auer requested review from mitsuhiko and a team March 3, 2020 19:11
@jan-auer jan-auer self-assigned this Mar 3, 2020
let context = Ctx::new(container, endianness);
let (size, compressed) = if section_data.starts_with(b"ZLIB") {
// The GNU compression header is a 4 byte magic "ZLIB", followed by an 8-byte big-endian
// size prefix of the decompressed data. This adds up to 12 bytes of GNU header.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused by the last sentence here because the "up to" made it sound like it can be smaller while the code didn't allow for that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, saw this too late. I can clarify this on master, if you like.

In my mind it read as "the numbers are adding up" to a sum :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either way is fine

@jan-auer jan-auer merged commit 8f9a017 into master Mar 3, 2020
@jan-auer jan-auer deleted the fix/gnu-debug-sections branch March 3, 2020 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants