File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,30 @@ pub enum ObjInsArg {
50
50
BranchOffset ( i32 ) ,
51
51
}
52
52
53
+ impl ObjInsArg {
54
+ pub fn loose_eq ( & self , other : & ObjInsArg ) -> bool {
55
+ match ( self , other) {
56
+ ( ObjInsArg :: PpcArg ( a) , ObjInsArg :: PpcArg ( b) ) => {
57
+ a == b
58
+ || match ( a, b) {
59
+ // Consider Simm and Offset equivalent
60
+ ( ppc750cl:: Argument :: Simm ( simm) , ppc750cl:: Argument :: Offset ( off) )
61
+ | ( ppc750cl:: Argument :: Offset ( off) , ppc750cl:: Argument :: Simm ( simm) ) => {
62
+ simm. 0 == off. 0
63
+ }
64
+ _ => false ,
65
+ }
66
+ }
67
+ ( ObjInsArg :: MipsArg ( a) , ObjInsArg :: MipsArg ( b) ) => a == b,
68
+ ( ObjInsArg :: MipsArgWithBase ( a) , ObjInsArg :: MipsArgWithBase ( b) ) => a == b,
69
+ ( ObjInsArg :: Reloc , ObjInsArg :: Reloc ) => true ,
70
+ ( ObjInsArg :: RelocWithBase , ObjInsArg :: RelocWithBase ) => true ,
71
+ ( ObjInsArg :: BranchOffset ( a) , ObjInsArg :: BranchOffset ( b) ) => a == b,
72
+ _ => false ,
73
+ }
74
+ }
75
+ }
76
+
53
77
#[ derive( Debug , Copy , Clone ) ]
54
78
pub struct ObjInsArgDiff {
55
79
/// Incrementing index for coloring
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ fn write_ins(
194
194
HighlightKind :: Address ( v) => {
195
195
matches ! ( arg, ObjInsArg :: BranchOffset ( offset) if ( offset + ins. address as i32 - base_addr as i32 ) as u32 == * v)
196
196
}
197
- HighlightKind :: Arg ( v) => v == arg,
197
+ HighlightKind :: Arg ( v) => v. loose_eq ( arg) ,
198
198
_ => false ,
199
199
} ;
200
200
let color = if highlighted_arg {
You can’t perform that action at this time.
0 commit comments