@@ -4,16 +4,13 @@ use crate::prelude::*;
4
4
5
5
use std:: marker:: PhantomData ;
6
6
7
+ use gimli:: { Endianity , Format , RunTimeEndian } ;
7
8
use gimli:: write:: {
8
9
Address , AttributeValue , CompilationUnit , DebugAbbrev , DebugInfo , DebugLine , DebugRanges ,
9
10
DebugRngLists , DebugStr , EndianVec , LineProgram , LineProgramId , LineProgramTable , Range ,
10
11
RangeList , RangeListTable , Result , SectionId , StringTable , UnitEntryId , UnitId , UnitTable , Writer ,
11
12
} ;
12
- use gimli:: Format ;
13
13
14
- // FIXME: use target endian
15
- use byteorder:: ByteOrder ;
16
- use gimli:: RunTimeEndian ;
17
14
18
15
use faerie:: * ;
19
16
@@ -25,6 +22,7 @@ fn target_endian(tcx: TyCtxt) -> RunTimeEndian {
25
22
Endian :: Little => RunTimeEndian :: Little ,
26
23
}
27
24
}
25
+
28
26
struct DebugReloc {
29
27
offset : u32 ,
30
28
size : u8 ,
@@ -390,7 +388,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
390
388
// FIXME: add to appropriate scope intead of root
391
389
let entry = unit. get_mut ( self . entry_id ) ;
392
390
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 ) ;
394
392
entry. set ( gimli:: DW_AT_high_pc , AttributeValue :: Data8 ( size_array) ) ;
395
393
396
394
self . debug_context . unit_range_list . 0 . push ( Range {
0 commit comments