[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/79] translator: fix breakpoint processing
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 40/79] translator: fix breakpoint processing |
Date: |
Sun, 30 Sep 2018 10:12:38 +0200 |
From: Pavel Dovgalyuk <address@hidden>
QEMU cannot pass through the breakpoints when 'si' command is used
in remote gdb. This patch disables inserting the breakpoints
when we are already single stepping though the gdb remote protocol.
This patch also fixes icount calculation for the blocks that include
breakpoints - instruction with breakpoint is not executed and shouldn't
be used in icount calculation.
Signed-off-by: Pavel Dovgalyuk <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
accel/tcg/translator.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index 0f9dca9..afd0a49 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -34,6 +34,8 @@ void translator_loop_temp_check(DisasContextBase *db)
void translator_loop(const TranslatorOps *ops, DisasContextBase *db,
CPUState *cpu, TranslationBlock *tb)
{
+ int bp_insn = 0;
+
/* Initialize DisasContext */
db->tb = tb;
db->pc_first = tb->pc;
@@ -71,11 +73,13 @@ void translator_loop(const TranslatorOps *ops,
DisasContextBase *db,
tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */
/* Pass breakpoint hits to target for further processing */
- if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) {
+ if (!db->singlestep_enabled
+ && unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) {
CPUBreakpoint *bp;
QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
if (bp->pc == db->pc_next) {
if (ops->breakpoint_check(db, cpu, bp)) {
+ bp_insn = 1;
break;
}
}
@@ -118,7 +122,7 @@ void translator_loop(const TranslatorOps *ops,
DisasContextBase *db,
/* Emit code to exit the TB, as indicated by db->is_jmp. */
ops->tb_stop(db, cpu);
- gen_tb_end(db->tb, db->num_insns);
+ gen_tb_end(db->tb, db->num_insns - bp_insn);
/* The disas_log hook may use these values rather than recompute. */
db->tb->size = db->pc_next - db->pc_first;
--
1.8.3.1
- [Qemu-devel] [PULL 31/79] target/i386: move cpu_ptr0 to DisasContext, (continued)
- [Qemu-devel] [PULL 31/79] target/i386: move cpu_ptr0 to DisasContext, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 30/79] target/i386: move cpu_tmp4 to DisasContext, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 29/79] target/i386: move cpu_tmp0 to DisasContext, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 32/79] target/i386: move cpu_ptr1 to DisasContext, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 35/79] target/i386: move cpu_tmp1_i64 to DisasContext, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 33/79] target/i386: move cpu_tmp2_i32 to DisasContext, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 38/79] replay: wake up vCPU when replaying, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 42/79] timer: introduce new virtual clock, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 37/79] configure: enable mttcg for i386 and x86_64, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 39/79] replay: flush events when exiting, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 40/79] translator: fix breakpoint processing,
Paolo Bonzini <=
- [Qemu-devel] [PULL 27/79] target/i386: move cpu_T0 to DisasContext, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 41/79] replay: allow loading any snapshots before recording, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 43/79] slirp: fix ipv6 timers, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 36/79] target/i386: move x86_64_hregs to DisasContext, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 45/79] fw_cfg_mem: add read memory region callback, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 44/79] ui: fix virtual timers, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 46/79] hw: debugexit: add read callback, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 48/79] hw: hyperv_testdev: add read callback, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 54/79] char-pty: remove unnecessary #ifdef, Paolo Bonzini, 2018/09/30
- [Qemu-devel] [PULL 51/79] Revert "chardev: tcp: postpone async connection setup", Paolo Bonzini, 2018/09/30