summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBDebugger.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-02-21 02:23:08 +0000
committerJim Ingham <jingham@apple.com>2012-02-21 02:23:08 +0000
commit228063cd21c4e13aba0ef7a4522b1f32e3116c18 (patch)
tree73697c5ec27b8e8f282974db7db4f18de99b770b /lldb/source/API/SBDebugger.cpp
parent926410d2db727c5093bda792cb8b2025d7f02cc3 (diff)
downloadbcm5719-llvm-228063cd21c4e13aba0ef7a4522b1f32e3116c18.tar.gz
bcm5719-llvm-228063cd21c4e13aba0ef7a4522b1f32e3116c18.zip
Add a logging mode that takes a callback and flush'es to that callback.
Also add SB API's to set this callback, and to enable the log channels. llvm-svn: 151018
Diffstat (limited to 'lldb/source/API/SBDebugger.cpp')
-rw-r--r--lldb/source/API/SBDebugger.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index f98ca35f813..8150cb04b93 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -81,16 +81,23 @@ SBDebugger::Clear ()
SBDebugger
SBDebugger::Create()
{
- return SBDebugger::Create(false);
+ return SBDebugger::Create(false, NULL, NULL);
}
SBDebugger
SBDebugger::Create(bool source_init_files)
{
+ return SBDebugger::Create (source_init_files, NULL, NULL);
+}
+
+SBDebugger
+SBDebugger::Create(bool source_init_files, lldb::LogOutputCallback callback, void *baton)
+
+{
LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBDebugger debugger;
- debugger.reset(Debugger::CreateInstance());
+ debugger.reset(Debugger::CreateInstance(callback, baton));
if (log)
{
@@ -1200,3 +1207,16 @@ SBDebugger::GetSyntheticForType (SBTypeNameSpecifier type_name)
return synth_chosen;
}
+bool
+SBDebugger::EnableLog (const char *channel, const char **categories)
+{
+ if (m_opaque_sp)
+ {
+ uint32_t log_options = LLDB_LOG_OPTION_PREPEND_TIMESTAMP | LLDB_LOG_OPTION_PREPEND_THREAD_NAME;
+ StreamString errors;
+ return m_opaque_sp->EnableLog (channel, categories, NULL, log_options, errors);
+
+ }
+ else
+ return false;
+}
OpenPOWER on IntegriCloud