pkgsrc-WIP-changes archive

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

netbsd-lldb: Add to the NetBSD Process Ponitor code support for new events



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Jan 17 22:40:03 2017 +0100
Changeset:	b8495522e71121338c00e203df0be8b467148315

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

Log Message:
netbsd-lldb: Add to the NetBSD Process Ponitor code support for new events

Add code to recognize:
 - TRAP_CHLD and FORK, VFORK, VFORK_DONE
 - TRAP_LWP and LWP_CREATE, LWP_EXIT
 - TRAP_HWWPT

This code recognizes (however still does not do much beyond it) all the needed
events in MonitorCallback function in the NetBSD Process Plugin.

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=b8495522e71121338c00e203df0be8b467148315

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 | 39 ++++++++++++++--------
 2 files changed, 26 insertions(+), 15 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 9349872..ecd8532 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) = a9f8123867fad2d673913b572f2891a17ecd740d
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = aea408bce689012c462aa9695439113c4d3ef4f9
 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 920ea8b..e527d05 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-01-05 14:32:45.880405612 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-01-17 18:02:38.694275947 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,1640 @@
+@@ -0,0 +1,1651 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -492,23 +492,34 @@ $NetBSD$
 +    case SIGTRAP:
 +      // breakpoint
 +      if ((info.psi_siginfo.si_code & TRAP_BRKPT) != 0)
-+          printf("Breakpoint reported\n");
++        printf("Breakpoint reported\n");
 +      // single step (and temporarily also hardware watchpoint on x86)
 +      else if ((info.psi_siginfo.si_code & TRAP_TRACE) != 0)
-+          printf("Single step reported\n");
++        printf("Single step reported\n");
 +      // exec()
 +      else if ((info.psi_siginfo.si_code & TRAP_EXEC) != 0)
-+          printf("exec() reported\n");
-+      // fork(2)
-+      else if ((state.pe_report_event & PTRACE_FORK) != 0)
++        printf("exec() reported\n");
++      else if ((info.psi_siginfo.si_code & TRAP_CHLD) != 0) {
++        // fork(2)
++        if ((state.pe_report_event & PTRACE_FORK) != 0)
 +          printf("Fork reported\n");
-+      // TODO: vfork(2)
-+      // TODO: vfork(2) finished (parent resumed)
-+      // TODO: LWP created
-+      // TODO: LWP terminated
-+      // ????: clone(2)/__clone(2) -- seems to be split between fork(2) and vfork(2)
-+      // ????: posix_spawn(2)
-+      // TODO: execve(2)
++        // vfork(2)
++        else if ((state.pe_report_event & PTRACE_VFORK) != 0)
++          printf("VFork reported\n");
++        // vfork(2) done
++        else if ((state.pe_report_event & PTRACE_VFORK_DONE) != 0)
++          printf("VFork Done reported\n");
++      } else if ((info.psi_siginfo.si_code & TRAP_LWP) != 0) {
++        // _lwp_create(2)
++        if ((state.pe_report_event & PTRACE_LWP_CREATE) != 0)
++          printf("LWP created reported\n");
++        // _lwp_exit(2)
++        if ((state.pe_report_event & PTRACE_LWP_EXIT) != 0)
++          printf("LWP terminated reported\n");
++      } else if ((info.psi_siginfo.si_code & TRAP_HWWPT) != 0) {
++        // hardware watchpoint
++        printf("hw watchpoint reported\n");
++      }
 +      // Unknown
 +      else
 +        printf("Unknown event for SIGTRAP\n");


Home | Main Index | Thread Index | Old Index