2
1

750-debian_sparc-singlestep.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Status: submitted for comments
  2. 2004-11-13 Daniel Jacobowitz <dan@debian.org>
  3. * sparc-tdep.c (sparc_software_single_step): Handle stepping to NULL.
  4. Index: gdb-6.3/gdb/sparc-tdep.c
  5. ===================================================================
  6. --- gdb-6.3.orig/gdb/sparc-tdep.c 2004-06-06 22:02:55.000000000 -0400
  7. +++ gdb-6.3/gdb/sparc-tdep.c 2004-11-13 17:06:05.000000000 -0500
  8. @@ -1026,10 +1026,10 @@
  9. if (insert_breakpoints_p)
  10. {
  11. - CORE_ADDR pc;
  12. + CORE_ADDR pc, orig_npc;
  13. pc = sparc_address_from_register (tdep->pc_regnum);
  14. - npc = sparc_address_from_register (tdep->npc_regnum);
  15. + orig_npc = npc = sparc_address_from_register (tdep->npc_regnum);
  16. /* Analyze the instruction at PC. */
  17. nnpc = sparc_analyze_control_transfer (pc, &npc);
  18. @@ -1039,9 +1039,10 @@
  19. target_insert_breakpoint (nnpc, nnpc_save);
  20. /* Assert that we have set at least one breakpoint, and that
  21. - they're not set at the same spot. */
  22. - gdb_assert (npc != 0 || nnpc != 0);
  23. - gdb_assert (nnpc != npc);
  24. + they're not set at the same spot - unless we're going
  25. + from here straight to NULL, i.e. a call or jump to 0. */
  26. + gdb_assert (npc != 0 || nnpc != 0 || orig_npc == 0);
  27. + gdb_assert (nnpc != npc || orig_npc == 0);
  28. }
  29. else
  30. {