Skip to content

Commit

Permalink
Update gimli revision
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed Feb 7, 2019
1 parent f086cb1 commit a2da7fd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ wabt = "0.7"
[workspace]

[patch.crates-io]
gimli = { git = "https://github.com/gimli-rs/gimli.git", rev = "921c84f53021fda933bc8dbe030b58320f0bb7a5" }
gimli = { git = "https://github.com/gimli-rs/gimli.git", rev = "955c33ed" }
7 changes: 3 additions & 4 deletions lib/debug/src/read_debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait Reader: gimli::Reader<Offset = usize, Endian = LittleEndian> {}

impl<'input> Reader for gimli::EndianSlice<'input, LittleEndian> {}

pub type Dwarf<'input> = gimli::Dwarf<gimli::EndianSlice<'input, LittleEndian>, LittleEndian>;
pub type Dwarf<'input> = gimli::Dwarf<gimli::EndianSlice<'input, LittleEndian>>;

#[derive(Debug)]
pub struct DebugInfoData<'a> {
Expand Down Expand Up @@ -51,7 +51,7 @@ fn convert_sections<'a>(sections: HashMap<&str, &'a [u8]>) -> Dwarf<'a> {
None => DebugRanges::new(&[], endian),
};
let debug_rnglists = DebugRngLists::new(&[], endian);
let ranges = RangeLists::new(debug_ranges, debug_rnglists).expect("ranges");
let ranges = RangeLists::new(debug_ranges, debug_rnglists);

if sections.contains_key(".debug_loclists") {
panic!("Unexpected .debug_loclists");
Expand All @@ -62,7 +62,7 @@ fn convert_sections<'a>(sections: HashMap<&str, &'a [u8]>) -> Dwarf<'a> {
None => DebugLoc::new(&[], endian),
};
let debug_loclists = DebugLocLists::new(&[], endian);
let locations = LocationLists::new(debug_loc, debug_loclists).expect("ranges");
let locations = LocationLists::new(debug_loc, debug_loclists);

if sections.contains_key(".debug_str_offsets") {
panic!("Unexpected .debug_str_offsets");
Expand All @@ -77,7 +77,6 @@ fn convert_sections<'a>(sections: HashMap<&str, &'a [u8]>) -> Dwarf<'a> {
let debug_types = DebugTypes::from(EndianSlice::new(&[], endian));

Dwarf {
endian,
debug_abbrev,
debug_addr,
debug_info,
Expand Down
7 changes: 6 additions & 1 deletion lib/debug/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,12 @@ where
out_strings,
)?;

let program = debug_line.program(offset, unit.address_size(), comp_dir, comp_name);
let program = debug_line.program(
offset,
unit.address_size(),
comp_dir.and_then(|val| val.string_value(&debug_str)),
comp_name.and_then(|val| val.string_value(&debug_str)),
);
if let Ok(program) = program {
let header = program.header();
assert!(header.version() <= 4, "not supported 5");
Expand Down
7 changes: 2 additions & 5 deletions lib/debug/src/write_debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,15 @@ pub fn emit_dwarf(
.line_programs
.write(&mut debug_line, &debug_line_str_offsets, &debug_str_offsets)
.unwrap();
let range_list_offsets = dwarf
.range_lists
.write(&mut debug_ranges, &mut debug_rnglists, dwarf.encoding)
.unwrap();
dwarf
.units
.write(
&mut debug_abbrev,
&mut debug_info,
&mut debug_ranges,
&mut debug_rnglists,
&debug_line_offsets,
&debug_line_str_offsets,
&range_list_offsets,
&debug_str_offsets,
)
.unwrap();
Expand Down

0 comments on commit a2da7fd

Please sign in to comment.