pkgsrc-WIP-changes archive

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

lldb-netbsd: Correct handling exit of a process



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Jan 19 02:54:58 2017 +0100
Changeset:	2caf5a63f258f8ae0cd38ba50ec5a09084e8ac2a

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

Log Message:
lldb-netbsd: Correct handling exit of a process

When terminating threads, this loop is incorrect:
    for (auto it = m_threads.begin(); it != m_threads.end(); ++it) {
       m_threads.erase(it);
    }

As of .erase is called more than once for std::vector m_threads with more than
one element.

Use a generic solution: m_threads.clear().

After marking the thread exited, don't process signals code.

$ lldb ./hello2
(lldb) target create "./hello2"
Current executable set to './hello2' (x86_64).
(lldb) r
Hello world!
Process 28508 launched: './hello2' (x86_64)
Process 28508 exited with status = 2 (0x00000002)
(lldb) q

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=2caf5a63f258f8ae0cd38ba50ec5a09084e8ac2a

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

diffstat:
 lldb-netbsd/distinfo                                              | 2 +-
 .../patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index ecd8532..40d747f 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -28,7 +28,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) = aea408bce689012c462aa9695439113c4d3ef4f9
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 497884c941bbabd7f69e23c2b51ea96145b3a63a
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 063478b318cd6c891a78b0649ae7a16968020abf
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = a90056d84664722cf7ed21a8b929b2a9adb00564
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = 68c7f7976e48275b6554a03da0e55c8bf59ead47
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 e527d05..49996a5 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-01-17 18:02:38.694275947 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-01-19 01:40:16.619517153 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
 @@ -0,0 +1,1651 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
@@ -466,15 +466,15 @@ $NetBSD$
 +          __FUNCTION__, signal, pid);
 +
 +    /* Stop Tracking All Threads attached to Process */
-+    for (auto it = m_threads.begin(); it != m_threads.end(); ++it) {
-+       m_threads.erase(it);
-+    }
++    m_threads.clear();
 +
 +    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);
++
++    return;
 +  }
 +
 +  ptrace_siginfo_t info;


Home | Main Index | Thread Index | Old Index