* sparc-tdep.c (sparc_software_single_step): Handle stepping to NULL.
authorDaniel Jacobowitz <drow@false.org>
Sun, 21 Nov 2004 20:11:09 +0000 (20:11 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sun, 21 Nov 2004 20:11:09 +0000 (20:11 +0000)
gdb/ChangeLog
gdb/sparc-tdep.c

index cf5f5358d440685a9b55eb4e5b849ed91cfd7be5..035f34a98d107cd2390117d492c2a146258c8174 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 78f38815caca0ee31d4e36fa59956fec047ec847..8f39baa738a9c62efb9b6ebd7b17311674304314 100644 (file)
@@ -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
     {
This page took 0.038476 seconds and 4 git commands to generate.