summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-07-14 06:24:44 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-07-14 06:24:44 +0000
commit24189d4c863e72772f08cdedac77f4a7816ee2f3 (patch)
tree692976684b52960001843e78c8dfa6ddae9a8274 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
parent151b44d653e0e90c59fae22831be39925308354e (diff)
downloadbcm5719-llvm-24189d4c863e72772f08cdedac77f4a7816ee2f3.tar.gz
bcm5719-llvm-24189d4c863e72772f08cdedac77f4a7816ee2f3.zip
Modified gdb-remote tests to run with automatically-chosen ports.
Now that llgs supports communicating the 0-port choose-a-port mechanism and can communicate that back to a caller via the --named-pipe option (at parity with debugserver), we use this mechanism to always start llgs and debugserver gdb-remote protocol tests without needing to use some port arbitration mechanism. This eliminates some potential intermittent failures vs. the previous random port and collision-avoidance strategy used. llvm-svn: 212923
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 719ba027519..8cda558fa5a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -36,8 +36,8 @@
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/NativeRegisterContext.h"
-#include "../../../Host/common/NativeProcessProtocol.h"
-#include "../../../Host/common/NativeThreadProtocol.h"
+#include "Host/common/NativeProcessProtocol.h"
+#include "Host/common/NativeThreadProtocol.h"
// Project includes
#include "Utility/StringExtractorGDBRemote.h"
@@ -3041,24 +3041,38 @@ GDBRemoteCommunicationServer::Handle_qfThreadInfo (StringExtractorGDBRemote &pac
if (!IsGdbServer())
return SendUnimplementedResponse("GDBRemoteCommunicationServer::Handle_qfThreadInfo() unimplemented");
+ Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_THREAD));
+
// Fail if we don't have a current process.
if (!m_debugged_process_sp || (m_debugged_process_sp->GetID () == LLDB_INVALID_PROCESS_ID))
- return SendErrorResponse (68);
+ {
+ if (log)
+ log->Printf ("GDBRemoteCommunicationServer::%s() no process (%s), returning OK", __FUNCTION__, m_debugged_process_sp ? "invalid process id" : "null m_debugged_process_sp");
+ return SendOKResponse ();
+ }
StreamGDBRemote response;
response.PutChar ('m');
+ if (log)
+ log->Printf ("GDBRemoteCommunicationServer::%s() starting thread iteration", __FUNCTION__);
+
NativeThreadProtocolSP thread_sp;
uint32_t thread_index;
for (thread_index = 0, thread_sp = m_debugged_process_sp->GetThreadAtIndex (thread_index);
thread_sp;
++thread_index, thread_sp = m_debugged_process_sp->GetThreadAtIndex (thread_index))
{
+ if (log)
+ log->Printf ("GDBRemoteCommunicationServer::%s() iterated thread %" PRIu32 "(%s, tid=0x%" PRIx64 ")", __FUNCTION__, thread_index, thread_sp ? "is not null" : "null", thread_sp ? thread_sp->GetID () : LLDB_INVALID_THREAD_ID);
if (thread_index > 0)
response.PutChar(',');
response.Printf ("%" PRIx64, thread_sp->GetID ());
}
+ if (log)
+ log->Printf ("GDBRemoteCommunicationServer::%s() finished thread iteration", __FUNCTION__);
+
return SendPacketNoLock(response.GetData(), response.GetSize());
}
OpenPOWER on IntegriCloud