aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 77169a7..797e240 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -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