summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-02-22 22:49:20 +0000
committerJim Ingham <jingham@apple.com>2012-02-22 22:49:20 +0000
commit4f02b22db574bed9ea65ad8b9f1b2a3157aa77ff (patch)
tree97dc1937a0123f57e5f264db8acd3a35dbd41c19
parent77171d343b00391fe052b588d28c887031a0ce9a (diff)
downloadbcm5719-llvm-4f02b22db574bed9ea65ad8b9f1b2a3157aa77ff.tar.gz
bcm5719-llvm-4f02b22db574bed9ea65ad8b9f1b2a3157aa77ff.zip
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. llvm-svn: 151209
-rw-r--r--lldb/include/lldb/API/SBDebugger.h3
-rw-r--r--lldb/include/lldb/Core/Debugger.h4
-rw-r--r--lldb/source/API/SBDebugger.cpp11
-rw-r--r--lldb/source/Core/Debugger.cpp6
4 files changed, 19 insertions, 5 deletions
diff --git a/lldb/include/lldb/API/SBDebugger.h b/lldb/include/lldb/API/SBDebugger.h
index 708ad4bd36e..0ec84f7de7f 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -188,6 +188,9 @@ public:
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
diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index 417a6925135..f0bb08e4f08 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -484,11 +484,11 @@ public:
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);
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 6628c1aa1f5..ac6fc208d23 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -1224,3 +1224,14 @@ SBDebugger::EnableLog (const char *channel, const char **categories)
else
return false;
}
+
+void
+SBDebugger::SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton)
+{
+ if (m_opaque_sp)
+ {
+ return m_opaque_sp->SetLoggingCallback (log_callback, baton);
+ }
+}
+
+
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index abf23eab1ca..d96b65baa05 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -2312,9 +2312,9 @@ Debugger::FormatPrompt
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));
}
OpenPOWER on IntegriCloud