pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lldb-netbsd: Drop thread-centric code handling the process exit



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sat Dec 24 01:42:00 2016 +0100
Changeset:	8c3e603c0939698197ec2b9201c506d200e72a30

Modified Files:
	lldb-netbsd/distinfo
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp

Log Message:
lldb-netbsd: Drop thread-centric code handling the process exit

Process on NetBSD does not exit multiple times for each thread.

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8c3e603c0939698197ec2b9201c506d200e72a30

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 lldb-netbsd/distinfo                               |  2 +-
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp | 38 ++++------------------
 2 files changed, 8 insertions(+), 32 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index bbf32fd..38702eb 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -27,7 +27,7 @@ SHA1 (patch-source_Plugins_Platform_NetBSD_PlatformNetBSD.cpp) = 129e853c1f93f06
 SHA1 (patch-source_Plugins_Platform_NetBSD_PlatformNetBSD.h) = 4327a21e79378b8f35adb07614adb41c37bbaf61
 SHA1 (patch-source_Plugins_Process_CMakeLists.txt) = c0168f81da56d9896eb414e6b8bb7262de04ac33
 SHA1 (patch-source_Plugins_Process_NetBSD_CMakeLists.txt) = df17afdf71c29d945c887e318718904793cd48ad
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = da1bc0677701ad844aa39c6d6a1f4ab79eef656f
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = f29532803abd628ba714d80069fb22552f1c4ce5
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = f31a6c671d648f49a67e515706492420dcd75027
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 05b1accced8403da0a70114c0f4b01faf570340c
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = f6217d48ba65babe63a56b2def14cc8099ca7c5d
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
index 74c00fc..7bbb090 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2016-12-23 23:19:01.279655164 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,1656 @@
+@@ -0,0 +1,1632 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -447,42 +447,18 @@ $NetBSD$
 +                                         int signal, int status) {
 +  Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
 +
-+  // Handle when the thread exits.
++  // Handle when the process exits.
 +  if (exited) {
 +    if (log)
 +      log->Printf(
 +          "NativeProcessNetBSD::%s() got exit signal(%d) , pid = %d",
 +          __FUNCTION__, signal, pid);
 +
-+    // This is a thread that exited.  Ensure we're not tracking it anymore.
-+    /* XXX: Stop tracking process? */
-+
-+    // We only set the exit status and notify the delegate if we haven't
-+    // already set the process
-+    // state to an exited state.  We normally should have received a SIGTRAP |
-+    // (PTRACE_EVENT_EXIT << 8)
-+    // for the main thread.
-+    const bool already_notified = (GetState() == StateType::eStateExited) ||
-+                                    (GetState() == StateType::eStateCrashed);
-+    if (!already_notified) {
-+      if (log)
-+        log->Printf("NativeProcessNetBSD::%s() pid = %d "
-+                    "handling process exit, expected exit state "
-+                    "already set but state was %s instead, setting exit "
-+                    "state now",
-+                    __FUNCTION__, pid, StateAsCString(GetState()));
-+      // The main thread exited.  We're done monitoring.  Report to delegate.
-+      SetExitStatus(convert_pid_status_to_exit_type(status),
-+                    convert_pid_status_to_return_code(status), nullptr, true);
-+
-+      // Notify delegate that our process has exited.
-+      SetState(StateType::eStateExited, true);
-+    } else {
-+      if (log)
-+        log->Printf("NativeProcessNetBSD::%s() pid = %d"
-+                    " main thread now exited",
-+                    __FUNCTION__, pid);
-+    }
++    SetExitStatus(convert_pid_status_to_exit_type(status),
++                  convert_pid_status_to_return_code(status), nullptr, true);
++
++    // Notify delegate that our process has exited.
++    SetState(StateType::eStateExited, true);
 +  }
 +}
 +


Home | Main Index | Thread Index | Old Index