File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ pub(crate) fn disassemble_myself() -> HashSet<Function> {
85
85
let objdump = env:: var ( "OBJDUMP" ) . unwrap_or_else ( |_| "objdump" . to_string ( ) ) ;
86
86
let output = Command :: new ( objdump. clone ( ) )
87
87
. arg ( "--disassemble" )
88
+ . arg ( "--no-show-raw-insn" )
88
89
. arg ( & me)
89
90
. output ( )
90
91
. unwrap_or_else ( |_| panic ! ( "failed to execute objdump. OBJDUMP={}" , objdump) ) ;
@@ -156,20 +157,13 @@ fn parse(output: &str) -> HashSet<Function> {
156
157
. skip_while ( |s| * s == "lock" ) // skip x86-specific prefix
157
158
. collect :: < Vec < String > > ( )
158
159
} else {
159
- // objdump
160
+ // objdump with --no-show-raw-insn
160
161
// Each line of instructions should look like:
161
162
//
162
- // $rel_offset: ab cd ef 00 $instruction...
163
- let expected_len = if cfg ! ( target_arch = "arm" ) || cfg ! ( target_arch = "aarch64" ) {
164
- 8
165
- } else {
166
- 2
167
- } ;
168
-
163
+ // $rel_offset: $instruction...
169
164
instruction
170
165
. split_whitespace ( )
171
166
. skip ( 1 )
172
- . skip_while ( |s| s. len ( ) == expected_len && usize:: from_str_radix ( s, 16 ) . is_ok ( ) )
173
167
. skip_while ( |s| * s == "lock" ) // skip x86-specific prefix
174
168
. map ( std:: string:: ToString :: to_string)
175
169
. collect :: < Vec < String > > ( )
You can’t perform that action at this time.
0 commit comments