diff options
author | Greg Clayton <gclayton@apple.com> | 2011-01-18 19:36:39 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-01-18 19:36:39 +0000 |
commit | c4e411ffc09a77abe9957f83827fc1745d7e0408 (patch) | |
tree | 78a1107cecd93fdb0cda97b735d5ff23751f2c4a /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 4dc73fa075db86bc6a07d755d972e9f8ad7336cc (diff) | |
download | bcm5719-llvm-c4e411ffc09a77abe9957f83827fc1745d7e0408.tar.gz bcm5719-llvm-c4e411ffc09a77abe9957f83827fc1745d7e0408.zip |
Thread safety changes in debugserver and also in the process GDB remote plugin.
I added support for asking if the GDB remote server supports thread suffixes
for packets that should be thread specific (register read/write packets) because
the way the GDB remote protocol does it right now is to have a notion of a
current thread for register and memory reads/writes (set via the "$Hg%x" packet)
and a current thread for running ("$Hc%x"). Now we ask the remote GDB server
if it supports adding the thread ID to the register packets and we enable
that feature in LLDB if supported. This stops us from having to send a bunch
of packets that update the current thread ID to some value which is prone to
error, or extra packets.
llvm-svn: 123762
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 80580f8dddc..26aa4564281 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -554,6 +554,13 @@ ProcessGDBRemote::ConnectToDebugserver (const char *host_port) if (response.IsOKPacket()) m_gdb_comm.SetAckMode (false); } + + if (m_gdb_comm.SendPacketAndWaitForResponse("QThreadSuffixSupported", response, 1, false)) + { + if (response.IsOKPacket()) + m_gdb_comm.SetThreadSuffixSupported (true); + } + } return error; } @@ -2021,7 +2028,7 @@ ProcessGDBRemote::SetCurrentGDBRemoteThreadForRun (int tid) return true; char packet[32]; - const int packet_len = ::snprintf (packet, sizeof(packet), "Hg%x", tid); + const int packet_len = ::snprintf (packet, sizeof(packet), "Hc%x", tid); assert (packet_len + 1 < sizeof(packet)); StringExtractorGDBRemote response; if (m_gdb_comm.SendPacketAndWaitForResponse(packet, packet_len, response, 2, false)) |