pkgsrc-WIP-changes archive

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

lldb-netbsd: Start moving HostThreadNetBSD from pthread_t to LWPs



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sun Dec 18 03:35:43 2016 +0100
Changeset:	308fec3153636bb5cb3905f46632e3cb4d8dcbdd

Modified Files:
	lldb-netbsd/distinfo
Added Files:
	lldb-netbsd/patches/patch-include_lldb_Host_netbsd_HostThreadNetBSD.h
	lldb-netbsd/patches/patch-source_Host_netbsd_HostThreadNetBSD.cpp

Log Message:
lldb-netbsd: Start moving HostThreadNetBSD from pthread_t to LWPs

Kill SetName() for now (it's also absent in FreeBSD).
Nullify GetName() as it wasn't functional and alter its argument from
pthread_t to lwpid_t.

The current approach is to operate on raw LWPs in LLDB, and export pthread_t
properties via pthread_dbg(3) on demand.

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=308fec3153636bb5cb3905f46632e3cb4d8dcbdd

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

diffstat:
 lldb-netbsd/distinfo                                |  2 ++
 ...atch-include_lldb_Host_netbsd_HostThreadNetBSD.h | 14 ++++++++++++++
 .../patch-source_Host_netbsd_HostThreadNetBSD.cpp   | 21 +++++++++++++++++++++
 3 files changed, 37 insertions(+)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 09159c4..735104d 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -13,9 +13,11 @@ SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
 SHA1 (patch-cmake_LLDBDependencies.cmake) = 81673d8624ca7a9ad60bcaf530587fbfbd695dca
+SHA1 (patch-include_lldb_Host_netbsd_HostThreadNetBSD.h) = 79f207cdb9da2ef57d39eeb307ec6d10cf828925
 SHA1 (patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h) = 5422ae06ff064f0b522148a576a7e8d3b4ea1974
 SHA1 (patch-include_lldb_Host_netbsd_Ptrace.h) = 3ef61ded004c2acb81e132dc0e46d0a764977f92
 SHA1 (patch-source_CMakeLists.txt) = 5dacabc3f39c23bdfd432b5a4895866157b97aa0
+SHA1 (patch-source_Host_netbsd_HostThreadNetBSD.cpp) = a1b0fbdad062309a845cfefe4469614fbbe9d20e
 SHA1 (patch-source_Plugins_Process_CMakeLists.txt) = c0168f81da56d9896eb414e6b8bb7262de04ac33
 SHA1 (patch-source_Plugins_Process_NetBSD_CMakeLists.txt) = 8c1d8274523f6ef4bce90caa6c981160ef930cb9
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 8721193630aba8972204998b535fdb2cd64c7fb9
diff --git a/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_HostThreadNetBSD.h b/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_HostThreadNetBSD.h
new file mode 100644
index 0000000..e278507
--- /dev/null
+++ b/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_HostThreadNetBSD.h
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- include/lldb/Host/netbsd/HostThreadNetBSD.h.orig	2016-12-17 10:34:14.000000000 +0000
++++ include/lldb/Host/netbsd/HostThreadNetBSD.h
+@@ -22,8 +22,7 @@ public:
+   HostThreadNetBSD();
+   HostThreadNetBSD(lldb::thread_t thread);
+ 
+-  static void SetName(lldb::thread_t tid, llvm::StringRef &name);
+-  static void GetName(lldb::thread_t tid, llvm::SmallVectorImpl<char> &name);
++  static void GetName(lldb::tid_t tid, llvm::SmallVectorImpl<char> &name);
+ };
+ }
+ 
diff --git a/lldb-netbsd/patches/patch-source_Host_netbsd_HostThreadNetBSD.cpp b/lldb-netbsd/patches/patch-source_Host_netbsd_HostThreadNetBSD.cpp
new file mode 100644
index 0000000..3604185
--- /dev/null
+++ b/lldb-netbsd/patches/patch-source_Host_netbsd_HostThreadNetBSD.cpp
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- source/Host/netbsd/HostThreadNetBSD.cpp.orig	2016-12-17 10:30:35.000000000 +0000
++++ source/Host/netbsd/HostThreadNetBSD.cpp
+@@ -29,15 +29,7 @@ HostThreadNetBSD::HostThreadNetBSD() {}
+ HostThreadNetBSD::HostThreadNetBSD(lldb::thread_t thread)
+     : HostThreadPosix(thread) {}
+ 
+-void HostThreadNetBSD::SetName(lldb::thread_t thread, llvm::StringRef &name) {
+-  ::pthread_setname_np(thread, "%s", const_cast<char *>(name.data()));
+-}
+-
+-void HostThreadNetBSD::GetName(lldb::thread_t thread,
++void HostThreadNetBSD::GetName(lldb::tid_t thread,
+                                llvm::SmallVectorImpl<char> &name) {
+-  char buf[PTHREAD_MAX_NAMELEN_NP];
+-  ::pthread_getname_np(thread, buf, PTHREAD_MAX_NAMELEN_NP);
+-
+   name.clear();
+-  name.append(buf, buf + strlen(buf));
+ }


Home | Main Index | Thread Index | Old Index