[Lldb-commits] [lldb] r155138 - /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

Jim Ingham jingham at apple.com
Thu Apr 19 09:57:50 PDT 2012


Author: jingham
Date: Thu Apr 19 11:57:50 2012
New Revision: 155138

URL: http://llvm.org/viewvc/llvm-project?rev=155138&view=rev
Log:
In debug mode, assert when we fail to get the sequence mutex.  We need to remove as many places where this can happen as possible.

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=155138&r1=155137&r2=155138&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Thu Apr 19 11:57:50 2012
@@ -245,6 +245,12 @@
         else
         {
             LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
+#if LLDB_CONFIGURATION_DEBUG
+            StreamString strm;
+            gdb_comm.DumpHistory(strm);
+            Host::SetCrashDescription (strm.GetData());
+            assert (!"Didn't get sequence mutex for read register.");
+#else
             if (log)
             {
                 if (log->GetVerbose())
@@ -258,6 +264,7 @@
                     log->Printf("error: failed to get packet sequence mutex, not sending read register for \"%s\"", reg_info->name);
                 }
             }
+#endif
         }
 
         // Make sure we got a valid register value after reading it
@@ -441,6 +448,12 @@
         else
         {
             LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
+#if LLDB_CONFIGURATION_DEBUG
+            StreamString strm;
+            gdb_comm.DumpHistory(strm);
+            Host::SetCrashDescription (strm.GetData());
+            assert (!"Didn't get sequence mutex.");
+#else
             if (log)
             {
                 if (log->GetVerbose())
@@ -452,6 +465,7 @@
                 else
                     log->Printf("error: failed to get packet sequence mutex, not sending write register for \"%s\"", reg_info->name);
             }
+#endif
         }
     }
     return false;
@@ -511,6 +525,12 @@
     else
     {
         LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
+#if LLDB_CONFIGURATION_DEBUG
+        StreamString strm;
+        gdb_comm.DumpHistory(strm);
+        Host::SetCrashDescription (strm.GetData());
+        assert (!"Didn't get sequence mutex.");
+#else
         if (log)
         {
             if (log->GetVerbose())
@@ -522,6 +542,7 @@
             else
                 log->Printf("error: failed to get packet sequence mutex, not sending read all registers");
         }
+#endif
     }
 
     data_sp.reset();
@@ -644,12 +665,14 @@
     else
     {
         LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
-        if (log)
+        if (1 /* log */)
         {
-            if (log->GetVerbose())
+            if (1 /*log->GetVerbose() */)
             {
                 StreamString strm;
                 gdb_comm.DumpHistory(strm);
+                Host::SetCrashDescription (strm.GetData());
+                assert (!"Didn't get sequence mutex.");
                 log->Printf("error: failed to get packet sequence mutex, not sending write all registers:\n%s", strm.GetData());
             }
             else





More information about the lldb-commits mailing list