@@ -144,9 +144,11 @@ impl ArchMips {
144
144
145
145
fn instruction_display_flags (
146
146
& self ,
147
- _diff_config : & DiffObjConfig ,
147
+ diff_config : & DiffObjConfig ,
148
148
) -> rabbitizer:: InstructionDisplayFlags {
149
- rabbitizer:: InstructionDisplayFlags :: default ( ) . with_unknown_instr_comment ( false )
149
+ rabbitizer:: InstructionDisplayFlags :: default ( )
150
+ . with_unknown_instr_comment ( false )
151
+ . with_use_dollar ( diff_config. mips_register_prefix )
150
152
}
151
153
152
154
fn parse_ins_ref (
@@ -207,7 +209,6 @@ impl Arch for ArchMips {
207
209
function_range,
208
210
resolved. section_index ,
209
211
& display_flags,
210
- diff_config,
211
212
cb,
212
213
) ?;
213
214
Ok ( ( ) )
@@ -301,7 +302,6 @@ fn push_args(
301
302
function_range : Range < u64 > ,
302
303
section_index : usize ,
303
304
display_flags : & rabbitizer:: InstructionDisplayFlags ,
304
- diff_config : & DiffObjConfig ,
305
305
mut arg_cb : impl FnMut ( InstructionPart ) -> Result < ( ) > ,
306
306
) -> Result < ( ) > {
307
307
let operands = instruction. valued_operands_iter ( ) ;
@@ -361,14 +361,11 @@ fn push_args(
361
361
} ) ) ) ?;
362
362
}
363
363
arg_cb ( InstructionPart :: basic ( "(" ) ) ?;
364
- let mut value =
365
- base. either_name ( instruction. flags ( ) . abi ( ) , display_flags. named_gpr ( ) ) ;
366
- if !diff_config. mips_register_prefix {
367
- if let Some ( trimmed) = value. strip_prefix ( '$' ) {
368
- value = trimmed;
369
- }
370
- }
371
- arg_cb ( InstructionPart :: opaque ( value) ) ?;
364
+ arg_cb ( InstructionPart :: opaque ( base. either_name (
365
+ instruction. flags ( ) . abi ( ) ,
366
+ display_flags. named_gpr ( ) ,
367
+ !display_flags. use_dollar ( ) ,
368
+ ) ) ) ?;
372
369
arg_cb ( InstructionPart :: basic ( ")" ) ) ?;
373
370
}
374
371
// ValuedOperand::r5900_immediate15(..) => match relocation {
@@ -382,14 +379,9 @@ fn push_args(
382
379
// }
383
380
// },
384
381
_ => {
385
- let value = op. display ( instruction, display_flags, None :: < & str > ) . to_string ( ) ;
386
- if !diff_config. mips_register_prefix {
387
- if let Some ( value) = value. strip_prefix ( '$' ) {
388
- arg_cb ( InstructionPart :: opaque ( value) ) ?;
389
- continue ;
390
- }
391
- }
392
- arg_cb ( InstructionPart :: opaque ( value) ) ?;
382
+ arg_cb ( InstructionPart :: opaque (
383
+ op. display ( instruction, display_flags, None :: < & str > ) . to_string ( ) ,
384
+ ) ) ?;
393
385
}
394
386
}
395
387
}
0 commit comments