File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -889,8 +889,8 @@ static struct bpt *new_breakpoint(unsigned long a)
889889static void insert_bpts (void )
890890{
891891 int i ;
892- struct ppc_inst instr ;
893- struct bpt * bp ;
892+ struct ppc_inst instr , instr2 ;
893+ struct bpt * bp , * bp2 ;
894894
895895 bp = bpts ;
896896 for (i = 0 ; i < NBPTS ; ++ i , ++ bp ) {
@@ -908,6 +908,29 @@ static void insert_bpts(void)
908908 bp -> enabled = 0 ;
909909 continue ;
910910 }
911+ /*
912+ * Check the address is not a suffix by looking for a prefix in
913+ * front of it.
914+ */
915+ if (mread_instr (bp -> address - 4 , & instr2 ) == 8 ) {
916+ printf ("Breakpoint at %lx is on the second word of a prefixed instruction, disabling it\n" ,
917+ bp -> address );
918+ bp -> enabled = 0 ;
919+ continue ;
920+ }
921+ /*
922+ * We might still be a suffix - if the prefix has already been
923+ * replaced by a breakpoint we won't catch it with the above
924+ * test.
925+ */
926+ bp2 = at_breakpoint (bp -> address - 4 );
927+ if (bp2 && ppc_inst_prefixed (ppc_inst_read (bp2 -> instr ))) {
928+ printf ("Breakpoint at %lx is on the second word of a prefixed instruction, disabling it\n" ,
929+ bp -> address );
930+ bp -> enabled = 0 ;
931+ continue ;
932+ }
933+
911934 patch_instruction (bp -> instr , instr );
912935 patch_instruction ((void * )bp -> instr + ppc_inst_len (instr ),
913936 ppc_inst (bpinstr ));
You can’t perform that action at this time.
0 commit comments