Skip to content

Commit 1c307f3

Browse files
committed
Use gimli's byteorder in debuginfo.rs
1 parent 562488a commit 1c307f3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/debuginfo.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ use crate::prelude::*;
44

55
use std::marker::PhantomData;
66

7+
use gimli::{Endianity, Format, RunTimeEndian};
78
use gimli::write::{
89
Address, AttributeValue, CompilationUnit, DebugAbbrev, DebugInfo, DebugLine, DebugRanges,
910
DebugRngLists, DebugStr, EndianVec, LineProgram, LineProgramId, LineProgramTable, Range,
1011
RangeList, RangeListTable, Result, SectionId, StringTable, UnitEntryId, UnitId, UnitTable, Writer,
1112
};
12-
use gimli::Format;
1313

14-
// FIXME: use target endian
15-
use byteorder::ByteOrder;
16-
use gimli::RunTimeEndian;
1714

1815
use faerie::*;
1916

@@ -25,6 +22,7 @@ fn target_endian(tcx: TyCtxt) -> RunTimeEndian {
2522
Endian::Little => RunTimeEndian::Little,
2623
}
2724
}
25+
2826
struct DebugReloc {
2927
offset: u32,
3028
size: u8,
@@ -390,7 +388,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
390388
// FIXME: add to appropriate scope intead of root
391389
let entry = unit.get_mut(self.entry_id);
392390
let mut size_array = [0; 8];
393-
byteorder::LittleEndian::write_u64(&mut size_array, size as u64);
391+
target_endian(tcx).write_u64(&mut size_array, size as u64);
394392
entry.set(gimli::DW_AT_high_pc, AttributeValue::Data8(size_array));
395393

396394
self.debug_context.unit_range_list.0.push(Range {

0 commit comments

Comments
 (0)