target-mips: fix single-stepping

Single-stepping branches on MIPS didn't work right, because the
generation of EXCP_DEBUG happened after the generation of the code to
exit the current TB.  That is, given the code:

    bne v0,v1,target
    nop
    ...
  target:
    addu v0,v0,v1
  1:

when you single-stepped through the NOP, execution wouldn't actually
halt until you reached the label `1'.

This patch corrects that and also changes single-stepping so that a
branch and its delay slot are executed as one instruction for the
purposes of single-stepping.  This behavior is comparable to what other
MIPS tools (e.g. MIPSsim with MDI) do.  GDB avoids placing breakpoints
in branch delay slots, so this change doesn't break anything on the GDB
side.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
1 file changed
tree: 19e17d327cfde958be899ce9ffe3c9109f618131
  1. audio/
  2. block/
  3. bsd-user/
  4. darwin-user/
  5. fpu/
  6. gdb-xml/
  7. hw/
  8. linux-user/
  9. pc-bios/
  10. roms/
  11. slirp/
  12. target-alpha/
  13. target-arm/
  14. target-cris/
  15. target-i386/
  16. target-m68k/
  17. target-microblaze/
  18. target-mips/
  19. target-ppc/
  20. target-sh4/
  21. target-sparc/
  22. tcg/
  23. tests/
  24. .gitignore
  25. .gitmodules
  26. a.out.h
  27. acl.c
  28. acl.h
  29. aes.c
  30. aes.h
  31. aio.c
  32. alpha-dis.c
  33. alpha.ld
  34. arm-dis.c
  35. arm-semi.c
  36. arm.ld
  37. balloon.h
  38. block.c
  39. block.h
  40. block_int.h
  41. bswap.h
  42. bt-host.c
  43. bt-host.h
  44. bt-vhci.c
  45. buffered_file.c
  46. buffered_file.h
  47. cache-utils.c
  48. cache-utils.h
  49. Changelog
  50. check-qdict.c
  51. check-qint.c
  52. check-qstring.c
  53. cmd.c
  54. cmd.h
  55. cocoa.m
  56. CODING_STYLE
  57. configure
  58. console.c
  59. console.h
  60. COPYING
  61. COPYING.LIB
  62. cpu-all.h
  63. cpu-common.h
  64. cpu-defs.h
  65. cpu-exec.c
  66. create_config
  67. cris-dis.c
  68. curses.c
  69. curses_keys.h
  70. cutils.c
  71. d3des.c
  72. d3des.h
  73. def-helper.h
  74. device_tree.c
  75. device_tree.h
  76. dis-asm.h
  77. disas.c
  78. disas.h
  79. dma-helpers.c
  80. dma.h
  81. dyngen-exec.h
  82. elf.h
  83. elf_ops.h
  84. envlist.c
  85. envlist.h
  86. exec-all.h
  87. exec.c
  88. feature_to_c.sh
  89. gdbstub.c
  90. gdbstub.h
  91. gen-icount.h
  92. host-utils.c
  93. host-utils.h
  94. hostregs_helper.h
  95. hpet.h
  96. hppa-dis.c
  97. hppa.ld
  98. hxtool
  99. i386-dis.c
  100. i386.ld
  101. ia64.ld
  102. ioport-user.c
  103. ioport.c
  104. ioport.h
  105. keymaps.c
  106. keymaps.h
  107. kvm-all.c
  108. kvm.h
  109. libfdt_env.h
  110. LICENSE
  111. linux-aio.c
  112. loader.c
  113. m68k-dis.c
  114. m68k-semi.c
  115. m68k.ld
  116. MAINTAINERS
  117. Makefile
  118. Makefile.hw
  119. Makefile.target
  120. microblaze-dis.c
  121. migration-exec.c
  122. migration-fd.c
  123. migration-tcp.c
  124. migration-unix.c
  125. migration.c
  126. migration.h
  127. mips-dis.c
  128. mips.ld
  129. module.c
  130. module.h
  131. monitor.c
  132. monitor.h
  133. nbd.c
  134. nbd.h
  135. net-checksum.c
  136. net.c
  137. net.h
  138. osdep.c
  139. osdep.h
  140. path.c
  141. pci-ids.txt
  142. posix-aio-compat.c
  143. ppc-dis.c
  144. ppc.ld
  145. ppc64.ld
  146. qdict-test-data.txt
  147. qdict.c
  148. qdict.h
  149. qemu-aio.h
  150. qemu-binfmt-conf.sh
  151. qemu-char.c
  152. qemu-char.h
  153. qemu-common.h
  154. qemu-config.c
  155. qemu-config.h
  156. qemu-doc.texi
  157. qemu-img-cmds.hx
  158. qemu-img.c
  159. qemu-img.texi
  160. qemu-io.c
  161. qemu-lock.h
  162. qemu-log.h
  163. qemu-malloc.c
  164. qemu-monitor.hx
  165. qemu-nbd.c
  166. qemu-nbd.texi
  167. qemu-option.c
  168. qemu-option.h
  169. qemu-options.hx
  170. qemu-queue.h
  171. qemu-sockets.c
  172. qemu-tech.texi
  173. qemu-thread.c
  174. qemu-thread.h
  175. qemu-timer.h
  176. qemu-tool.c
  177. qemu.sasl
  178. qemu_socket.h
  179. qint.c
  180. qint.h
  181. qobject.h
  182. qstring.c
  183. qstring.h
  184. readline.c
  185. readline.h
  186. README
  187. rules.mak
  188. s390-dis.c
  189. s390.ld
  190. savevm.c
  191. sdl.c
  192. sdl_keysym.h
  193. sdl_zoom.c
  194. sdl_zoom.h
  195. sdl_zoom_template.h
  196. sh4-dis.c
  197. softmmu-semi.h
  198. softmmu_defs.h
  199. softmmu_exec.h
  200. softmmu_header.h
  201. softmmu_template.h
  202. sparc-dis.c
  203. sparc.ld
  204. sparc64.ld
  205. sysemu.h
  206. tap-win32.c
  207. targphys.h
  208. texi2pod.pl
  209. thunk.c
  210. thunk.h
  211. TODO
  212. translate-all.c
  213. uboot_image.h
  214. usb-bsd.c
  215. usb-linux.c
  216. usb-stub.c
  217. VERSION
  218. vgafont.h
  219. vl.c
  220. vnc-auth-sasl.c
  221. vnc-auth-sasl.h
  222. vnc-auth-vencrypt.c
  223. vnc-auth-vencrypt.h
  224. vnc-tls.c
  225. vnc-tls.h
  226. vnc.c
  227. vnc.h
  228. vnc_keysym.h
  229. vnchextile.h
  230. x86_64.ld
  231. x_keymap.c
  232. x_keymap.h