summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ModuleList.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-03-27 23:08:40 +0000
committerGreg Clayton <gclayton@apple.com>2013-03-27 23:08:40 +0000
commit5160ce5c72e5f55c2e83ca9914cd0f02e0c5ceb3 (patch)
treeb24bb5959b40d8f0e99ed6d8b13271270dbf08e3 /lldb/source/Core/ModuleList.cpp
parentccc266559f5c028442b6393362da14d866d9b32b (diff)
downloadbcm5719-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/Core/ModuleList.cpp')
-rw-r--r--lldb/source/Core/ModuleList.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index 05dc3e3a786..8e79a455182 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -596,9 +596,9 @@ ModuleList::Dump(Stream *s) const
}
void
-ModuleList::LogUUIDAndPaths (LogSP &log_sp, const char *prefix_cstr)
+ModuleList::LogUUIDAndPaths (Log *log, const char *prefix_cstr)
{
- if (log_sp)
+ if (log)
{
Mutex::Locker locker(m_modules_mutex);
char uuid_cstr[256];
@@ -608,13 +608,13 @@ ModuleList::LogUUIDAndPaths (LogSP &log_sp, const char *prefix_cstr)
Module *module = pos->get();
module->GetUUID().GetAsCString (uuid_cstr, sizeof(uuid_cstr));
const FileSpec &module_file_spec = module->GetFileSpec();
- log_sp->Printf ("%s[%u] %s (%s) \"%s/%s\"",
- prefix_cstr ? prefix_cstr : "",
- (uint32_t)std::distance (begin, pos),
- uuid_cstr,
- module->GetArchitecture().GetArchitectureName(),
- module_file_spec.GetDirectory().GetCString(),
- module_file_spec.GetFilename().GetCString());
+ log->Printf ("%s[%u] %s (%s) \"%s/%s\"",
+ prefix_cstr ? prefix_cstr : "",
+ (uint32_t)std::distance (begin, pos),
+ uuid_cstr,
+ module->GetArchitecture().GetArchitectureName(),
+ module_file_spec.GetDirectory().GetCString(),
+ module_file_spec.GetFilename().GetCString());
}
}
}
@@ -791,7 +791,7 @@ ModuleList::GetSharedModule
if (old_module_sp_ptr && !old_module_sp_ptr->get())
*old_module_sp_ptr = module_sp;
- LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_MODULES));
+ Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_MODULES));
if (log)
log->Printf("module changed: %p, removing from global module list", module_sp.get());
OpenPOWER on IntegriCloud