diff options
author | Jason Molenda <jmolenda@apple.com> | 2013-11-19 05:44:41 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2013-11-19 05:44:41 +0000 |
commit | a6e9130d5243beccb72b68eee7c62b439dd5f32f (patch) | |
tree | 17533c76be47b5d32fb76af0ab3c43f450d993f8 /lldb/source/API/SBThread.cpp | |
parent | 1f54e805f25c7381e2dbf0d2065f4c1af8ba095a (diff) | |
download | bcm5719-llvm-a6e9130d5243beccb72b68eee7c62b439dd5f32f.tar.gz bcm5719-llvm-a6e9130d5243beccb72b68eee7c62b439dd5f32f.zip |
Add logging for the SB API which creates extended
threads.
Take a stab at fixing the too-soon freeing of the extended
backtrace thread list in Process.
<rdar://problem/15496603>
llvm-svn: 195104
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
-rw-r--r-- | lldb/source/API/SBThread.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 93e5646fcac..4170d5b230b 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -1305,10 +1305,20 @@ SBThread::GetExtendedBacktraceThread (const char *type) if (runtime) { ThreadSP new_thread_sp (runtime->GetExtendedBacktraceThread (real_thread, type_const)); - // Save this in the Process' ExtendedThreadList so a strong pointer retains the - // object. - process->GetExtendedThreadList().AddThread (new_thread_sp); - sb_origin_thread.SetThread (new_thread_sp); + if (new_thread_sp) + { + // Save this in the Process' ExtendedThreadList so a strong pointer retains the + // object. + process->GetExtendedThreadList().AddThread (new_thread_sp); + sb_origin_thread.SetThread (new_thread_sp); + if (log) + { + const char *queue_name = new_thread_sp->GetQueueName(); + if (queue_name == NULL) + queue_name = ""; + log->Printf ("SBThread(%p)::GetExtendedBacktraceThread() => new extended Thread created (%p) with queue_id 0x%" PRIx64 " queue name '%s'", exe_ctx.GetThreadPtr(), new_thread_sp.get(), new_thread_sp->GetQueueID(), queue_name); + } + } } } } @@ -1316,7 +1326,7 @@ SBThread::GetExtendedBacktraceThread (const char *type) else { if (log) - log->Printf ("SBThread(%p)::GetExtendedBacktrace() => error: process is running", exe_ctx.GetThreadPtr()); + log->Printf ("SBThread(%p)::GetExtendedBacktraceThread() => error: process is running", exe_ctx.GetThreadPtr()); } } |