aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2004-11-21 20:11:09 +0000
committerDaniel Jacobowitz <drow@false.org>2004-11-21 20:11:09 +0000
commit8c3900e40915ace35ae14b62069e684d9d035ed6 (patch)
tree19230b23d8a10e3e7e4b1e8174207ebf0663d4e2 /gdb
parentb957e93796cfbdade45a450c4f6ff4400e58f29a (diff)
downloadgdb-8c3900e40915ace35ae14b62069e684d9d035ed6.zip
gdb-8c3900e40915ace35ae14b62069e684d9d035ed6.tar.gz
gdb-8c3900e40915ace35ae14b62069e684d9d035ed6.tar.bz2
* sparc-tdep.c (sparc_software_single_step): Handle stepping to NULL.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/sparc-tdep.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf5f535..035f34a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2004-11-21 Daniel Jacobowitz <dan@debian.org>
+ * sparc-tdep.c (sparc_software_single_step): Handle stepping to NULL.
+
+2004-11-21 Daniel Jacobowitz <dan@debian.org>
+
* linux-nat.c (my_waitpid): New function.
(linux_test_for_tracefork): Make more robust and verbose. Take
an ORIGINAL_PID argument and test for PTRACE_SETOPTIONS first.
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 78f3881..8f39baa 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -1030,10 +1030,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);
@@ -1043,9 +1043,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
{