pkgsrc-WIP-changes archive

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

lldb-netbsd: Add more NetBSD support in generic code paths



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Dec 26 02:02:36 2016 +0100
Changeset:	edc2b862930e783d499670f36298ceb201c2ae85

Modified Files:
	lldb-netbsd/distinfo
	lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h
	lldb-netbsd/patches/patch-source_Host_common_NativeProcessProtocol.cpp
	lldb-netbsd/patches/patch-source_Initialization_SystemInitializerCommon.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
Added Files:
	lldb-netbsd/patches/patch-source_Host_common_Host.cpp

Log Message:
lldb-netbsd: Add more NetBSD support in generic code paths

1.
Return platform thread id with _lwp_self() not pthread_self(), as it's
requested type and is stored as uint.

2.
Treat NetBSD like FreeBSD and Linux in posix spawn code, assume that NetBSD
resets signals handlers similarily.

3.
Make use of ProcessLauncherNetBSD()

4.
Split "linux" and "netbsd" logging category, i.e. don't log NetBSD under
"linux".

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

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

diffstat:
 lldb-netbsd/distinfo                               | 15 +++---
 ...nclude_lldb_Host_netbsd_ProcessLauncherNetBSD.h |  8 +--
 .../patches/patch-source_Host_common_Host.cpp      | 60 ++++++++++++++++++++++
 ...ch-source_Host_common_NativeProcessProtocol.cpp | 12 ++---
 ...urce_Initialization_SystemInitializerCommon.cpp | 14 ++---
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp |  2 +-
 ...ce_Plugins_Process_NetBSD_NativeProcessNetBSD.h |  2 +-
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp |  2 +-
 ...rce_Plugins_Process_NetBSD_NativeThreadNetBSD.h |  2 +-
 9 files changed, 88 insertions(+), 29 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 20dfb3f..7b4bd45 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -15,22 +15,23 @@ Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
 SHA1 (patch-cmake_LLDBDependencies.cmake) = 81673d8624ca7a9ad60bcaf530587fbfbd695dca
 SHA1 (patch-cmake_modules_AddLLDB.cmake) = 39de9d6ff91641b9c625dbb95c2618f336be28c4
 SHA1 (patch-include_lldb_Host_netbsd_HostThreadNetBSD.h) = 79f207cdb9da2ef57d39eeb307ec6d10cf828925
-SHA1 (patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h) = 5422ae06ff064f0b522148a576a7e8d3b4ea1974
+SHA1 (patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h) = 2da864092aed3f3c212e6760138fb82b4aa5c594
 SHA1 (patch-source_CMakeLists.txt) = 5dacabc3f39c23bdfd432b5a4895866157b97aa0
 SHA1 (patch-source_Host_CMakeLists.txt) = b7b5fbf2354e05c33c63bf47ffa1ef58f58727ef
-SHA1 (patch-source_Host_common_NativeProcessProtocol.cpp) = 2446b1727d87e9d5e6e7a12f66d7263798ad554d
+SHA1 (patch-source_Host_common_Host.cpp) = 4d9b4f9ef3c2600c46e5f5d5f1f11aa59f15e87f
+SHA1 (patch-source_Host_common_NativeProcessProtocol.cpp) = 23cc7da280b2123cf0206f3d5660d2647935edbc
 SHA1 (patch-source_Host_netbsd_HostThreadNetBSD.cpp) = a1b0fbdad062309a845cfefe4469614fbbe9d20e
 SHA1 (patch-source_Host_netbsd_ProcessLauncherNetBSD.cpp) = 8f2999d3c57bb2776b048e112ec6b800fb0cea20
 SHA1 (patch-source_Host_netbsd_ThisThread.cpp) = f0d32c81bc1b8fe9aeb86519ea46ba2cb16571c2
-SHA1 (patch-source_Initialization_SystemInitializerCommon.cpp) = b8a2f94eb71dbd265701fdd62e3d36bc0d7081f1
+SHA1 (patch-source_Initialization_SystemInitializerCommon.cpp) = 80c850b980fe2902f10e441df7a18f428dd1154a
 SHA1 (patch-source_Plugins_Platform_NetBSD_PlatformNetBSD.cpp) = 129e853c1f93f063a0d30c737bcd82e3e589539b
 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) = fa6f32a3c93f2b17ddfdf263948e2235795a0c3e
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 73a67a193170ea34de9cc6df4763a35055efa437
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = a0c6195cd2339ddf66df91d06eb258248ac1b23d
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = a03e8e6159c9a7a927a2acc800b19c83b6e46de5
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 6c75f6bf86b434ff7d7bff7623d5994000080642
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 79f932301008b16f60fc77f345c3ec9eeb4dc4c6
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 27f4de5eb966e568db284be00c9e740bebe6d95d
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = ceeb4e5dbd0d63075cd3fcf95c73ae0caf5ec56a
 SHA1 (patch-tools_lldb-mi_MICmnBase.cpp) = 851c82ac61e1241018755fbd7236af00379ac986
 SHA1 (patch-tools_lldb-mi_MICmnBase.h) = f550d5e10bcf02fb46472733acdbb820791f22e5
 SHA1 (patch-tools_lldb-mi_MIDriver.cpp) = bf1b5399e82bcfe54d6d852f64ed155328f2064d
diff --git a/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h b/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h
index ab6d9a6..853e436 100644
--- a/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h
+++ b/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h
@@ -1,9 +1,9 @@
 $NetBSD$
 
---- include/lldb/Host/netbsd/ProcessLauncherNetBSD.h.orig	2016-12-17 13:17:22.052552467 +0000
+--- include/lldb/Host/netbsd/ProcessLauncherNetBSD.h.orig	2016-12-26 00:06:01.618251830 +0000
 +++ include/lldb/Host/netbsd/ProcessLauncherNetBSD.h
 @@ -0,0 +1,25 @@
-+//===-- ProcessLauncherAndroid.h --------------------------------*- C++ -*-===//
++//===-- ProcessLauncherNetBSD.h --------------------------------*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
 +//
@@ -12,8 +12,8 @@ $NetBSD$
 +//
 +//===----------------------------------------------------------------------===//
 +
-+#ifndef lldb_Host_android_ProcessLauncherAndroid_h_
-+#define lldb_Host_android_ProcessLauncherAndroid_h_
++#ifndef lldb_Host_netbsd_ProcessLauncherNetBSD_h_
++#define lldb_Host_netbsd_ProcessLauncherNetBSD_h_
 +
 +#include "lldb/Host/ProcessLauncher.h"
 +
diff --git a/lldb-netbsd/patches/patch-source_Host_common_Host.cpp b/lldb-netbsd/patches/patch-source_Host_common_Host.cpp
new file mode 100644
index 0000000..6dbef1a
--- /dev/null
+++ b/lldb-netbsd/patches/patch-source_Host_common_Host.cpp
@@ -0,0 +1,60 @@
+$NetBSD$
+
+--- source/Host/common/Host.cpp.orig	2016-12-17 10:30:38.000000000 +0000
++++ source/Host/common/Host.cpp
+@@ -40,6 +40,10 @@
+ #include <pthread_np.h>
+ #endif
+ 
++#if defined(__NetBSD__)
++#include <lwp.h>
++#endif
++
+ // C++ Includes
+ 
+ // Other libraries and framework includes
+@@ -69,6 +73,8 @@
+ #include "lldb/Host/windows/ProcessLauncherWindows.h"
+ #elif defined(__linux__)
+ #include "lldb/Host/linux/ProcessLauncherLinux.h"
++#elif defined(__NetBSD__)
++#include "lldb/Host/netbsd/ProcessLauncherNetBSD.h"
+ #else
+ #include "lldb/Host/posix/ProcessLauncherPosix.h"
+ #endif
+@@ -324,6 +330,8 @@ lldb::tid_t Host::GetCurrentThreadID() {
+   return lldb::tid_t(gettid());
+ #elif defined(__linux__)
+   return lldb::tid_t(syscall(SYS_gettid));
++#elif defined(__NetBSD__)
++  return lldb::tid_t(_lwp_self());
+ #else
+   return lldb::tid_t(pthread_self());
+ #endif
+@@ -617,7 +625,7 @@ Error Host::RunShellCommand(const Args &
+   return error;
+ }
+ 
+-// LaunchProcessPosixSpawn for Apple, Linux, FreeBSD and other GLIBC
++// LaunchProcessPosixSpawn for Apple, Linux, FreeBSD, NetBSD and other GLIBC
+ // systems
+ 
+ #if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) ||        \
+@@ -694,7 +702,7 @@ Error Host::LaunchProcessPosixSpawn(cons
+   sigemptyset(&no_signals);
+   sigfillset(&all_signals);
+   ::posix_spawnattr_setsigmask(&attr, &no_signals);
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+   ::posix_spawnattr_setsigdefault(&attr, &no_signals);
+ #else
+   ::posix_spawnattr_setsigdefault(&attr, &all_signals);
+@@ -971,6 +979,8 @@ Error Host::LaunchProcess(ProcessLaunchI
+   delegate_launcher.reset(new ProcessLauncherWindows());
+ #elif defined(__linux__)
+   delegate_launcher.reset(new ProcessLauncherLinux());
++#elif defined(__NetBSD__)
++  delegate_launcher.reset(new ProcessLauncherNetBSD());
+ #else
+   delegate_launcher.reset(new ProcessLauncherPosix());
+ #endif
diff --git a/lldb-netbsd/patches/patch-source_Host_common_NativeProcessProtocol.cpp b/lldb-netbsd/patches/patch-source_Host_common_NativeProcessProtocol.cpp
index 7abb871..a13da38 100644
--- a/lldb-netbsd/patches/patch-source_Host_common_NativeProcessProtocol.cpp
+++ b/lldb-netbsd/patches/patch-source_Host_common_NativeProcessProtocol.cpp
@@ -2,16 +2,12 @@ $NetBSD$
 
 --- source/Host/common/NativeProcessProtocol.cpp.orig	2016-12-17 10:30:38.000000000 +0000
 +++ source/Host/common/NativeProcessProtocol.cpp
-@@ -411,6 +411,7 @@ Error NativeProcessProtocol::ResolveProc
+@@ -410,7 +410,7 @@ Error NativeProcessProtocol::ResolveProc
+     return Error("failed to retrieve a valid architecture from the exe module");
  }
  
- #ifndef __linux__
-+#if !defined(__NetBSD__)
+-#ifndef __linux__
++#if !defined(__linux__) && !defined(__NetBSD__)
  // These need to be implemented to support lldb-gdb-server on a given platform.
  // Stubs are
  // provided to make the rest of the code link on non-supported platforms.
-@@ -430,3 +431,4 @@ Error NativeProcessProtocol::Attach(lldb
- }
- 
- #endif
-+#endif
diff --git a/lldb-netbsd/patches/patch-source_Initialization_SystemInitializerCommon.cpp b/lldb-netbsd/patches/patch-source_Initialization_SystemInitializerCommon.cpp
index e031bde..0db2090 100644
--- a/lldb-netbsd/patches/patch-source_Initialization_SystemInitializerCommon.cpp
+++ b/lldb-netbsd/patches/patch-source_Initialization_SystemInitializerCommon.cpp
@@ -11,12 +11,14 @@ $NetBSD$
  #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
  #endif
  
-@@ -93,7 +93,7 @@ void SystemInitializerCommon::Initialize
- #if defined(__APPLE__)
-   ObjectFileMachO::Initialize();
- #endif
--#if defined(__linux__)
-+#if defined(__linux__) || defined(__NetBSD__)
+@@ -97,6 +97,10 @@ void SystemInitializerCommon::Initialize
    static ConstString g_linux_log_name("linux");
    ProcessPOSIXLog::Initialize(g_linux_log_name);
  #endif
++#if defined(__NetBSD__)
++  static ConstString g_netbsd_log_name("netbsd");
++  ProcessPOSIXLog::Initialize(g_netbsd_log_name);
++#endif
+ #if defined(_MSC_VER)
+   ProcessWindowsLog::Initialize();
+ #endif
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 ba00095..8c1013f 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	2016-12-24 07:25:32.142702421 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2016-12-26 00:06:02.274927609 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
 @@ -0,0 +1,1592 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
index 1628424..1d13b5c 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.h.orig	2016-12-24 07:25:32.149555108 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.h.orig	2016-12-26 00:06:02.335419166 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
 @@ -0,0 +1,180 @@
 +//===-- NativeProcessNetBSD.h ---------------------------------- -*- C++ -*-===//
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
index a44c3b6..d1b7c7b 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2016-12-24 07:25:32.155843686 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2016-12-26 00:06:02.394454741 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
 @@ -0,0 +1,167 @@
 +//===-- NativeThreadNetBSD.cpp --------------------------------- -*- C++ -*-===//
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
index f703c91..2292b6c 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeThreadNetBSD.h.orig	2016-12-24 07:25:32.162123674 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.h.orig	2016-12-26 00:06:02.439980709 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
 @@ -0,0 +1,77 @@
 +//===-- NativeThreadNetBSD.h ----------------------------------- -*- C++ -*-===//


Home | Main Index | Thread Index | Old Index