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 handling of compressed .debug_str_offsets sections #27

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions thorin/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,17 @@ impl<'file> InProgressDwarfPackage<'file> {
update!(debug_rnglists += self.obj.append_to_debug_rnglists(&data));
}
Ok(".debug_str_offsets.dwo" | ".zdebug_str_offsets.dwo") => {
let debug_str_offsets_section = {
let (debug_str_offsets_section, debug_str_offsets_section_len) = {
let data = section.compressed_data()?.decompress()?;
let len = data.len() as u64;
let data_ref = sess.alloc_owned_cow(data);
gimli::DebugStrOffsets::from(gimli::EndianSlice::new(data_ref, self.endian))
(
gimli::DebugStrOffsets::from(gimli::EndianSlice::new(
data_ref,
self.endian,
)),
len,
)
};

let debug_str_section =
Expand All @@ -509,7 +516,7 @@ impl<'file> InProgressDwarfPackage<'file> {
let data = self.string_table.remap_str_offsets_section(
debug_str_section,
debug_str_offsets_section,
section.size(),
debug_str_offsets_section_len,
self.endian,
encoding,
)?;
Expand Down
Loading