Small change

This commit is contained in:
bjorn3 2019-11-12 21:10:51 +01:00
parent beda7870fb
commit c5c6ce87d2
2 changed files with 17 additions and 13 deletions

View File

@ -2,6 +2,8 @@
use syntax::source_map::FileName;
use cranelift::codegen::binemit::CodeOffset;
use gimli::write::{
Address, AttributeValue, FileId, LineProgram, LineString,
LineStringTable, Range, UnitEntryId,
@ -75,7 +77,7 @@ pub(crate) fn create_debug_lines(
context: &Context,
isa: &dyn cranelift::codegen::isa::TargetIsa,
source_info_set: &indexmap::IndexSet<(Span, mir::SourceScope)>,
) {
) -> CodeOffset {
let tcx = self.debug_context.tcx;
let line_program = &mut self.debug_context.dwarf.unit.line_program;
@ -135,15 +137,6 @@ pub(crate) fn create_debug_lines(
self.debug_context.emit_location(self.entry_id, self.mir.span);
self.debug_context
.unit_range_list
.0
.push(Range::StartLength {
begin: Address::Symbol {
symbol: self.symbol,
addend: 0,
},
length: end as u64,
});
end
}
}

View File

@ -8,7 +8,7 @@
use gimli::write::{
self, Address, AttributeValue, DwarfUnit, Expression, LineProgram, LineString,
Location, LocationList, RangeList, UnitEntryId, Writer,
Location, LocationList, Range, RangeList, UnitEntryId, Writer,
};
use gimli::{Encoding, Format, LineEncoding, Register, RunTimeEndian, X86_64};
@ -237,7 +237,18 @@ pub fn define(
isa: &dyn cranelift::codegen::isa::TargetIsa,
source_info_set: &indexmap::IndexSet<(Span, mir::SourceScope)>,
) {
self.create_debug_lines(context, isa, source_info_set);
let end = self.create_debug_lines(context, isa, source_info_set);
self.debug_context
.unit_range_list
.0
.push(Range::StartLength {
begin: Address::Symbol {
symbol: self.symbol,
addend: 0,
},
length: end as u64,
});
{
let value_labels_ranges = context.build_value_labels_ranges(isa).unwrap();