From nobody Mon Feb 9 23:19:19 2026 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=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525121308300304.14981880366736; Mon, 30 Apr 2018 13:48:28 -0700 (PDT) Received: from localhost ([::1]:33344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDFil-0003TR-6X for importer@patchew.org; Mon, 30 Apr 2018 16:48:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDFhE-0002ot-Lc for qemu-devel@nongnu.org; Mon, 30 Apr 2018 16:46:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDFhA-0001P0-NW for qemu-devel@nongnu.org; Mon, 30 Apr 2018 16:46:52 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:41052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDFhA-0001LP-CG for qemu-devel@nongnu.org; Mon, 30 Apr 2018 16:46:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Message-Id:Date:Subject:To:From:Sender :Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vF+cnBQiAnoassuH3Efwuwe/BFBObfaowIikAJv+A28=; b=rhBkB3Wn31/ed1QJd9MTyswrXQ venYc64lezM9Doc+9kmDyRABt3qhhekRcjvwEx/3pXx7axcnHKm4YxR3Lb7nobJUS1Xd7aOtrf2z3 0rhWPW+BV80maa25OWMRdeyA5yYDOIXJjL5dcraG/+h3vieOSysTJzpfmX3nyLA2gok4=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Mon, 30 Apr 2018 22:46:40 +0200 Message-Id: <20180430204640.1713-1-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.4.30.204216, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.4.9.5491000 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [PATCH] target/tricore: Fix QEMU crashing when using -singlestep 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" when -singlestep is enabled we will actually return a tb->size of 0, even though we emit one instruction. This is because we do the update to ct= x.pc after exiting the translation loop on the singlestep path. Therefore we substract pc_start from ctx.pc, aka pc_start. Signed-off-by: Bastian Koppelmann --- target/tricore/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index aef0d9cf06..be2579d189 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -8843,12 +8843,12 @@ void gen_intermediate_code(CPUState *cs, struct Tra= nslationBlock *tb) ctx.opcode =3D cpu_ldl_code(env, ctx.pc); decode_opc(env, &ctx, 0); + ctx.pc =3D ctx.next_pc; if (num_insns >=3D max_insns || tcg_op_buf_full()) { gen_save_pc(ctx.next_pc); tcg_gen_exit_tb(0); break; } - ctx.pc =3D ctx.next_pc; } gen_tb_end(tb, num_insns); -- 2.11.0