From 8bddc783e0bf4281a47f30002f6e7f4de1e21ea5 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 19 Jan 2019 12:00:51 +0100 Subject: [PATCH] Update gimli --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- src/debuginfo.rs | 25 ++++++++++++------------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4f89330377f..828d4bb631ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -319,7 +319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "gimli" version = "0.16.1" -source = "git+https://github.com/bjorn3/gimli.git?branch=impl_range_write#ff96c190bbb7a41623f009c969cb7ecd7a2716f4" +source = "git+https://github.com/gimli-rs/gimli.git#9930c6166487e9195e6ba31002685686001f906a" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -596,7 +596,7 @@ dependencies = [ "cranelift-simplejit 0.26.0 (git+https://github.com/CraneStation/cranelift.git)", "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "faerie 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gimli 0.16.1 (git+https://github.com/bjorn3/gimli.git?branch=impl_range_write)", + "gimli 0.16.1 (git+https://github.com/gimli-rs/gimli.git)", "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "target-lexicon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -885,7 +885,7 @@ dependencies = [ "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" -"checksum gimli 0.16.1 (git+https://github.com/bjorn3/gimli.git?branch=impl_range_write)" = "" +"checksum gimli 0.16.1 (git+https://github.com/gimli-rs/gimli.git)" = "" "checksum goblin 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "c65cd533b33e3d04c6e393225fa8919ddfcf5862ca8919c7f9a167c312ef41c2" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" diff --git a/Cargo.toml b/Cargo.toml index 30824626feb2..48714bd22c02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,8 +37,8 @@ faerie = "0.7.1" #cranelift-simplejit = { path = "../cranelift/lib/simplejit" } #cranelift-faerie = { path = "../cranelift/lib/faerie" } -[patch."https://github.com/gimli-rs/gimli.git"] -gimli = { git = "https://github.com/bjorn3/gimli.git", branch = "impl_range_write" } +#[patch."https://github.com/gimli-rs/gimli.git"] +#gimli = { path = "../" } [profile.dev.overrides."*"] opt-level = 3 diff --git a/src/debuginfo.rs b/src/debuginfo.rs index 5024c7eec7f7..d4e8510cd614 100644 --- a/src/debuginfo.rs +++ b/src/debuginfo.rs @@ -7,7 +7,7 @@ use std::marker::PhantomData; use gimli::write::{ Address, AttributeValue, CompilationUnit, DebugAbbrev, DebugInfo, DebugLine, DebugRanges, DebugRngLists, DebugStr, EndianVec, LineProgram, LineProgramId, LineProgramTable, Range, - RangeList, RangesTable, Result, SectionId, StringTable, UnitEntryId, UnitId, UnitTable, Writer, + RangeList, RangeListTable, Result, SectionId, StringTable, UnitEntryId, UnitId, UnitTable, Writer, }; use gimli::Format; @@ -43,8 +43,8 @@ pub struct DebugContext<'tcx> { unit_id: UnitId, line_programs: LineProgramTable, global_line_program: LineProgramId, - ranges: RangesTable, - unit_ranges: RangeList, + range_lists: RangeListTable, + unit_range_list: RangeList, symbol_names: Vec, _dummy: PhantomData<&'tcx ()>, @@ -68,7 +68,7 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> { let mut units = UnitTable::default(); let mut strings = StringTable::default(); let mut line_programs = LineProgramTable::default(); - let ranges = RangesTable::default(); + let range_lists = RangeListTable::default(); let global_line_program = line_programs.add(LineProgram::new( version, @@ -122,8 +122,8 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> { unit_id, line_programs, global_line_program, - ranges, - unit_ranges: RangeList(Vec::new()), + range_lists, + unit_range_list: RangeList(Vec::new()), symbol_names: Vec::new(), _dummy: PhantomData, } @@ -149,13 +149,13 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> { } pub fn emit(&mut self, artifact: &mut Artifact) { - let unit_range_id = self.ranges.add(self.unit_ranges.clone()); + let unit_range_list_id = self.range_lists.add(self.unit_range_list.clone()); let unit = self.units.get_mut(self.unit_id); let root = unit.root(); let root = unit.get_mut(root); root.set( gimli::DW_AT_ranges, - AttributeValue::RangeListsRef(unit_range_id), + AttributeValue::RangeListRef(unit_range_list_id), ); let mut debug_abbrev = DebugAbbrev::from(WriterRelocate::new(self)); @@ -167,8 +167,8 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> { let debug_line_offsets = self.line_programs.write(&mut debug_line).unwrap(); let debug_str_offsets = self.strings.write(&mut debug_str).unwrap(); - let (debug_ranges_offsets, debug_rnglists_offsets) = self - .ranges + let range_list_offsets = self + .range_lists .write( &mut debug_ranges, &mut debug_rnglists, @@ -182,8 +182,7 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> { &mut debug_abbrev, &mut debug_info, &debug_line_offsets, - &debug_ranges_offsets, - &debug_rnglists_offsets, + &range_list_offsets, &debug_str_offsets, ) .unwrap(); @@ -394,7 +393,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> { byteorder::LittleEndian::write_u64(&mut size_array, size as u64); entry.set(gimli::DW_AT_high_pc, AttributeValue::Data8(size_array)); - self.debug_context.unit_ranges.0.push(Range { + self.debug_context.unit_range_list.0.push(Range { begin: Address::Relative { symbol: self.symbol, addend: 0,