patches/gdb/6.3/750-debian_sparc-singlestep.patch
changeset 301 2be7232a73ac
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gdb/6.3/750-debian_sparc-singlestep.patch	Sat Jul 28 21:34:41 2007 +0000
     1.3 @@ -0,0 +1,37 @@
     1.4 +Status: submitted for comments
     1.5 +
     1.6 +2004-11-13  Daniel Jacobowitz  <dan@debian.org>
     1.7 +
     1.8 +	* sparc-tdep.c (sparc_software_single_step): Handle stepping to NULL.
     1.9 +
    1.10 +Index: gdb-6.3/gdb/sparc-tdep.c
    1.11 +===================================================================
    1.12 +--- gdb-6.3.orig/gdb/sparc-tdep.c	2004-06-06 22:02:55.000000000 -0400
    1.13 ++++ gdb-6.3/gdb/sparc-tdep.c	2004-11-13 17:06:05.000000000 -0500
    1.14 +@@ -1026,10 +1026,10 @@
    1.15 + 
    1.16 +   if (insert_breakpoints_p)
    1.17 +     {
    1.18 +-      CORE_ADDR pc;
    1.19 ++      CORE_ADDR pc, orig_npc;
    1.20 + 
    1.21 +       pc = sparc_address_from_register (tdep->pc_regnum);
    1.22 +-      npc = sparc_address_from_register (tdep->npc_regnum);
    1.23 ++      orig_npc = npc = sparc_address_from_register (tdep->npc_regnum);
    1.24 + 
    1.25 +       /* Analyze the instruction at PC.  */
    1.26 +       nnpc = sparc_analyze_control_transfer (pc, &npc);
    1.27 +@@ -1039,9 +1039,10 @@
    1.28 + 	target_insert_breakpoint (nnpc, nnpc_save);
    1.29 + 
    1.30 +       /* Assert that we have set at least one breakpoint, and that
    1.31 +-         they're not set at the same spot.  */
    1.32 +-      gdb_assert (npc != 0 || nnpc != 0);
    1.33 +-      gdb_assert (nnpc != npc);
    1.34 ++         they're not set at the same spot - unless we're going
    1.35 ++	 from here straight to NULL, i.e. a call or jump to 0.  */
    1.36 ++      gdb_assert (npc != 0 || nnpc != 0 || orig_npc == 0);
    1.37 ++      gdb_assert (nnpc != npc || orig_npc == 0);
    1.38 +     }
    1.39 +   else
    1.40 +     {