[Lldb-commits] [lldb] r209739 - Avoid passing null signal name for Log %s argument

Ed Maste emaste at freebsd.org
Wed May 28 07:11:20 PDT 2014


Author: emaste
Date: Wed May 28 09:11:20 2014
New Revision: 209739

URL: http://llvm.org/viewvc/llvm-project?rev=209739&view=rev
Log:
Avoid passing null signal name for Log %s argument


Modified:
    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=209739&r1=209738&r2=209739&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Wed May 28 09:11:20 2014
@@ -1628,9 +1628,13 @@ ProcessMonitor::Resume(lldb::tid_t unuse
     bool result;
     Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));
 
-    if (log)
-        log->Printf ("ProcessMonitor::%s() resuming pid %"  PRIu64 " with signal %s", __FUNCTION__, GetPID(),
-                                 m_process->GetUnixSignals().GetSignalAsCString (signo));
+    if (log) {
+        const char *signame = m_process->GetUnixSignals().GetSignalAsCString (signo);
+        if (signame == nullptr)
+            signame = "<none>";
+        log->Printf("ProcessMonitor::%s() resuming pid %"  PRIu64 " with signal %s",
+                    __FUNCTION__, GetPID(), signame);
+    }
     ResumeOperation op(signo, result);
     DoOperation(&op);
     if (log)





More information about the lldb-commits mailing list