From patchwork Thu Feb 15 19:15:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Seeger X-Patchwork-Id: 874093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zj5bs0f2sz9sRW for ; Fri, 16 Feb 2018 06:16:23 +1100 (AEDT) Received: from localhost ([::1]:51053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emP11-0006IQ-6y for incoming@patchwork.ozlabs.org; Thu, 15 Feb 2018 14:16:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emP0b-0006Hf-21 for qemu-devel@nongnu.org; Thu, 15 Feb 2018 14:15:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emP0X-0001No-QP for qemu-devel@nongnu.org; Thu, 15 Feb 2018 14:15:52 -0500 Received: from p3plsmtpa11-03.prod.phx3.secureserver.net ([68.178.252.104]:35250) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emP0X-0001NQ-Kg for qemu-devel@nongnu.org; Thu, 15 Feb 2018 14:15:49 -0500 Received: from wirbelwind.localnet ([204.197.155.4]) by :SMTPAUTH: with SMTP id mP0Ue6x0dzkEomP0UeW9VG; Thu, 15 Feb 2018 12:15:46 -0700 From: Steven Seeger To: qemu-devel@nongnu.org Date: Thu, 15 Feb 2018 14:15:43 -0500 Message-ID: <5193436.NpsRQSl3SI@wirbelwind> Organization: Embedded Flight Systems, Inc. MIME-Version: 1.0 X-CMAE-Envelope: MS4wfIuOhmsr0+jCyomDeWDscj8Txpd6W4bQ84AD1O4IZ/L8ROpGOiax26e8TH1/dK5BxRHJ4FVhYPQ2ot3H0Ll5st+0xFDX8hVU9QqpeH2Q9Xgv5FQgWBLr NsFr1EG9Gy9a6OZ5JqmG+RAYKiHlyG9JzPtb0EkdY6zBiKUqd0Epbn6YJac2sljdRhL0G51meXW962AM99XBCH8MgwU5F4pKJc4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 68.178.252.104 Subject: [Qemu-devel] [PATCH 01/02] fix issue where a branch to pc+4 confuses GDB because pc and npc are set to the same value 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: , Reply-To: steven.seeger@flightsystems.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From ef3183a1648f45c705b55704de3755f84e9bcf80 Mon Sep 17 00:00:00 2001 From: Steven Seeger Date: Thu, 15 Feb 2018 13:20:04 -0500 Subject: [PATCH 1/2] fix issue where a branch to pc+4 confuses GDB because pc and npc are set to the same value Signed-off-by: Steven Seeger --- target/sparc/translate.c | 6 ++++++ 1 file changed, 6 insertions(+) } @@ -1504,6 +1507,9 @@ static void do_fbranch(DisasContext *dc, int32_t offset, uint32_t insn, int cc) dc->npc = dc->pc + 4; } else { dc->pc = dc->npc; + if (target == dc->pc) { + target += 4; + } dc->npc = target; tcg_gen_mov_tl(cpu_pc, cpu_npc); } diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 71e0853e43..4c2272003d 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1464,6 +1464,9 @@ static void do_branch(DisasContext *dc, int32_t offset, uint32_t insn, int cc) dc->npc = dc->pc + 4; } else { dc->pc = dc->npc; + if (target == dc->pc) { + target += 4; + } dc->npc = target; tcg_gen_mov_tl(cpu_pc, cpu_npc);