[Lldb-commits] [lldb] r151209 - in /lldb/trunk: include/lldb/API/SBDebugger.h include/lldb/Core/Debugger.h source/API/SBDebugger.cpp source/Core/Debugger.cpp

Jim Ingham jingham at apple.com
Wed Feb 22 14:49:21 PST 2012


Author: jingham
Date: Wed Feb 22 16:49:20 2012
New Revision: 151209

URL: http://llvm.org/viewvc/llvm-project?rev=151209&view=rev
Log:
Make Debugger::SetLoggingCallback public, and expose it through the SB API.  Sometimes it is not
convenient to provide a log callback right when the debugger is created.

Modified:
    lldb/trunk/include/lldb/API/SBDebugger.h
    lldb/trunk/include/lldb/Core/Debugger.h
    lldb/trunk/source/API/SBDebugger.cpp
    lldb/trunk/source/Core/Debugger.cpp

Modified: lldb/trunk/include/lldb/API/SBDebugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=151209&r1=151208&r2=151209&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBDebugger.h (original)
+++ lldb/trunk/include/lldb/API/SBDebugger.h Wed Feb 22 16:49:20 2012
@@ -188,6 +188,9 @@
     EnableLog (const char *channel, const char **categories);
 
     void
+    SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton);
+    
+    void
     DispatchInput (void *baton, const void *data, size_t data_len);
 
     void

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=151209&r1=151208&r2=151209&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Wed Feb 22 16:49:20 2012
@@ -484,11 +484,11 @@
     bool
     EnableLog (const char *channel, const char **categories, const char *log_file, uint32_t log_options, Stream &error_stream);
 
-protected:
-
     void
     SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton);
     
+protected:
+
     static void
     DispatchInputCallback (void *baton, const void *bytes, size_t bytes_len);
 

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=151209&r1=151208&r2=151209&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Wed Feb 22 16:49:20 2012
@@ -1224,3 +1224,14 @@
     else
         return false;
 }
+
+void
+SBDebugger::SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton)
+{
+    if (m_opaque_sp)
+    {
+        return m_opaque_sp->SetLoggingCallback (log_callback, baton);
+    }
+}
+
+

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=151209&r1=151208&r2=151209&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Wed Feb 22 16:49:20 2012
@@ -2312,9 +2312,9 @@
 void
 Debugger::SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton)
 {
-    // For simplicity's sake, I am only allowing the logging callback to get
-    // set when the debugger is created.  Otherwise, I'd have to go turn off 
-    // all the log channels using this callback, and switch them to the new one...
+    // For simplicity's sake, I am not going to deal with how to close down any
+    // open logging streams, I just redirect everything from here on out to the
+    // callback.
     m_log_callback_stream_sp.reset (new StreamCallback (log_callback, baton));
 }
 





More information about the lldb-commits mailing list