summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2005-11-08 22:03:08 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2005-11-08 22:03:08 +0000
commit0f4931e96fbab38bdf4b810fe96c9f368e61bb85 (patch)
treec9fd0a8183c5c83f8c5be8acf6f0c679c84a71a6 /gnu/usr.bin/binutils/gdb
parent57a5a153f8b055c934e8bce0c13403cd575d202c (diff)
Fix single step buglet on sparc/sparc64.
Diffstat (limited to 'gnu/usr.bin/binutils/gdb')
-rw-r--r--gnu/usr.bin/binutils/gdb/sparc-tdep.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gnu/usr.bin/binutils/gdb/sparc-tdep.c b/gnu/usr.bin/binutils/gdb/sparc-tdep.c
index 05b42aca59c..a472bb27e61 100644
--- a/gnu/usr.bin/binutils/gdb/sparc-tdep.c
+++ b/gnu/usr.bin/binutils/gdb/sparc-tdep.c
@@ -1026,10 +1026,10 @@ sparc_software_single_step (enum target_signal sig, int insert_breakpoints_p)
if (insert_breakpoints_p)
{
- CORE_ADDR pc;
+ CORE_ADDR pc, orig_npc;
pc = sparc_address_from_register (tdep->pc_regnum);
- npc = sparc_address_from_register (tdep->npc_regnum);
+ orig_npc = npc = sparc_address_from_register (tdep->npc_regnum);
/* Analyze the instruction at PC. */
nnpc = sparc_analyze_control_transfer (pc, &npc);
@@ -1039,9 +1039,10 @@ sparc_software_single_step (enum target_signal sig, int insert_breakpoints_p)
target_insert_breakpoint (nnpc, nnpc_save);
/* Assert that we have set at least one breakpoint, and that
- they're not set at the same spot. */
- gdb_assert (npc != 0 || nnpc != 0);
- gdb_assert (nnpc != npc);
+ they're not set at the same spot - unless we're going
+ from here straight to NULL, i.e. a call or jump to 0. */
+ gdb_assert (npc != 0 || nnpc != 0 || orig_npc == 0);
+ gdb_assert (nnpc != npc || orig_npc == 0);
}
else
{