diff options
author | Greg Clayton <gclayton@apple.com> | 2013-03-27 23:08:40 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-03-27 23:08:40 +0000 |
commit | 5160ce5c72e5f55c2e83ca9914cd0f02e0c5ceb3 (patch) | |
tree | b24bb5959b40d8f0e99ed6d8b13271270dbf08e3 /lldb/source/API/SBValue.cpp | |
parent | ccc266559f5c028442b6393362da14d866d9b32b (diff) | |
download | bcm5719-llvm-5160ce5c72e5f55c2e83ca9914cd0f02e0c5ceb3.tar.gz bcm5719-llvm-5160ce5c72e5f55c2e83ca9914cd0f02e0c5ceb3.zip |
<rdar://problem/13521159>
LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.
All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.
llvm-svn: 178191
Diffstat (limited to 'lldb/source/API/SBValue.cpp')
-rw-r--r-- | lldb/source/API/SBValue.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index 7dde95476fa..9ac0af00255 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -220,7 +220,7 @@ SBValue::GetName() if (value_sp) name = value_sp->GetName().GetCString(); - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (name) @@ -235,7 +235,7 @@ SBValue::GetName() const char * SBValue::GetTypeName () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); const char *name = NULL; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -275,7 +275,7 @@ SBValue::GetTypeName () size_t SBValue::GetByteSize () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); size_t result = 0; lldb::ValueObjectSP value_sp(GetSP()); @@ -324,7 +324,7 @@ SBValue::IsInScope () } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::IsInScope () => %i", value_sp.get(), result); @@ -334,7 +334,7 @@ SBValue::IsInScope () const char * SBValue::GetValue () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); const char *cstr = NULL; lldb::ValueObjectSP value_sp(GetSP()); @@ -375,7 +375,7 @@ SBValue::GetValueType () lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) result = value_sp->GetValueType(); - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { switch (result) @@ -396,7 +396,7 @@ SBValue::GetValueType () const char * SBValue::GetObjectDescription () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); const char *cstr = NULL; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -431,7 +431,7 @@ SBValue::GetObjectDescription () SBType SBValue::GetType() { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); SBType sb_type; lldb::ValueObjectSP value_sp(GetSP()); TypeImplSP type_sp; @@ -468,7 +468,7 @@ SBValue::GetType() bool SBValue::GetValueDidChange () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); bool result = false; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -500,7 +500,7 @@ SBValue::GetValueDidChange () const char * SBValue::GetSummary () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); const char *cstr = NULL; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -536,7 +536,7 @@ SBValue::GetSummary () const char * SBValue::GetLocation () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); const char *cstr = NULL; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -581,7 +581,7 @@ SBValue::SetValueFromCString (const char *value_str, lldb::SBError& error) { bool success = false; lldb::ValueObjectSP value_sp(GetSP()); - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (value_sp) { ProcessSP process_sp(value_sp->GetProcessSP()); @@ -618,7 +618,7 @@ SBValue::GetTypeFormat () Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetTypeFormat() => error: process is running", value_sp.get()); } @@ -652,7 +652,7 @@ SBValue::GetTypeSummary () Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetTypeSummary() => error: process is running", value_sp.get()); } @@ -686,7 +686,7 @@ SBValue::GetTypeFilter () Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetTypeFilter() => error: process is running", value_sp.get()); } @@ -724,7 +724,7 @@ SBValue::GetTypeSynthetic () Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetTypeSynthetic() => error: process is running", value_sp.get()); } @@ -763,7 +763,7 @@ SBValue::CreateChildAtOffset (const char *name, uint32_t offset, SBType type) Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::CreateChildAtOffset() => error: process is running", value_sp.get()); } @@ -784,7 +784,7 @@ SBValue::CreateChildAtOffset (const char *name, uint32_t offset, SBType type) } } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (new_value_sp) @@ -820,7 +820,7 @@ SBValue::CreateValueFromExpression (const char *name, const char* expression) lldb::SBValue SBValue::CreateValueFromExpression (const char *name, const char *expression, SBExpressionOptions &options) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); lldb::SBValue sb_value; lldb::ValueObjectSP value_sp(GetSP()); lldb::ValueObjectSP new_value_sp; @@ -905,7 +905,7 @@ SBValue::CreateValueFromAddress(const char* name, lldb::addr_t address, SBType s sb_value.SetSP(new_value_sp); } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (new_value_sp) @@ -935,7 +935,7 @@ SBValue::CreateValueFromData (const char* name, SBData data, SBType type) new_value_sp->SetAddressTypeOfChildren(eAddressTypeLoad); sb_value.SetSP(new_value_sp); } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (new_value_sp) @@ -965,7 +965,7 @@ SBValue SBValue::GetChildAtIndex (uint32_t idx, lldb::DynamicValueType use_dynamic, bool can_create_synthetic) { lldb::ValueObjectSP child_sp; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -1024,7 +1024,7 @@ SBValue::GetIndexOfChildWithName (const char *name) idx = value_sp->GetIndexOfChildWithName (ConstString(name)); } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (idx == UINT32_MAX) @@ -1059,7 +1059,7 @@ SBValue::GetChildMemberWithName (const char *name, lldb::DynamicValueType use_dy lldb::ValueObjectSP child_sp; const ConstString str_name (name); - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -1192,7 +1192,7 @@ SBValue::IsSynthetic () lldb::SBValue SBValue::GetValueForExpressionPath(const char* expr_path) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); lldb::ValueObjectSP child_sp; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -1236,7 +1236,7 @@ SBValue::GetValueAsSigned(SBError& error, int64_t fail_value) Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetValueAsSigned() => error: process is running", value_sp.get()); error.SetErrorString("process is running"); @@ -1272,7 +1272,7 @@ SBValue::GetValueAsUnsigned(SBError& error, uint64_t fail_value) Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetValueAsUnsigned() => error: process is running", value_sp.get()); error.SetErrorString("process is running"); @@ -1307,7 +1307,7 @@ SBValue::GetValueAsSigned(int64_t fail_value) Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetValueAsSigned() => error: process is running", value_sp.get()); } @@ -1336,7 +1336,7 @@ SBValue::GetValueAsUnsigned(uint64_t fail_value) Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetValueAsUnsigned() => error: process is running", value_sp.get()); } @@ -1358,7 +1358,7 @@ SBValue::GetValueAsUnsigned(uint64_t fail_value) bool SBValue::MightHaveChildren () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); bool has_children = false; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -1374,7 +1374,7 @@ SBValue::GetNumChildren () { uint32_t num_children = 0; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) { @@ -1420,7 +1420,7 @@ SBValue::Dereference () sb_value = value_sp->Dereference (error); } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::Dereference () => SBValue(%p)", value_sp.get(), value_sp.get()); @@ -1444,7 +1444,7 @@ SBValue::TypeIsPointerType () } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::TypeIsPointerType () => %i", value_sp.get(), is_ptr_type); @@ -1480,7 +1480,7 @@ SBValue::GetTarget() target_sp = value_sp->GetTargetSP(); sb_target.SetSP (target_sp); } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (target_sp.get() == NULL) @@ -1503,7 +1503,7 @@ SBValue::GetProcess() if (process_sp) sb_process.SetSP (process_sp); } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (process_sp.get() == NULL) @@ -1525,7 +1525,7 @@ SBValue::GetThread() thread_sp = value_sp->GetThreadSP(); sb_thread.SetThread(thread_sp); } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (thread_sp.get() == NULL) @@ -1547,7 +1547,7 @@ SBValue::GetFrame() frame_sp = value_sp->GetFrameSP(); sb_frame.SetFrameSP (frame_sp); } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) { if (frame_sp.get() == NULL) @@ -1670,7 +1670,7 @@ SBValue::GetDescription (SBStream &description) Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetDescription() => error: process is running", value_sp.get()); } @@ -1717,7 +1717,7 @@ SBValue::AddressOf() sb_value.SetSP(value_sp->AddressOf (error),GetPreferDynamicValue(), GetPreferSyntheticValue()); } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::AddressOf () => SBValue(%p)", value_sp.get(), value_sp.get()); @@ -1754,7 +1754,7 @@ SBValue::GetLoadAddress() value = LLDB_INVALID_ADDRESS; } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetLoadAddress () => (%" PRIu64 ")", value_sp.get(), value); @@ -1791,7 +1791,7 @@ SBValue::GetAddress() } } } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::GetAddress () => (%s,%" PRIu64 ")", value_sp.get(), (addr.GetSection() ? addr.GetSection()->GetName().GetCString() : "NULL"), @@ -1803,7 +1803,7 @@ lldb::SBData SBValue::GetPointeeData (uint32_t item_idx, uint32_t item_count) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); lldb::SBData sb_data; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -1841,7 +1841,7 @@ SBValue::GetPointeeData (uint32_t item_idx, lldb::SBData SBValue::GetData () { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); lldb::SBData sb_data; lldb::ValueObjectSP value_sp(GetSP()); if (value_sp) @@ -1903,7 +1903,7 @@ SBValue::Watch (bool resolve_location, bool read, bool write, SBError &error) Process::StopLocker stop_locker; if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBValue(%p)::Watch() => error: process is running", value_sp.get()); return sb_watchpoint; |