summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-10-27 21:23:37 +0000
committerCaroline Tice <ctice@apple.com>2010-10-27 21:23:37 +0000
commit7b9da4a550341d29056fadec8b0491e73b07871b (patch)
treefae956c6dda3d89d71f3233a183ade4986acbdbd
parent2314079ef0d540bb522b3864dd738e1df3b3bf30 (diff)
downloadbcm5719-llvm-7b9da4a550341d29056fadec8b0491e73b07871b.tar.gz
bcm5719-llvm-7b9da4a550341d29056fadec8b0491e73b07871b.zip
Fix bugs attempting to write to API log after it has been
disabled. llvm-svn: 117493
-rw-r--r--lldb/source/API/SBCommandInterpreter.cpp2
-rw-r--r--lldb/source/API/SBListener.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index f6a95f9ac91..cb2dd7497a2 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -87,6 +87,8 @@ SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnOb
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;
diff --git a/lldb/source/API/SBListener.cpp b/lldb/source/API/SBListener.cpp
index 0062746901e..bc118e575bc 100644
--- a/lldb/source/API/SBListener.cpp
+++ b/lldb/source/API/SBListener.cpp
@@ -119,7 +119,6 @@ SBListener::StopListeningForEvents (const SBBroadcaster& broadcaster, uint32_t e
bool
SBListener::WaitForEvent (uint32_t num_seconds, SBEvent &event)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
//if (log)
//{
@@ -141,6 +140,7 @@ SBListener::WaitForEvent (uint32_t num_seconds, SBEvent &event)
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 @@ SBListener::WaitForEvent (uint32_t num_seconds, SBEvent &event)
}
}
+ 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());
OpenPOWER on IntegriCloud