summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Memory.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/Target/Memory.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/Target/Memory.cpp')
-rw-r--r--lldb/source/Target/Memory.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Target/Memory.cpp b/lldb/source/Target/Memory.cpp
index 1e3bfc1450d..ae8d034f77b 100644
--- a/lldb/source/Target/Memory.cpp
+++ b/lldb/source/Target/Memory.cpp
@@ -225,7 +225,7 @@ AllocatedBlock::ReserveBlock (uint32_t size)
if (size <= m_byte_size)
{
const uint32_t needed_chunks = CalculateChunksNeededForSize (size);
- LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
+ Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
if (m_offset_to_chunk_size.empty())
{
@@ -324,7 +324,7 @@ AllocatedBlock::ReserveBlock (uint32_t size)
// return m_addr + m_chunk_size * first_chunk_idx;
// }
}
- LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
+ Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
if (log)
log->Printf ("AllocatedBlock::ReserveBlock (size = %u (0x%x)) => 0x%16.16" PRIx64, size, size, (uint64_t)addr);
return addr;
@@ -341,7 +341,7 @@ AllocatedBlock::FreeBlock (addr_t addr)
m_offset_to_chunk_size.erase (pos);
success = true;
}
- LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
+ Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
if (log)
log->Printf ("AllocatedBlock::FreeBlock (addr = 0x%16.16" PRIx64 ") => %i", (uint64_t)addr, success);
return success;
@@ -387,7 +387,7 @@ AllocatedMemoryCache::AllocatePage (uint32_t byte_size,
addr_t addr = m_process.DoAllocateMemory(page_byte_size, permissions, error);
- LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
+ Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
if (log)
{
log->Printf ("Process::DoAllocateMemory (byte_size = 0x%8.8zx, permissions = %s) => 0x%16.16" PRIx64,
@@ -426,7 +426,7 @@ AllocatedMemoryCache::AllocateMemory (size_t byte_size,
if (block_sp)
addr = block_sp->ReserveBlock (byte_size);
}
- LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
+ Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
if (log)
log->Printf ("AllocatedMemoryCache::AllocateMemory (byte_size = 0x%8.8zx, permissions = %s) => 0x%16.16" PRIx64, byte_size, GetPermissionsAsCString(permissions), (uint64_t)addr);
return addr;
@@ -447,7 +447,7 @@ AllocatedMemoryCache::DeallocateMemory (lldb::addr_t addr)
break;
}
}
- LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
+ Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
if (log)
log->Printf("AllocatedMemoryCache::DeallocateMemory (addr = 0x%16.16" PRIx64 ") => %i", (uint64_t)addr, success);
return success;
OpenPOWER on IntegriCloud