From 442131c1bec1a2ff0b3a5e5d1d91a116ce869dee Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Fri, 28 Feb 2020 21:33:26 +0000 Subject: gdbserver: Add mechanism to prevent sending T stop packets There is a developer only feature in gdbserver that provides a command line option --disable-packet that prevents some packets from being sent, which is used to increase test coverage within GDB. This commit extends this mechanism to prevent GDBserver from sending the T stop reply packets, instead limiting GDBserver to only send the S stop reply packets. The S stop reply packet is part of the older target control mechanism, which has design flaws that were worked around with the introduction of the newer target control mechanism, which uses the T stop reply packet. Limiting GDBserver to use S stop packets instead of T stop packets will, inevitably, mean that GDBserver doesn't function correctly in many cases involving multiple threads, however, I don't think this is too important, this is a developer only feature, intended to allow us to test GDB. A new test that makes use of this feature will be added in the next commit. gdbserver/ChangeLog: * remote-utils.cc (prepare_resume_reply): Add ability to convert T reply into an S reply. * server.cc (disable_packet_T): New global. (captured_main): Set new global when appropriate. * server.h (disable_packet_T): Declare. --- gdbserver/server.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdbserver/server.cc') diff --git a/gdbserver/server.cc b/gdbserver/server.cc index a4cb1eb..43962ad 100644 --- a/gdbserver/server.cc +++ b/gdbserver/server.cc @@ -130,6 +130,7 @@ bool disable_packet_vCont; bool disable_packet_Tthread; bool disable_packet_qC; bool disable_packet_qfThreadInfo; +bool disable_packet_T; static unsigned char *mem_buf; @@ -3649,6 +3650,8 @@ captured_main (int argc, char *argv[]) disable_packet_qC = true; else if (strcmp ("qfThreadInfo", tok) == 0) disable_packet_qfThreadInfo = true; + else if (strcmp ("T", tok) == 0) + disable_packet_T = true; else if (strcmp ("threads", tok) == 0) { disable_packet_vCont = true; -- cgit v1.1