From 5160ce5c72e5f55c2e83ca9914cd0f02e0c5ceb3 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 27 Mar 2013 23:08:40 +0000 Subject: 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 --- .../Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp') diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index d867c891b33..2f9c69870f3 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -132,7 +132,7 @@ OperatingSystemPython::GetDynamicRegisterInfo () { if (!m_interpreter || !m_python_object_sp) return NULL; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); if (log) log->Printf ("OperatingSystemPython::GetDynamicRegisterInfo() fetching thread register definitions from python for pid %" PRIu64, m_process->GetID()); @@ -175,7 +175,7 @@ OperatingSystemPython::UpdateThreadList (ThreadList &old_thread_list, ThreadList if (!m_interpreter || !m_python_object_sp) return false; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); // First thing we have to do is get the API lock, and the run lock. We're going to change the thread // content of the process, and we're going to use python, which requires the API lock to do it. @@ -267,7 +267,7 @@ OperatingSystemPython::CreateRegisterContextForThread (Thread *thread, addr_t re Target &target = m_process->GetTarget(); Mutex::Locker api_locker (target.GetAPIMutex()); - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (reg_data_addr != LLDB_INVALID_ADDRESS) { @@ -316,7 +316,7 @@ OperatingSystemPython::CreateThreadStopReason (lldb_private::Thread *thread) lldb::ThreadSP OperatingSystemPython::CreateThread (lldb::tid_t tid, addr_t context) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); if (log) log->Printf ("OperatingSystemPython::CreateThread (tid = 0x%" PRIx64 ", context = 0x%" PRIx64 ") fetching register data from python", tid, context); -- cgit v1.2.3