Skip to content

Commit c5c6ce8

Browse files
committed
Small change
1 parent beda787 commit c5c6ce8

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/debuginfo/line_info.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use crate::prelude::*;
22

33
use syntax::source_map::FileName;
44

5+
use cranelift::codegen::binemit::CodeOffset;
6+
57
use gimli::write::{
68
Address, AttributeValue, FileId, LineProgram, LineString,
79
LineStringTable, Range, UnitEntryId,
@@ -75,7 +77,7 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
7577
context: &Context,
7678
isa: &dyn cranelift::codegen::isa::TargetIsa,
7779
source_info_set: &indexmap::IndexSet<(Span, mir::SourceScope)>,
78-
) {
80+
) -> CodeOffset {
7981
let tcx = self.debug_context.tcx;
8082

8183
let line_program = &mut self.debug_context.dwarf.unit.line_program;
@@ -135,15 +137,6 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
135137

136138
self.debug_context.emit_location(self.entry_id, self.mir.span);
137139

138-
self.debug_context
139-
.unit_range_list
140-
.0
141-
.push(Range::StartLength {
142-
begin: Address::Symbol {
143-
symbol: self.symbol,
144-
addend: 0,
145-
},
146-
length: end as u64,
147-
});
140+
end
148141
}
149142
}

src/debuginfo/mod.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use cranelift::codegen::isa::RegUnit;
88

99
use gimli::write::{
1010
self, Address, AttributeValue, DwarfUnit, Expression, LineProgram, LineString,
11-
Location, LocationList, RangeList, UnitEntryId, Writer,
11+
Location, LocationList, Range, RangeList, UnitEntryId, Writer,
1212
};
1313
use gimli::{Encoding, Format, LineEncoding, Register, RunTimeEndian, X86_64};
1414

@@ -237,7 +237,18 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
237237
isa: &dyn cranelift::codegen::isa::TargetIsa,
238238
source_info_set: &indexmap::IndexSet<(Span, mir::SourceScope)>,
239239
) {
240-
self.create_debug_lines(context, isa, source_info_set);
240+
let end = self.create_debug_lines(context, isa, source_info_set);
241+
242+
self.debug_context
243+
.unit_range_list
244+
.0
245+
.push(Range::StartLength {
246+
begin: Address::Symbol {
247+
symbol: self.symbol,
248+
addend: 0,
249+
},
250+
length: end as u64,
251+
});
241252

242253
{
243254
let value_labels_ranges = context.build_value_labels_ranges(isa).unwrap();

0 commit comments

Comments
 (0)