@@ -12,7 +12,6 @@ use super::SymbolName;
12
12
use addr2line:: gimli;
13
13
use core:: convert:: TryInto ;
14
14
use core:: mem;
15
- use core:: u32;
16
15
use libc:: c_void;
17
16
use mystd:: ffi:: OsString ;
18
17
use mystd:: fs:: File ;
@@ -100,7 +99,7 @@ impl Mapping {
100
99
// only borrow `map` and `stash` and we're preserving them below.
101
100
cx : unsafe { core:: mem:: transmute :: < Context < ' _ > , Context < ' static > > ( cx) } ,
102
101
_map : data,
103
- stash : stash ,
102
+ stash,
104
103
} )
105
104
}
106
105
}
@@ -119,16 +118,18 @@ impl<'data> Context<'data> {
119
118
dwp : Option < Object < ' data > > ,
120
119
) -> Option < Context < ' data > > {
121
120
let mut sections = gimli:: Dwarf :: load ( |id| -> Result < _ , ( ) > {
122
- if cfg ! ( not( target_os = "aix" ) ) {
121
+ #[ cfg( not( target_os = "aix" ) ) ]
122
+ {
123
123
let data = object. section ( stash, id. name ( ) ) . unwrap_or ( & [ ] ) ;
124
124
Ok ( EndianSlice :: new ( data, Endian ) )
125
+ }
126
+
127
+ #[ cfg( target_os = "aix" ) ]
128
+ if let Some ( name) = id. xcoff_name ( ) {
129
+ let data = object. section ( stash, name) . unwrap_or ( & [ ] ) ;
130
+ Ok ( EndianSlice :: new ( data, Endian ) )
125
131
} else {
126
- if let Some ( name) = id. xcoff_name ( ) {
127
- let data = object. section ( stash, name) . unwrap_or ( & [ ] ) ;
128
- Ok ( EndianSlice :: new ( data, Endian ) )
129
- } else {
130
- Ok ( EndianSlice :: new ( & [ ] , Endian ) )
131
- }
132
+ Ok ( EndianSlice :: new ( & [ ] , Endian ) )
132
133
}
133
134
} )
134
135
. ok ( ) ?;
@@ -336,7 +337,7 @@ impl Cache {
336
337
// never happen, and symbolicating backtraces would be ssssllllooooowwww.
337
338
static mut MAPPINGS_CACHE : Option < Cache > = None ;
338
339
339
- f ( MAPPINGS_CACHE . get_or_insert_with ( || Cache :: new ( ) ) )
340
+ f ( MAPPINGS_CACHE . get_or_insert_with ( Cache :: new) )
340
341
}
341
342
342
343
fn avma_to_svma ( & self , addr : * const u8 ) -> Option < ( usize , * const u8 ) > {
0 commit comments