qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gdbstub: Permit reverse step/break to provide stop response
@ 2023-06-23  3:53 Nicholas Piggin
  2023-06-23 12:18 ` Matheus Tavares Bernardino
  2023-06-27 10:33 ` Alex Bennée
  0 siblings, 2 replies; 5+ messages in thread
From: Nicholas Piggin @ 2023-06-23  3:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Nicholas Piggin, qemu-stable, Matheus Tavares Bernardino,
	Alex Bennée, Taylor Simpson

The final part of the reverse step and break handling is to bring
the machine back to a debug stop state. gdb expects a response.

A gdb 'rsi' command hangs forever because the gdbstub filters out
the response (also observable with reverse_debugging.py avocado
tests).

Fix by setting allow_stop_reply for the gdb backward packets.

Fixes: 758370052fb ("gdbstub: only send stop-reply packets when allowed to")
Cc: qemu-stable@nongnu.org
Cc: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 gdbstub/gdbstub.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index be18568d0a..9496d7b175 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -1814,6 +1814,7 @@ static int gdb_handle_packet(const char *line_buf)
                 .handler = handle_backward,
                 .cmd = "b",
                 .cmd_startswith = 1,
+                .allow_stop_reply = true,
                 .schema = "o0"
             };
             cmd_parser = &backward_cmd_desc;
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-28 12:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-23  3:53 [PATCH] gdbstub: Permit reverse step/break to provide stop response Nicholas Piggin
2023-06-23 12:18 ` Matheus Tavares Bernardino
2023-06-27 10:48   ` Peter Maydell
2023-06-28 12:16     ` Matheus Tavares Bernardino
2023-06-27 10:33 ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).