[Pdbg] [PATCH 07/14] gdbserver: fix interrupt double response

Nicholas Piggin npiggin at gmail.com
Mon Mar 14 15:17:28 AEDT 2022


Interrupt should not send a TRAP response, that should only be sent
when the thread is stopped, which is what the main loop does after
the interrupt performs the thread stop.

Removing this prevents two TRAP responses being sent to the client
after an interrupt.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 src/pdbgproxy.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c
index 78b1236..ce52e9d 100644
--- a/src/pdbgproxy.c
+++ b/src/pdbgproxy.c
@@ -320,11 +320,8 @@ static void v_contc(uint64_t *stack, void *priv)
 
 static void interrupt(uint64_t *stack, void *priv)
 {
-	PR_INFO("Interrupt\n");
+	PR_INFO("Interrupt from gdb client\n");
 	thread_stop(thread_target);
-	send_response(fd, TRAP);
-
-	return;
 }
 
 static void poll(void)
-- 
2.23.0



More information about the Pdbg mailing list