]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/sparc-tdep.c
gdb/
[thirdparty/binutils-gdb.git] / gdb / sparc-tdep.c
index 77169a7a4d8b796419120f609488f84592033fbf..797e2400536fe90792e02e1650d31e9b144f55b2 100644 (file)
@@ -1136,8 +1136,7 @@ sparc_software_single_step (enum target_signal sig, int insert_breakpoints_p)
 {
   struct gdbarch *arch = current_gdbarch;
   struct gdbarch_tdep *tdep = gdbarch_tdep (arch);
-  static CORE_ADDR npc, nnpc;
-  static gdb_byte npc_save[4], nnpc_save[4];
+  CORE_ADDR npc, nnpc;
 
   if (insert_breakpoints_p)
     {
@@ -1149,9 +1148,10 @@ sparc_software_single_step (enum target_signal sig, int insert_breakpoints_p)
       /* Analyze the instruction at PC.  */
       nnpc = sparc_analyze_control_transfer (arch, pc, &npc);
       if (npc != 0)
-       target_insert_breakpoint (npc, npc_save);
+       insert_single_step_breakpoint (npc);
+
       if (nnpc != 0)
-       target_insert_breakpoint (nnpc, nnpc_save);
+       insert_single_step_breakpoint (nnpc);
 
       /* Assert that we have set at least one breakpoint, and that
         they're not set at the same spot - unless we're going
@@ -1160,12 +1160,7 @@ sparc_software_single_step (enum target_signal sig, int insert_breakpoints_p)
       gdb_assert (nnpc != npc || orig_npc == 0);
     }
   else
-    {
-      if (npc != 0)
-       target_remove_breakpoint (npc, npc_save);
-      if (nnpc != 0)
-       target_remove_breakpoint (nnpc, nnpc_save);
-    }
+    remove_single_step_breakpoints ();
 }
 
 static void