Misc debuginfo.rs changes
This commit is contained in:
parent
410d397bcd
commit
99e43822b4
@ -46,7 +46,6 @@ fn line_program_add_file(line_program: &mut LineProgram, file: &FileName) -> Fil
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DebugReloc {
|
struct DebugReloc {
|
||||||
@ -57,16 +56,20 @@ struct DebugReloc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct DebugContext<'tcx> {
|
pub struct DebugContext<'tcx> {
|
||||||
|
// Encoding info
|
||||||
encoding: Encoding,
|
encoding: Encoding,
|
||||||
endian: RunTimeEndian,
|
endian: RunTimeEndian,
|
||||||
|
|
||||||
symbols: indexmap::IndexSet<String>,
|
symbols: indexmap::IndexSet<String>,
|
||||||
|
|
||||||
strings: StringTable,
|
// Main data
|
||||||
units: UnitTable,
|
units: UnitTable,
|
||||||
line_programs: LineProgramTable,
|
line_programs: LineProgramTable,
|
||||||
|
|
||||||
|
// Side tables
|
||||||
|
strings: StringTable,
|
||||||
range_lists: RangeListTable,
|
range_lists: RangeListTable,
|
||||||
|
|
||||||
|
// Global ids
|
||||||
unit_id: UnitId,
|
unit_id: UnitId,
|
||||||
global_line_program: LineProgramId,
|
global_line_program: LineProgramId,
|
||||||
unit_range_list: RangeList,
|
unit_range_list: RangeList,
|
||||||
@ -93,11 +96,12 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> {
|
|||||||
None => tcx.crate_name(LOCAL_CRATE).to_string(),
|
None => tcx.crate_name(LOCAL_CRATE).to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut units = UnitTable::default();
|
|
||||||
let mut strings = StringTable::default();
|
let mut strings = StringTable::default();
|
||||||
let mut line_programs = LineProgramTable::default();
|
|
||||||
let range_lists = RangeListTable::default();
|
let range_lists = RangeListTable::default();
|
||||||
|
|
||||||
|
let mut units = UnitTable::default();
|
||||||
|
let mut line_programs = LineProgramTable::default();
|
||||||
|
|
||||||
let global_line_program = line_programs.add(LineProgram::new(
|
let global_line_program = line_programs.add(LineProgram::new(
|
||||||
encoding,
|
encoding,
|
||||||
1,
|
1,
|
||||||
@ -140,13 +144,13 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> {
|
|||||||
DebugContext {
|
DebugContext {
|
||||||
encoding,
|
encoding,
|
||||||
endian: target_endian(tcx),
|
endian: target_endian(tcx),
|
||||||
|
|
||||||
symbols: indexmap::IndexSet::new(),
|
symbols: indexmap::IndexSet::new(),
|
||||||
|
|
||||||
strings,
|
strings,
|
||||||
|
range_lists,
|
||||||
|
|
||||||
units,
|
units,
|
||||||
line_programs,
|
line_programs,
|
||||||
range_lists,
|
|
||||||
|
|
||||||
unit_id,
|
unit_id,
|
||||||
global_line_program,
|
global_line_program,
|
||||||
@ -194,8 +198,10 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> {
|
|||||||
let mut debug_ranges = DebugRanges::from(WriterRelocate::new(self));
|
let mut debug_ranges = DebugRanges::from(WriterRelocate::new(self));
|
||||||
let mut debug_rnglists = DebugRngLists::from(WriterRelocate::new(self));
|
let mut debug_rnglists = DebugRngLists::from(WriterRelocate::new(self));
|
||||||
|
|
||||||
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_str_offsets = self.strings.write(&mut debug_str).unwrap();
|
||||||
|
|
||||||
|
let debug_line_offsets = self.line_programs.write(&mut debug_line).unwrap();
|
||||||
|
|
||||||
let range_list_offsets = self
|
let range_list_offsets = self
|
||||||
.range_lists
|
.range_lists
|
||||||
.write(
|
.write(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user