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

Use object's support for zstd compressed DWARF #468

Merged
merged 2 commits into from
Jan 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions samply-symbols/src/dwarf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,11 @@ where
size: file_range.uncompressed_size,
_phantom: PhantomData,
}),
CompressionFormat::Zlib => {
let compressed_bytes = data
.read_bytes_at(file_range.offset, file_range.compressed_size)
.ok()?;

let mut decompressed = Vec::with_capacity(file_range.uncompressed_size as usize);
let mut decompress = flate2::Decompress::new(true);
decompress
.decompress_vec(
compressed_bytes,
&mut decompressed,
flate2::FlushDecompress::Finish,
)
.ok()?;

Some(SingleSectionData::Owned(decompressed))
_ => {
let compressed = file_range.data(data).ok()?;
let decompressed = compressed.decompress().ok()?;
Some(SingleSectionData::Owned(decompressed.into_owned()))
}
_ => None,
}
}

Expand Down
Loading