diff options
Diffstat (limited to 'lldb/source/Core/Log.cpp')
-rw-r--r-- | lldb/source/Core/Log.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Core/Log.cpp b/lldb/source/Core/Log.cpp index f8e422e2df7..3743631fbb7 100644 --- a/lldb/source/Core/Log.cpp +++ b/lldb/source/Core/Log.cpp @@ -112,10 +112,9 @@ Log::PrintfWithFlagsVarArg (uint32_t flags, const char *format, va_list args) // Add the process and thread if requested if (m_options.Test (LLDB_LOG_OPTION_PREPEND_THREAD_NAME)) { - const char *thread_name_str = Host::GetThreadName (getpid(), Host::GetCurrentThreadID()); - if (thread_name_str) - header.Printf ("%s ", thread_name_str); - + std::string thread_name (Host::GetThreadName (getpid(), Host::GetCurrentThreadID())); + if (!thread_name.empty()) + header.Printf ("%s ", thread_name.c_str()); } header.PrintfVarArg (format, args); |