[Lldb-commits] [lldb] r154412 - in /lldb/branches/lldb-platform-work: ./ examples/synthetic/ include/lldb/Target/ source/Plugins/OperatingSystem/Darwin-Kernel/ source/Plugins/Process/MacOSX-Kernel/ source/Plugins/Process/gdb-remote/ source/Plugins/Process/mach-core/ source/Target/ tools/debugserver/source/

Johnny Chen johnny.chen at apple.com
Tue Apr 10 10:55:52 PDT 2012


Author: johnny
Date: Tue Apr 10 12:55:52 2012
New Revision: 154412

URL: http://llvm.org/viewvc/llvm-project?rev=154412&view=rev
Log:
Merge changes from ToT:

svn merge -r 154255:154380 https://johnny@llvm.org/svn/llvm-project/lldb/trunk .

Modified:
    lldb/branches/lldb-platform-work/   (props changed)
    lldb/branches/lldb-platform-work/examples/synthetic/gnu_libstdcpp.py
    lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h
    lldb/branches/lldb-platform-work/include/lldb/Target/Process.h
    lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp
    lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h
    lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h
    lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
    lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.h
    lldb/branches/lldb-platform-work/source/Target/Process.cpp
    lldb/branches/lldb-platform-work/source/Target/Thread.cpp
    lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp
    lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h

Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 10 12:55:52 2012
@@ -1 +1 @@
-/lldb/trunk:154224-154354
+/lldb/trunk:154224-154380

Modified: lldb/branches/lldb-platform-work/examples/synthetic/gnu_libstdcpp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/synthetic/gnu_libstdcpp.py?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/synthetic/gnu_libstdcpp.py (original)
+++ lldb/branches/lldb-platform-work/examples/synthetic/gnu_libstdcpp.py Tue Apr 10 12:55:52 2012
@@ -12,6 +12,8 @@
 	def __init__(self, valobj, dict):
 		logger = Logger.Logger()
 		self.valobj = valobj
+		self.count = None
+		logger >> "Providing synthetic children for a map named " + str(valobj.GetName())
 
 	def next_node(self,node):
 		logger = Logger.Logger()
@@ -134,7 +136,9 @@
 
 	def __init__(self, valobj, dict):
 		logger = Logger.Logger()
-		self.valobj = valobj;
+		self.count = None
+		self.valobj = valobj
+		logger >> "Providing synthetic children for a map named " + str(valobj.GetName())
 
 	def num_children(self):
 		logger = Logger.Logger()
@@ -228,6 +232,7 @@
 	def __init__(self, valobj, dict):
 		logger = Logger.Logger()
 		self.valobj = valobj;
+		self.count = None
 		logger >> "Providing synthetic children for a map named " + str(valobj.GetName())
 		
 	# we need this function as a temporary workaround for rdar://problem/10801549

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h Tue Apr 10 12:55:52 2012
@@ -64,7 +64,7 @@
     //------------------------------------------------------------------
     // Plug-in Methods
     //------------------------------------------------------------------
-    virtual uint32_t
+    virtual bool
     UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list) = 0;
     
     virtual void

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Process.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Process.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Process.h Tue Apr 10 12:55:52 2012
@@ -2937,7 +2937,7 @@
     //------------------------------------------------------------------
     // Thread Queries
     //------------------------------------------------------------------
-    virtual uint32_t
+    virtual bool
     UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list) = 0;
 
     void

Modified: lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp Tue Apr 10 12:55:52 2012
@@ -223,7 +223,7 @@
     return 1;
 }
 
-uint32_t
+bool
 OperatingSystemDarwinKernel::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
     // Make any constant strings once and cache the uniqued C string values
@@ -263,7 +263,7 @@
         }
         next_valobj_sp.swap(valobj_sp);
     }
-    return new_thread_list.GetSize(false);
+    return new_thread_list.GetSize(false) > 0;
 }
 
 void

Modified: lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.h Tue Apr 10 12:55:52 2012
@@ -61,7 +61,7 @@
     //------------------------------------------------------------------
     // lldb_private::OperatingSystem Methods
     //------------------------------------------------------------------
-    virtual uint32_t
+    virtual bool
     UpdateThreadList (lldb_private::ThreadList &old_thread_list, 
                       lldb_private::ThreadList &new_thread_list);
     

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Tue Apr 10 12:55:52 2012
@@ -151,7 +151,7 @@
 }
 
 bool
-CommunicationKDP::GetSequenceMutex (Mutex::Locker& locker)
+CommunicationKDP::TryLockSequenceMutex (Mutex::Locker& locker)
 {
     return locker.TryLock (m_sequence_mutex.GetMutex());
 }

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h Tue Apr 10 12:55:52 2012
@@ -102,7 +102,7 @@
                                           uint32_t usec);
 
     bool
-    GetSequenceMutex(lldb_private::Mutex::Locker& locker);
+    TryLockSequenceMutex(lldb_private::Mutex::Locker& locker);
 
     bool
     CheckForPacket (const uint8_t *src, 

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp Tue Apr 10 12:55:52 2012
@@ -301,7 +301,7 @@
     return error;
 }
 
-uint32_t
+bool
 ProcessKDP::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
     // locker will keep a mutex locked until it goes out of scope
@@ -323,7 +323,7 @@
             thread_sp.reset(new ThreadKDP (shared_from_this(), tid));
         new_thread_list.AddThread(thread_sp);
     }
-    return new_thread_list.GetSize(false);
+    return new_thread_list.GetSize(false) > 0;
 }
 
 

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h Tue Apr 10 12:55:52 2012
@@ -231,7 +231,7 @@
     void
     Clear ( );
     
-    uint32_t
+    virtual bool
     UpdateThreadList (lldb_private::ThreadList &old_thread_list, 
                       lldb_private::ThreadList &new_thread_list);
     

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue Apr 10 12:55:52 2012
@@ -205,10 +205,7 @@
             // logs all of the packet will set a boolean so that we don't dump this more
             // than once
             if (!m_history.DidDumpToLog ())
-            {
-                DumpHistory("/tmp/foo.txt");
                 m_history.Dump (log.get());
-            }
 
             log->Printf ("<%4zu> send packet: %.*s", bytes_written, (int)packet.GetSize(), packet.GetData());
         }
@@ -247,7 +244,7 @@
 }
 
 bool
-GDBRemoteCommunication::GetSequenceMutex (Mutex::Locker& locker)
+GDBRemoteCommunication::TryLockSequenceMutex (Mutex::Locker& locker)
 {
     return locker.TryLock (m_sequence_mutex.GetMutex());
 }

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h Tue Apr 10 12:55:52 2012
@@ -74,7 +74,7 @@
                         size_t payload_length);
 
     bool
-    GetSequenceMutex(lldb_private::Mutex::Locker& locker);
+    TryLockSequenceMutex(lldb_private::Mutex::Locker& locker);
 
     bool
     CheckForPacket (const uint8_t *src, 

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Tue Apr 10 12:55:52 2012
@@ -39,6 +39,7 @@
     GDBRemoteCommunication("gdb-remote.client", "gdb-remote.client.rx_packet", is_platform),
     m_supports_not_sending_acks (eLazyBoolCalculate),
     m_supports_thread_suffix (eLazyBoolCalculate),
+    m_supports_threads_in_stop_reply (eLazyBoolCalculate),
     m_supports_vCont_all (eLazyBoolCalculate),
     m_supports_vCont_any (eLazyBoolCalculate),
     m_supports_vCont_c (eLazyBoolCalculate),
@@ -115,10 +116,28 @@
 }
 
 void
+GDBRemoteCommunicationClient::GetListThreadsInStopReplySupported ()
+{
+    if (m_supports_threads_in_stop_reply == eLazyBoolCalculate)
+    {
+        m_supports_threads_in_stop_reply = eLazyBoolNo;
+        
+        StringExtractorGDBRemote response;
+        if (SendPacketAndWaitForResponse("QListThreadsInStopReply", response, false))
+        {
+            if (response.IsOKResponse())
+                m_supports_threads_in_stop_reply = eLazyBoolYes;
+        }
+    }
+}
+
+
+void
 GDBRemoteCommunicationClient::ResetDiscoverableSettings()
 {
     m_supports_not_sending_acks = eLazyBoolCalculate;
     m_supports_thread_suffix = eLazyBoolCalculate;
+    m_supports_threads_in_stop_reply = eLazyBoolCalculate;
     m_supports_vCont_c = eLazyBoolCalculate;
     m_supports_vCont_C = eLazyBoolCalculate;
     m_supports_vCont_s = eLazyBoolCalculate;
@@ -241,7 +260,7 @@
     Mutex::Locker locker;
     LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
     size_t response_len = 0;
-    if (GetSequenceMutex (locker))
+    if (TryLockSequenceMutex (locker))
     {
         if (SendPacketNoLock (payload, payload_length))
            response_len = WaitForPacketWithTimeoutMicroSecondsNoLock (response, GetPacketTimeoutInMicroSeconds ());
@@ -629,7 +648,7 @@
     return false;
 }
 
-// This function takes a mutex locker as a parameter in case the GetSequenceMutex
+// This function takes a mutex locker as a parameter in case the TryLockSequenceMutex
 // actually succeeds. If it doesn't succeed in acquiring the sequence mutex 
 // (the expected result), then it will send the halt packet. If it does succeed
 // then the caller that requested the interrupt will want to keep the sequence
@@ -654,7 +673,7 @@
     if (IsRunning())
     {
         // Only send an interrupt if our debugserver is running...
-        if (GetSequenceMutex (locker) == false)
+        if (TryLockSequenceMutex (locker) == false)
         {
             // Someone has the mutex locked waiting for a response or for the
             // inferior to stop, so send the interrupt on the down low...
@@ -1843,7 +1862,7 @@
     Mutex::Locker locker;
     thread_ids.clear();
     
-    if (GetSequenceMutex (locker))
+    if (TryLockSequenceMutex (locker))
     {
         sequence_mutex_unavailable = false;
         StringExtractorGDBRemote response;

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Tue Apr 10 12:55:52 2012
@@ -71,6 +71,9 @@
     void
     QueryNoAckModeSupported ();
 
+    void
+    GetListThreadsInStopReplySupported ();
+
     bool
     SendAsyncSignal (int signo);
 
@@ -359,6 +362,7 @@
     //------------------------------------------------------------------
     lldb_private::LazyBool m_supports_not_sending_acks;
     lldb_private::LazyBool m_supports_thread_suffix;
+    lldb_private::LazyBool m_supports_threads_in_stop_reply;
     lldb_private::LazyBool m_supports_vCont_all;
     lldb_private::LazyBool m_supports_vCont_any;
     lldb_private::LazyBool m_supports_vCont_c;

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue Apr 10 12:55:52 2012
@@ -181,7 +181,7 @@
     if (!m_reg_valid[reg])
     {
         Mutex::Locker locker;
-        if (gdb_comm.GetSequenceMutex (locker))
+        if (gdb_comm.TryLockSequenceMutex (locker))
         {
             const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
             ProcessSP process_sp (m_thread.GetProcess());
@@ -331,7 +331,7 @@
                                   m_reg_data.GetByteOrder()))   // dst byte order
     {
         Mutex::Locker locker;
-        if (gdb_comm.GetSequenceMutex (locker))
+        if (gdb_comm.TryLockSequenceMutex (locker))
         {
             const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
             ProcessSP process_sp (m_thread.GetProcess());
@@ -440,7 +440,7 @@
     StringExtractorGDBRemote response;
 
     Mutex::Locker locker;
-    if (gdb_comm.GetSequenceMutex (locker))
+    if (gdb_comm.TryLockSequenceMutex (locker))
     {
         char packet[32];
         const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
@@ -496,7 +496,7 @@
 
     StringExtractorGDBRemote response;
     Mutex::Locker locker;
-    if (gdb_comm.GetSequenceMutex (locker))
+    if (gdb_comm.TryLockSequenceMutex (locker))
     {
         const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
         ProcessSP process_sp (m_thread.GetProcess());

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Apr 10 12:55:52 2012
@@ -162,6 +162,8 @@
     m_register_info (),
     m_async_broadcaster (NULL, "lldb.process.gdb-remote.async-broadcaster"),
     m_async_thread (LLDB_INVALID_HOST_THREAD),
+    m_thread_ids (),
+    m_thread_ids_mutex (Mutex::eMutexTypeRecursive),
     m_continue_c_tids (),
     m_continue_C_tids (),
     m_continue_s_tids (),
@@ -702,6 +704,7 @@
     m_gdb_comm.ResetDiscoverableSettings();
     m_gdb_comm.QueryNoAckModeSupported ();
     m_gdb_comm.GetThreadSuffixSupported ();
+    m_gdb_comm.GetListThreadsInStopReplySupported ();
     m_gdb_comm.GetHostInfo ();
     m_gdb_comm.GetVContSupported ('c');
     return error;
@@ -1129,7 +1132,30 @@
     return error;
 }
 
-uint32_t
+void
+ProcessGDBRemote::ClearThreadIDList ()
+{
+    Mutex::Locker locker(m_thread_ids_mutex);
+    m_thread_ids.clear();
+}
+
+bool
+ProcessGDBRemote::UpdateThreadIDList ()
+{
+    Mutex::Locker locker(m_thread_ids_mutex);
+    bool sequence_mutex_unavailable = false;
+    m_gdb_comm.GetCurrentThreadIDs (m_thread_ids, sequence_mutex_unavailable);
+    if (sequence_mutex_unavailable)
+    {
+#if defined (LLDB_CONFIGURATION_DEBUG)
+        assert(!"ProcessGDBRemote::UpdateThreadList() failed due to not getting the sequence mutex");
+#endif
+        return false; // We just didn't get the list
+    }
+    return true;
+}
+
+bool
 ProcessGDBRemote::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
     // locker will keep a mutex locked until it goes out of scope
@@ -1137,15 +1163,23 @@
     if (log && log->GetMask().Test(GDBR_LOG_VERBOSE))
         log->Printf ("ProcessGDBRemote::%s (pid = %llu)", __FUNCTION__, GetID());
     // Update the thread list's stop id immediately so we don't recurse into this function.
+    Mutex::Locker locker(m_thread_ids_mutex);
+    
+    size_t num_thread_ids = m_thread_ids.size();
+    // The "m_thread_ids" thread ID list should always be updated after each stop
+    // reply packet, but in case it isn't, update it here.
+    if (num_thread_ids == 0)
+    {
+        if (!UpdateThreadIDList ())
+            return false;
+        num_thread_ids = m_thread_ids.size();
+    }
 
-    std::vector<lldb::tid_t> thread_ids;
-    bool sequence_mutex_unavailable = false;
-    const size_t num_thread_ids = m_gdb_comm.GetCurrentThreadIDs (thread_ids, sequence_mutex_unavailable);
     if (num_thread_ids > 0)
     {
         for (size_t i=0; i<num_thread_ids; ++i)
         {
-            tid_t tid = thread_ids[i];
+            tid_t tid = m_thread_ids[i];
             ThreadSP thread_sp (old_thread_list.FindThreadByID (tid, false));
             if (!thread_sp)
                 thread_sp.reset (new ThreadGDBRemote (shared_from_this(), tid));
@@ -1153,9 +1187,7 @@
         }
     }
 
-    if (sequence_mutex_unavailable == false)
-        SetThreadStopInfo (m_last_stop_packet);
-    return new_thread_list.GetSize(false);
+    return true;
 }
 
 
@@ -1190,7 +1222,6 @@
             std::string description;
             uint32_t exc_type = 0;
             std::vector<addr_t> exc_data;
-            uint32_t tid = LLDB_INVALID_THREAD_ID;
             addr_t thread_dispatch_qaddr = LLDB_INVALID_ADDRESS;
             uint32_t exc_data_count = 0;
             ThreadSP thread_sp;
@@ -1215,7 +1246,7 @@
                 else if (name.compare("thread") == 0)
                 {
                     // thread in big endian hex
-                    tid = Args::StringToUInt32 (value.c_str(), 0, 16);
+                    lldb::tid_t tid = Args::StringToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16);
                     // m_thread_list does have its own mutex, but we need to
                     // hold onto the mutex between the call to m_thread_list.FindThreadByID(...)
                     // and the m_thread_list.AddThread(...) so it doesn't change on us
@@ -1228,6 +1259,29 @@
                         m_thread_list.AddThread(thread_sp);
                     }
                 }
+                else if (name.compare("threads") == 0)
+                {
+                    Mutex::Locker locker(m_thread_ids_mutex);                    
+                    m_thread_ids.clear();
+                    // A comma separated list of all threads in the current
+                    // process that includes the thread for this stop reply
+                    // packet
+                    size_t comma_pos;
+                    lldb::tid_t tid;
+                    while ((comma_pos = value.find(',')) != std::string::npos)
+                    {
+                        value[comma_pos] = '\0';
+                        // thread in big endian hex
+                        tid = Args::StringToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16);
+                        if (tid != LLDB_INVALID_THREAD_ID)
+                            m_thread_ids.push_back (tid);
+                        value.erase(0, comma_pos + 1);
+                            
+                    }
+                    tid = Args::StringToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16);
+                    if (tid != LLDB_INVALID_THREAD_ID)
+                        m_thread_ids.push_back (tid);
+                }
                 else if (name.compare("hexname") == 0)
                 {
                     StringExtractor name_extractor;
@@ -1418,10 +1472,23 @@
 void
 ProcessGDBRemote::RefreshStateAfterStop ()
 {
+    Mutex::Locker locker(m_thread_ids_mutex);
+    m_thread_ids.clear();
+    // Set the thread stop info. It might have a "threads" key whose value is
+    // a list of all thread IDs in the current process, so m_thread_ids might
+    // get set.
+    SetThreadStopInfo (m_last_stop_packet);
+    // Check to see if SetThreadStopInfo() filled in m_thread_ids?
+    if (m_thread_ids.empty())
+    {
+        // No, we need to fetch the thread list manually
+        UpdateThreadIDList();
+    }
+
     // Let all threads recover from stopping and do any clean up based
     // on the previous thread state (if any).
     m_thread_list.RefreshStateAfterStop();
-    SetThreadStopInfo (m_last_stop_packet);
+    
 }
 
 Error
@@ -1595,6 +1662,7 @@
                 if (packet_cmd == 'W' || packet_cmd == 'X')
                 {
                     SetLastStopPacket (response);
+                    ClearThreadIDList ();
                     SetExitStatus(response.GetHexU8(), NULL);
                 }
             }
@@ -2413,6 +2481,7 @@
 
                                     case eStateExited:
                                         process->SetLastStopPacket (response);
+                                        process->ClearThreadIDList();
                                         response.SetFilePos(1);
                                         process->SetExitStatus(response.GetHexU8(), NULL);
                                         done = true;

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Tue Apr 10 12:55:52 2012
@@ -265,7 +265,7 @@
         return m_flags;
     }
 
-    uint32_t
+    virtual bool
     UpdateThreadList (lldb_private::ThreadList &old_thread_list, 
                       lldb_private::ThreadList &new_thread_list);
 
@@ -307,6 +307,8 @@
     typedef std::vector<lldb::tid_t> tid_collection;
     typedef std::vector< std::pair<lldb::tid_t,int> > tid_sig_collection;
     typedef std::map<lldb::addr_t, lldb::addr_t> MMapMap;
+    tid_collection m_thread_ids; // Thread IDs for all threads. This list gets updated after stopping
+    lldb_private::Mutex m_thread_ids_mutex;
     tid_collection m_continue_c_tids;                  // 'c' for continue
     tid_sig_collection m_continue_C_tids; // 'C' for continue with signal
     tid_collection m_continue_s_tids;                  // 's' for step
@@ -336,6 +338,12 @@
     SetThreadStopInfo (StringExtractor& stop_packet);
 
     void
+    ClearThreadIDList ();
+
+    bool
+    UpdateThreadIDList ();
+
+    void
     DidLaunchOrAttach ();
 
     lldb_private::Error

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.cpp Tue Apr 10 12:55:52 2012
@@ -337,7 +337,7 @@
     return m_dyld_ap.get();
 }
 
-uint32_t
+bool
 ProcessMachCore::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
     if (old_thread_list.GetSize(false) == 0)
@@ -362,7 +362,7 @@
         for (uint32_t i=0; i<num_threads; ++i)
             new_thread_list.AddThread (old_thread_list.GetThreadAtIndex (i));
     }
-    return new_thread_list.GetSize(false);
+    return new_thread_list.GetSize(false) > 0;
 }
 
 void

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/mach-core/ProcessMachCore.h Tue Apr 10 12:55:52 2012
@@ -116,7 +116,7 @@
     void
     Clear ( );
     
-    uint32_t
+    virtual bool
     UpdateThreadList (lldb_private::ThreadList &old_thread_list, 
                       lldb_private::ThreadList &new_thread_list);
     

Modified: lldb/branches/lldb-platform-work/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Process.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Process.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Process.cpp Tue Apr 10 12:55:52 2012
@@ -36,6 +36,7 @@
 #include "lldb/Target/TargetList.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadPlan.h"
+#include "lldb/Target/ThreadPlanBase.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -1236,13 +1237,15 @@
             // and the os->UpdateThreadList(...) so it doesn't change on us
             ThreadList new_thread_list(this);
             // Always update the thread list with the protocol specific
-            // thread list
-            UpdateThreadList (m_thread_list, new_thread_list);
-            OperatingSystem *os = GetOperatingSystem ();
-            if (os)
-                os->UpdateThreadList (m_thread_list, new_thread_list);
-            m_thread_list.Update (new_thread_list);
-            m_thread_list.SetStopID (stop_id);
+            // thread list, but only update if "true" is returned
+            if (UpdateThreadList (m_thread_list, new_thread_list))
+            {
+                OperatingSystem *os = GetOperatingSystem ();
+                if (os)
+                    os->UpdateThreadList (m_thread_list, new_thread_list);
+                m_thread_list.Update (new_thread_list);
+                m_thread_list.SetStopID (stop_id);
+            }
         }
     }
 }
@@ -3100,8 +3103,17 @@
         snprintf(thread_name, sizeof(thread_name), "<lldb.process.internal-state-override(pid=%llu)>", GetID());
     else
         snprintf(thread_name, sizeof(thread_name), "<lldb.process.internal-state(pid=%llu)>", GetID());
+        
+    // Create the private state thread, and start it running.
     m_private_state_thread = Host::ThreadCreate (thread_name, Process::PrivateStateThread, this, NULL);
-    return IS_VALID_LLDB_HOST_THREAD(m_private_state_thread);
+    bool success = IS_VALID_LLDB_HOST_THREAD(m_private_state_thread);
+    if (success)
+    {
+        ResumePrivateStateThread();
+        return true;
+    }
+    else
+        return false;
 }
 
 void
@@ -3245,8 +3257,8 @@
 void *
 Process::RunPrivateStateThread ()
 {
-    bool control_only = false;
-    m_private_state_control_wait.SetValue (false, eBroadcastNever);
+    bool control_only = true;
+    m_private_state_control_wait.SetValue (true, eBroadcastNever);
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
@@ -3908,15 +3920,35 @@
     }
 
     lldb::thread_t backup_private_state_thread = LLDB_INVALID_HOST_THREAD;
+    lldb::StateType old_state;
+    lldb::ThreadPlanSP stopper_base_plan_sp;
     
+    lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP | LIBLLDB_LOG_PROCESS));
     if (Host::GetCurrentThread() == m_private_state_thread)
     {
-        // Yikes, we are running on the private state thread!  So we can't call DoRunThreadPlan on this thread, since
-        // then nobody will be around to fetch internal events.
+        // Yikes, we are running on the private state thread!  So we can't wait for public events on this thread, since
+        // we are the thread that is generating public events.
         // The simplest thing to do is to spin up a temporary thread to handle private state thread events while
-        // we are doing the RunThreadPlan here.
+        // we are fielding public events here.
+        if (log)
+			log->Printf ("Running thread plan on private state thread, spinning up another state thread to handle the events.");
+            
+
         backup_private_state_thread = m_private_state_thread;
-        printf ("Running thread plan on private state thread, spinning up another state thread to handle the events.\n");
+
+        // One other bit of business: we want to run just this thread plan and anything it pushes, and then stop,
+        // returning control here.
+        // But in the normal course of things, the plan above us on the stack would be given a shot at the stop
+        // event before deciding to stop, and we don't want that.  So we insert a "stopper" base plan on the stack
+        // before the plan we want to run.  Since base plans always stop and return control to the user, that will
+        // do just what we want.
+        stopper_base_plan_sp.reset(new ThreadPlanBase (*thread));
+        thread->QueueThreadPlan (stopper_base_plan_sp, false);
+        // Have to make sure our public state is stopped, since otherwise the reporting logic below doesn't work correctly.
+        old_state = m_public_state.GetValue();
+        m_public_state.SetValueNoLock(eStateStopped);
+        
+        // Now spin up the private state thread:
         StartPrivateStateThread(true);
     }
     
@@ -3929,7 +3961,6 @@
     
     ProcessEventHijacker run_thread_plan_hijacker (*this, &listener);
         
-    lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP | LIBLLDB_LOG_PROCESS));
     if (log)
     {
         StreamString s;
@@ -3973,7 +4004,7 @@
             timeout_ptr = &real_timeout;
             
             got_event = listener.WaitForEvent(timeout_ptr, event_sp);
-            if (!got_event) 
+            if (!got_event)
             {
                 if (log)
                     log->PutCString("Didn't get any event after initial resume, exiting.");
@@ -4281,10 +4312,14 @@
     if (IS_VALID_LLDB_HOST_THREAD(backup_private_state_thread))
     {
         StopPrivateStateThread();
-        lldb::thread_result_t thread_result;
         Error error;
-        // Host::ThreadJoin(m_private_state_thread, &thread_result, &error);
         m_private_state_thread = backup_private_state_thread;
+        if (stopper_base_plan_sp != NULL)
+        {
+            thread->DiscardThreadPlansUpToPlan(stopper_base_plan_sp);
+        }
+        m_public_state.SetValueNoLock(old_state);
+
     }
     
     

Modified: lldb/branches/lldb-platform-work/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Thread.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Thread.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Thread.cpp Tue Apr 10 12:55:52 2012
@@ -89,6 +89,7 @@
     m_plan_stack.clear();
     m_discarded_plan_stack.clear();
     m_completed_plan_stack.clear();
+    m_actual_stop_info_sp.reset();
     m_destroy_called = true;
 }
 

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp Tue Apr 10 12:55:52 2012
@@ -76,8 +76,9 @@
     m_max_payload_size(DEFAULT_GDB_REMOTE_PROTOCOL_BUFSIZE - 4),
     m_extended_mode(false),
     m_noack_mode(false),
+    m_use_native_regs (false),
     m_thread_suffix_supported (false),
-    m_use_native_regs (false)
+    m_list_threads_in_stop_reply (false)
 {
     DNBLogThreadedIf (LOG_RNB_REMOTE, "%s", __PRETTY_FUNCTION__);
     CreatePacketTable ();
@@ -183,6 +184,7 @@
     t.push_back (Packet (set_stdout,                    &RNBRemote::HandlePacket_QSetSTDIO              , NULL, "QSetSTDOUT:", "Set the standard output for a process to be launched with the 'A' packet"));
     t.push_back (Packet (set_stderr,                    &RNBRemote::HandlePacket_QSetSTDIO              , NULL, "QSetSTDERR:", "Set the standard error for a process to be launched with the 'A' packet"));
     t.push_back (Packet (set_working_dir,               &RNBRemote::HandlePacket_QSetWorkingDir         , NULL, "QSetWorkingDir:", "Set the working directory for a process to be launched with the 'A' packet"));
+    t.push_back (Packet (set_list_threads_in_stop_reply,&RNBRemote::HandlePacket_QListThreadsInStopReply , NULL, "QListThreadsInStopReply", "Set if the 'threads' key should be added to the stop reply packets with a list of all thread IDs."));
 //  t.push_back (Packet (pass_signals_to_inferior,      &RNBRemote::HandlePacket_UNIMPLEMENTED, NULL, "QPassSignals:", "Specify which signals are passed to the inferior"));
     t.push_back (Packet (allocate_memory,               &RNBRemote::HandlePacket_AllocateMemory, NULL, "_M", "Allocate memory in the inferior process."));
     t.push_back (Packet (deallocate_memory,             &RNBRemote::HandlePacket_DeallocateMemory, NULL, "_m", "Deallocate memory in the inferior process."));
@@ -1128,12 +1130,12 @@
 }
 
 
-/* `A arglen,argnum,arg,...'
+/* 'A arglen,argnum,arg,...'
  Update the inferior context CTX with the program name and arg
  list.
  The documentation for this packet is underwhelming but my best reading
  of this is that it is a series of (len, position #, arg)'s, one for
- each argument with "arg" ``hex encoded'' (two 0-9a-f chars?).
+ each argument with "arg" hex encoded (two 0-9a-f chars?).
  Why we need BOTH a "len" and a hex encoded "arg" is beyond me - either
  is sufficient to get around the "," position separator escape issue.
 
@@ -1223,7 +1225,7 @@
     return rnb_success;
 }
 
-/* `H c t'
+/* 'H c t'
  Set the thread for subsequent actions; 'c' for step/continue ops,
  'g' for other ops.  -1 means all threads, 0 means any thread.  */
 
@@ -1868,6 +1870,28 @@
     return SendPacket ("E60"); // Already had a process, too late to set working dir
 }
 
+rnb_err_t
+RNBRemote::HandlePacket_QListThreadsInStopReply (const char *p)
+{
+    // If this packet is received, it allows us to send an extra key/value
+    // pair in the stop reply packets where we will list all of the thread IDs
+    // separated by commas:
+    //
+    //  "threads:10a,10b,10c;"
+    //
+    // This will get included in the stop reply packet as something like:
+    //
+    //  "T11thread:10a;00:00000000;01:00010203:threads:10a,10b,10c;"
+    //
+    // This can save two packets on each stop: qfThreadInfo/qsThreadInfo and
+    // speed things up a bit.
+    //
+    // Send the OK packet first so the correct checksum is appended...
+    rnb_err_t result = SendPacket ("OK");
+    m_list_threads_in_stop_reply = true;
+    return result;
+}
+
 
 rnb_err_t
 RNBRemote::HandlePacket_QSetMaxPayloadSize (const char *p)
@@ -2118,6 +2142,33 @@
             if (thread_ident_info.dispatch_qaddr != 0)
                 ostrm << std::hex << "qaddr:" << thread_ident_info.dispatch_qaddr << ';';
         }
+        
+        // If a 'QListThreadsInStopReply' was sent to enable this feature, we
+        // will send all thread IDs back in the "threads" key whose value is
+        // a listc of hex thread IDs separated by commas:
+        //  "threads:10a,10b,10c;"
+        // This will save the debugger from having to send a pair of qfThreadInfo
+        // and qsThreadInfo packets, but it also might take a lot of room in the
+        // stop reply packet, so it must be enabled only on systems where there
+        // are no limits on packet lengths.
+        
+        if (m_list_threads_in_stop_reply)
+        {
+            const nub_size_t numthreads = DNBProcessGetNumThreads (pid);
+            if (numthreads > 0)
+            {
+                ostrm << std::hex << "threads:";
+                for (nub_size_t i = 0; i < numthreads; ++i)
+                {
+                    nub_thread_t th = DNBProcessGetThreadAtIndex (pid, i);
+                    if (i > 0)
+                        ostrm << ',';
+                    ostrm << std::hex << th;
+                }
+                ostrm << ';';
+            }
+        }
+
         if (g_num_reg_entries == 0)
             InitializeRegisters ();
 
@@ -2145,7 +2196,7 @@
     return SendPacket("E51");
 }
 
-/* `?'
+/* '?'
  The stop reply packet - tell gdb what the status of the inferior is.
  Often called the questionmark_packet.  */
 
@@ -2401,7 +2452,7 @@
     return SendPacket ("OK");
 }
 
-/* `g' -- read registers
+/* 'g' -- read registers
  Get the contents of the registers for the current thread,
  send them to gdb.
  Should the setting of the Hg packet determine which thread's registers
@@ -2449,7 +2500,7 @@
     return SendPacket (ostrm.str ());
 }
 
-/* `G XXX...' -- write registers
+/* 'G XXX...' -- write registers
  How is the thread for these specified, beyond "the current thread"?
  Does gdb actually use the Hg packet to set this?  */
 
@@ -2809,7 +2860,7 @@
     return HandlePacket_UNIMPLEMENTED(p);
 }
 
-/* `T XX' -- status of thread
+/* 'T XX' -- status of thread
  Check if the specified thread is alive.
  The thread number is in hex?  */
 
@@ -3082,7 +3133,7 @@
 
 }
 
-/* `p XX'
+/* 'p XX'
  print the contents of register X */
 
 rnb_err_t
@@ -3147,7 +3198,7 @@
     return SendPacket (ostrm.str());
 }
 
-/* `Pnn=rrrrr'
+/* 'Pnn=rrrrr'
  Set register number n to value r.
  n and r are hex strings.  */
 
@@ -3212,7 +3263,7 @@
     return SendPacket ("OK");
 }
 
-/* `c [addr]'
+/* 'c [addr]'
  Continue, optionally from a specified address. */
 
 rnb_err_t
@@ -3311,7 +3362,7 @@
 }
 
 
-/* `C sig [;addr]'
+/* 'C sig [;addr]'
  Resume with signal sig, optionally at address addr.  */
 
 rnb_err_t
@@ -3365,7 +3416,7 @@
     return rnb_success;
 }
 
-/* `k'
+/* 'k'
  Kill the inferior process.  */
 
 rnb_err_t
@@ -3387,7 +3438,7 @@
     return rnb_success;
 }
 
-/* `s'
+/* 's'
  Step the inferior process.  */
 
 rnb_err_t
@@ -3416,7 +3467,7 @@
     return rnb_success;
 }
 
-/* `S sig [;addr]'
+/* 'S sig [;addr]'
  Step with signal sig, optionally at address addr.  */
 
 rnb_err_t

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h?rev=154412&r1=154411&r2=154412&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h Tue Apr 10 12:55:52 2012
@@ -106,6 +106,7 @@
         set_stdout,                     // 'QSetSTDOUT:'
         set_stderr,                     // 'QSetSTDERR:'
         set_working_dir,                // 'QSetWorkingDir:'
+        set_list_threads_in_stop_reply, // 'QListThreadsInStopReply:'
         memory_region_info,             // 'qMemoryRegionInfo:'
         allocate_memory,                // '_M'
         deallocate_memory,              // '_m'
@@ -177,6 +178,7 @@
     rnb_err_t HandlePacket_QEnvironment (const char *p);
     rnb_err_t HandlePacket_QEnvironmentHexEncoded (const char *p);
     rnb_err_t HandlePacket_QLaunchArch (const char *p);
+    rnb_err_t HandlePacket_QListThreadsInStopReply (const char *p);
     rnb_err_t HandlePacket_QPrefixRegisterPacketsWithThreadID (const char *p);
     rnb_err_t HandlePacket_last_signal (const char *p);
     rnb_err_t HandlePacket_m (const char *p);
@@ -328,15 +330,15 @@
     BreakpointMap   m_breakpoints;
     BreakpointMap   m_watchpoints;
     uint32_t        m_max_payload_size;  // the maximum sized payload we should send to gdb
-    bool            m_extended_mode:1,   // are we in extended mode?
-                    m_noack_mode:1,      // are we in no-ack mode?
-                    m_noack_mode_just_enabled:1, // Did we just enable this and need to compute one more checksum?
-                    m_use_native_regs:1, // Use native registers by querying DNB layer for register definitions?
-                    m_thread_suffix_supported:1; // Set to true if the 'p', 'P', 'g', and 'G' packets should be prefixed with the thread ID and colon:
+    bool            m_extended_mode;   // are we in extended mode?
+    bool            m_noack_mode;      // are we in no-ack mode?
+    bool            m_use_native_regs; // Use native registers by querying DNB layer for register definitions?
+    bool            m_thread_suffix_supported; // Set to true if the 'p', 'P', 'g', and 'G' packets should be prefixed with the thread ID and colon:
                                                                 // "$pRR;thread:TTTT;" instead of "$pRR"
                                                                 // "$PRR=VVVVVVVV;thread:TTTT;" instead of "$PRR=VVVVVVVV"
                                                                 // "$g;thread:TTTT" instead of "$g"
                                                                 // "$GVVVVVVVVVVVVVV;thread:TTTT;#00 instead of "$GVVVVVVVVVVVVVV"
+    bool            m_list_threads_in_stop_reply;
 };
 
 /* We translate the /usr/include/mach/exception_types.h exception types





More information about the lldb-commits mailing list