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 {
5050 BranchOffset ( i32 ) ,
5151}
5252
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+
5377#[ derive( Debug , Copy , Clone ) ]
5478pub struct ObjInsArgDiff {
5579 /// Incrementing index for coloring
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ fn write_ins(
194194 HighlightKind :: Address ( v) => {
195195 matches ! ( arg, ObjInsArg :: BranchOffset ( offset) if ( offset + ins. address as i32 - base_addr as i32 ) as u32 == * v)
196196 }
197- HighlightKind :: Arg ( v) => v == arg,
197+ HighlightKind :: Arg ( v) => v. loose_eq ( arg) ,
198198 _ => false ,
199199 } ;
200200 let color = if highlighted_arg {
You can’t perform that action at this time.
0 commit comments