summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-09-10 21:28:38 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-09-10 21:28:38 +0000
commit1109ed42450bedcc0000994414f741988034540a (patch)
tree55b6495da463f249adeab360ce06bcea9a6a5069 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
parentc435adcde045fc739ea18e798ceb32b552fd6827 (diff)
downloadbcm5719-llvm-1109ed42450bedcc0000994414f741988034540a.tar.gz
bcm5719-llvm-1109ed42450bedcc0000994414f741988034540a.zip
llgs: implement qThreadStopInfo.
This change implements this ticket: http://llvm.org/bugs/show_bug.cgi?id=20899 Adds the qThreadStopInfo RSP command for llgs and includes a test that verifies both debugserver and llgs respond with something reasonable on a multithreaded app. llvm-svn: 217549
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 99e0fc634df..bb3b32d3c10 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -429,6 +429,10 @@ GDBRemoteCommunicationServer::GetPacketAndSendResponse (uint32_t timeout_usec,
case StringExtractorGDBRemote::eServerPacketType_vAttach:
packet_result = Handle_vAttach (packet);
break;
+
+ case StringExtractorGDBRemote::eServerPacketType_qThreadStopInfo:
+ packet_result = Handle_qThreadStopInfo (packet);
+ break;
}
}
else
@@ -2378,8 +2382,6 @@ GDBRemoteCommunicationServer::Handle_vCont_actions (StringExtractorGDBRemote &pa
return SendUnimplementedResponse (packet.GetStringRef().c_str());
}
- // We handle $vCont messages for c.
- // TODO add C, s and S.
StreamString response;
response.Printf("vCont;c;C;s;S");
@@ -4181,6 +4183,26 @@ GDBRemoteCommunicationServer::Handle_vAttach (StringExtractorGDBRemote &packet)
return PacketResult::Success;
}
+GDBRemoteCommunicationServer::PacketResult
+GDBRemoteCommunicationServer::Handle_qThreadStopInfo (StringExtractorGDBRemote &packet)
+{
+ Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_THREAD));
+
+ // We don't support if we're not llgs.
+ if (!IsGdbServer())
+ return SendUnimplementedResponse ("only supported for lldb-gdbserver");
+
+ packet.SetFilePos (strlen("qThreadStopInfo"));
+ const lldb::tid_t tid = packet.GetHexMaxU32 (false, LLDB_INVALID_THREAD_ID);
+ if (tid == LLDB_INVALID_THREAD_ID)
+ {
+ if (log)
+ log->Printf ("GDBRemoteCommunicationServer::%s failed, could not parse thread id from request \"%s\"", __FUNCTION__, packet.GetStringRef ().c_str ());
+ return SendErrorResponse (0x15);
+ }
+ return SendStopReplyPacketForThread (tid);
+}
+
void
GDBRemoteCommunicationServer::FlushInferiorOutput ()
{
OpenPOWER on IntegriCloud