[Lldb-commits] [lldb] r117493 - in /lldb/trunk/source/API: SBCommandInterpreter.cpp SBListener.cpp

Caroline Tice ctice at apple.com
Wed Oct 27 14:23:37 PDT 2010


Author: ctice
Date: Wed Oct 27 16:23:37 2010
New Revision: 117493

URL: http://llvm.org/viewvc/llvm-project?rev=117493&view=rev
Log:
Fix bugs attempting to write to API log after it has been
disabled.


Modified:
    lldb/trunk/source/API/SBCommandInterpreter.cpp
    lldb/trunk/source/API/SBListener.cpp

Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=117493&r1=117492&r2=117493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/trunk/source/API/SBCommandInterpreter.cpp Wed Oct 27 16:23:37 2010
@@ -87,6 +87,8 @@
         result->SetStatus (eReturnStatusFailed);
     }
 
+    // We need to get the value again, in case the command disabled the log!
+    log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
     if (log)
     {
         SBStream sstr;

Modified: lldb/trunk/source/API/SBListener.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBListener.cpp?rev=117493&r1=117492&r2=117493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBListener.cpp (original)
+++ lldb/trunk/source/API/SBListener.cpp Wed Oct 27 16:23:37 2010
@@ -119,7 +119,6 @@
 bool
 SBListener::WaitForEvent (uint32_t num_seconds, SBEvent &event)
 {
-    Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
 
     //if (log)
     //{
@@ -141,6 +140,7 @@
         if (m_opaque_ptr->WaitForEvent (time_value.IsValid() ? &time_value : NULL, event_sp))
         {
             event.reset (event_sp);
+            Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
             if (log)
                 log->Printf ("SBListener::WaitForEvent (this.obj=%p, num_seconds=%d, event.sp=%p) => 'true'",
                              m_opaque_ptr, num_seconds, event.get());
@@ -148,6 +148,7 @@
         }
     }
 
+    Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
     if (log)
         log->Printf ("SBListener::WaitForEvent (this.obj=%p, num_seconds=%d, event.sp=%p) => 'false'",
                      m_opaque_ptr, num_seconds, event.get());





More information about the lldb-commits mailing list