From nobody Thu Nov 6 01:09:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538297147950227.16694641355366; Sun, 30 Sep 2018 01:45:47 -0700 (PDT) Received: from localhost ([::1]:54389 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6XMI-0007q6-Ly for importer@patchew.org; Sun, 30 Sep 2018 04:45:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6Wre-0002YV-6f for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6Wrd-0000t1-5F for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:06 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:38657) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6Wrc-0000s4-Rd for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:05 -0400 Received: by mail-wr1-x444.google.com with SMTP id j8-v6so10489346wrw.5 for ; Sun, 30 Sep 2018 01:14:04 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.14.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1+hcatbLNdoTnuY3zwRo1vezEhtOrqvwMA/tz1liv+E=; b=B6NbJZDi86lhfTYd2b6P/efNSq51fnQ18C+DXFt0F/Mt8UfbBB5KC5KHA5NEsYEBAY 1m1eWhK2gB87fecvG54Sro6nR1o/FfPY3eQ9DLB3gF1wiCExAFrtfdM7A9FtXlYhye5c BiRFTjujjD4jXSHJZa8GGVHL44k9gw5kGdo7j5jSvH6DKwg6VUK+jnVupB7sT3hyl9S7 f6z05KonILLtQOEEhkp1aVBk2ZxaTwzRFfnkplJIdzHc50cNRFpIhHFFDKkcLjwn2ZoN qC5M+zqNw8mi188sf3y6LZTFFe1PQlDWA2ZBLQM1vK+lMff+Dq2hs8XRVDdlRLi7Ps/9 MT7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=1+hcatbLNdoTnuY3zwRo1vezEhtOrqvwMA/tz1liv+E=; b=t/zSHskTmCmBQ+uq3NggZ6KyzveBQv5UD3S4JySssLkLtD+Oj1aKoGKqc4YSdRRKeb 0OVycqxeJ61Oi2vAvc0N8iONEtOB0DR7uokIFg7qK0Ixc2mAPP02IHIYrBeDsEJ2Nafo ZlK/MAq153aMTI0tcFnskXU82+A7i0Jca2OWKbQJ0w+cPVghgc0NdnYyI99KJWjFGScg pvN/RzIm0LkQYDqGTqKsZIftE+A9f5Z3bRaq/VMiDslIcRr9Ew1I5hJUPq8dvizRTHTI Io85zEiNzkQywbVHSrrUdCNEfz9LY3O9GVXuIRzk+MDNabZHELkHj26QSBzSdp4slgae ahVw== X-Gm-Message-State: ABuFfog/v16bYN01GEzlGksy8+12aWZtB91XAprQXkqCIG07ynWLmoCw YP+mXohI5qoVBNKCCpodPQgfAV2l X-Google-Smtp-Source: ACcGV62yxPXdIud912ysuy2N87kWjBcVgLu4UTG+Ex/EyRL242MCoY7tQDtfx9HJYchhcWzSXnHYjA== X-Received: by 2002:adf:fa92:: with SMTP id h18-v6mr124135wrr.74.1538295243082; Sun, 30 Sep 2018 01:14:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:12:38 +0200 Message-Id: <1538295197-23704-41-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PULL 40/79] translator: fix breakpoint processing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pavel Dovgalyuk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pavel Dovgalyuk 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 Message-Id: <20180912081910.3228.8523.stgit@pasha-VirtualBox> Signed-off-by: Paolo Bonzini --- 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 =3D 0; + /* Initialize DisasContext */ db->tb =3D tb; db->pc_first =3D tb->pc; @@ -71,11 +73,13 @@ void translator_loop(const TranslatorOps *ops, DisasCon= textBase *db, tcg_debug_assert(db->is_jmp =3D=3D DISAS_NEXT); /* no early exit = */ =20 /* 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 =3D=3D db->pc_next) { if (ops->breakpoint_check(db, cpu, bp)) { + bp_insn =3D 1; break; } } @@ -118,7 +122,7 @@ void translator_loop(const TranslatorOps *ops, DisasCon= textBase *db, =20 /* 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); =20 /* The disas_log hook may use these values rather than recompute. */ db->tb->size =3D db->pc_next - db->pc_first; --=20 1.8.3.1