From: Steven Seeger <steven.seeger@flightsystems.net>
To: qemu-devel@nongnu.org
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
Date: Thu, 15 Feb 2018 14:15:43 -0500 [thread overview]
Message-ID: <5193436.NpsRQSl3SI@wirbelwind> (raw)
>From ef3183a1648f45c705b55704de3755f84e9bcf80 Mon Sep 17 00:00:00 2001
From: Steven Seeger <steven.seeger@flightsystems.net>
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 <steven.seeger@flightsystems.net>
---
target/sparc/translate.c | 6 ++++++
1 file changed, 6 insertions(+)
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);
}
@@ -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);
}
--
2.13.6
next reply other threads:[~2018-02-15 19:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 19:15 Steven Seeger [this message]
2018-02-15 19:39 ` [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 Peter Maydell
2018-02-15 21:03 ` Steven Seeger
2018-02-15 21:06 ` Steven Seeger
2018-02-16 3:01 ` Steven Seeger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5193436.NpsRQSl3SI@wirbelwind \
--to=steven.seeger@flightsystems.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.