From: Ilya Leoshkevich <iii@linux.ibm.com>
To: "Alex Bennée" <alex.bennee@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH 3/3] gdbstub: Protect gdb_handlesig() with EXCLUSIVE_GUARD()
Date: Mon, 13 Jan 2025 14:36:29 +0100 [thread overview]
Message-ID: <20250113134658.68376-4-iii@linux.ibm.com> (raw)
In-Reply-To: <20250113134658.68376-1-iii@linux.ibm.com>
If multiple threads hit a breakpoint at the same time, GDB gets
confused [1]. Prevent this situation by stopping the other threads once
a thread hits a breakpoint.
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=32023
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
gdbstub/user.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdbstub/user.c b/gdbstub/user.c
index 0b4bfa9c488..d72f8ca6106 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -200,6 +200,8 @@ int gdb_handlesig(CPUState *cpu, int sig, const char *reason, void *siginfo,
char buf[256];
int n;
+ EXCLUSIVE_GUARD();
+
if (!gdbserver_state.init || gdbserver_user_state.fd < 0) {
return sig;
}
--
2.47.1
prev parent reply other threads:[~2025-01-13 13:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 13:36 [PATCH 0/3] gdbstub: Protect gdb_handlesig() with EXCLUSIVE_GUARD() Ilya Leoshkevich
2025-01-13 13:36 ` [PATCH 1/3] cpu: Set current_cpu early in qemu-user Ilya Leoshkevich
2025-01-13 13:36 ` [PATCH 2/3] cpu: Introduce EXCLUSIVE_GUARD() Ilya Leoshkevich
2025-01-13 13:36 ` Ilya Leoshkevich [this message]
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=20250113134658.68376-4-iii@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=alex.bennee@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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.