aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorPavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>2021-05-11 12:11:43 +0300
committerRichard Henderson <richard.henderson@linaro.org>2021-05-26 15:33:59 -0700
commit57dcb643d79731b08a863444d6591d22552bc2e5 (patch)
tree5cce7762d84274bbcd4b44b2469ed3ecfeb8c252 /softmmu
parente5ceadff47ddec1513a56f96d9df246f62c90875 (diff)
replay: fix watchpoint processing for reverse debugging
This patch enables reverse debugging with watchpoints. Reverse continue scans the execution to find the breakpoints and watchpoints that should fire. It uses helper function replay_breakpoint() for that. But this function needs to access icount, which can't be correct in the middle of TB. Therefore, in case of watchpoint, we have to retranslate the block to allow this access. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Message-Id: <162072430303.827403.7379783546934958566.stgit@pasha-ThinkPad-X280> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/physmem.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index e1da81ed2f..1c8717684a 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -905,6 +905,16 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len,
&& (wp->flags & flags)) {
if (replay_running_debug()) {
/*
+ * replay_breakpoint reads icount.
+ * Force recompile to succeed, because icount may
+ * be read only at the end of the block.
+ */
+ if (!cpu->can_do_io) {
+ /* Force execution of one insn next time. */
+ cpu->cflags_next_tb = 1 | CF_LAST_IO | curr_cflags(cpu);
+ cpu_loop_exit_restore(cpu, ra);
+ }
+ /*
* Don't process the watchpoints when we are
* in a reverse debugging operation.
*/