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/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.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/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp')
-rw-r--r-- | lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 224ad3f83ab..61b6de2c50d 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -788,7 +788,7 @@ bool DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfosAddress (lldb::addr_t image_infos_addr, uint32_t image_infos_count) { DYLDImageInfo::collection image_infos; - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); if (log) log->Printf ("Adding %d modules.\n", image_infos_count); @@ -813,7 +813,7 @@ DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfos (DYLDImageInfo::collection &i { // Now add these images to the main list. ModuleList loaded_module_list; - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); Target &target = m_process->GetTarget(); ModuleList& target_images = target.GetImages(); @@ -822,7 +822,7 @@ DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfos (DYLDImageInfo::collection &i if (log) { log->Printf ("Adding new image at address=0x%16.16" PRIx64 ".", image_infos[idx].address); - image_infos[idx].PutToLog (log.get()); + image_infos[idx].PutToLog (log); } m_dyld_image_infos.push_back(image_infos[idx]); @@ -917,7 +917,7 @@ bool DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress (lldb::addr_t image_infos_addr, uint32_t image_infos_count) { DYLDImageInfo::collection image_infos; - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); Mutex::Locker locker(m_mutex); if (m_process->GetStopID() == m_dyld_image_infos_stop_id) @@ -940,7 +940,7 @@ DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress (lldb::addr_t image if (log) { log->Printf ("Removing module at address=0x%16.16" PRIx64 ".", image_infos[idx].address); - image_infos[idx].PutToLog (log.get()); + image_infos[idx].PutToLog (log); } // Remove this image_infos from the m_all_image_infos. We do the comparision by address @@ -973,7 +973,7 @@ DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress (lldb::addr_t image if (log) { log->Printf ("Could not find module for unloading info entry:"); - image_infos[idx].PutToLog(log.get()); + image_infos[idx].PutToLog(log); } } @@ -989,7 +989,7 @@ DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress (lldb::addr_t image if (log) { log->Printf ("Could not find image_info entry for unloading image:"); - image_infos[idx].PutToLog(log.get()); + image_infos[idx].PutToLog(log); } } } @@ -1059,7 +1059,7 @@ DynamicLoaderMacOSXDYLD::ReadImageInfos (lldb::addr_t image_infos_addr, bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos () { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); Mutex::Locker locker(m_mutex); if (m_process->GetStopID() == m_dyld_image_infos_stop_id @@ -1304,7 +1304,6 @@ DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(DYLDImageInfo::co bool update_executable) { uint32_t exe_idx = UINT32_MAX; - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); // Read any UUID values that we can get for (uint32_t i = 0; i < infos_count; i++) { @@ -1592,7 +1591,7 @@ DynamicLoaderMacOSXDYLD::GetStepThroughTrampolinePlan (Thread &thread, bool stop StackFrame *current_frame = thread.GetStackFrameAtIndex(0).get(); const SymbolContext ¤t_context = current_frame->GetSymbolContext(eSymbolContextSymbol); Symbol *current_symbol = current_context.symbol; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (current_symbol != NULL) { |