[Lldb-commits] [lldb] r155042 - /lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp

Johnny Chen johnny.chen at apple.com
Wed Apr 18 13:34:50 PDT 2012


Author: johnny
Date: Wed Apr 18 15:34:50 2012
New Revision: 155042

URL: http://llvm.org/viewvc/llvm-project?rev=155042&view=rev
Log:
For forcefully terminating the lldb-platform program, use SIGINT first, if that does not work, use SIGHUP as a last resort.
And we should not call exit() here because it results in the global destructors to be invoked and wreaking havoc on the threads still running.

Modified:
    lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp

Modified: lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp?rev=155042&r1=155041&r2=155042&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp Wed Apr 18 15:34:50 2012
@@ -61,9 +61,11 @@
         g_sigpipe_received = 1;
         break;
     case SIGHUP:
-        Debugger::Terminate();
-        fprintf(stderr, "SIGHUP received, lldb-platform exiting...\n");
-        exit(1);
+        // Use SIGINT first, if that does not work, use SIGHUP as a last resort.
+        // And we should not call exit() here because it results in the global destructors
+        // to be invoked and wreaking havoc on the threads still running.
+        Host::SystemLog(Host::eSystemLogWarning, "SIGHUP received, exiting lldb-platform...\n");
+        abort();
         break;
     }
 }





More information about the lldb-commits mailing list