pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lldb-netbsd: Kill more unused code and fix path to <sys/exec_elf.h>
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Sat Dec 17 20:04:42 2016 +0100
Changeset: 3dc57c6a2d251a5f4df392e0a7f943cb3ba88ad1
Modified Files:
lldb-netbsd/distinfo
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_NativeRegisterContextNetBSD__x86__64.cpp
Log Message:
lldb-netbsd: Kill more unused code and fix path to <sys/exec_elf.h>
Remove remnants of ProcessVmReadvSupported() and SetDefaultPtraceOpts().
Remove switch for RegisterContextNetBSD_i386(), currently not intended
to be supported.
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=3dc57c6a2d251a5f4df392e0a7f943cb3ba88ad1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
lldb-netbsd/distinfo | 6 +--
..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp | 57 +---------------------
...ce_Plugins_Process_NetBSD_NativeProcessNetBSD.h | 4 +-
...NetBSD_NativeRegisterContextNetBSD__x86__64.cpp | 19 +++-----
4 files changed, 12 insertions(+), 74 deletions(-)
diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 7d1c854..9465c0a 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -18,11 +18,11 @@ SHA1 (patch-include_lldb_Host_netbsd_Ptrace.h) = 3ef61ded004c2acb81e132dc0e46d0a
SHA1 (patch-source_CMakeLists.txt) = 5dacabc3f39c23bdfd432b5a4895866157b97aa0
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) = 976522b07559dcf085a6793cef40ab8b3b031e2f
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 3177f7a17f3ab1fa8c155f2bcab6cbf2033644e9
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 44f4eafd7a2d7a6c96343e36b1f4733147c237b9
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 11641e9c3a5fdf4d9feb098c9c0bb2d9e05aa274
SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = cf569f95362538af5a2709aab9ff61770744a78d
SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = 558e8514b2a8f0595c0e375f308c53d8a9a6e9f1
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = c6acba5a851a283a978b3988070dee45318005f5
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = d372b0b6d8063f88dc1a48e3e457cc12e2864e18
SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h) = b92d756199555c2ba890afa383808ec094266cf1
SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = ef75b910fd7125ce5ed79b453ef5c304282e88a5
SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = 9ed9cd17600e661c7fc0e53a3ecb4db91fb62566
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 f0940e2..cdd0894 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-17 13:23:23.782610208 +0000
+++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,2685 @@
+@@ -0,0 +1,2630 @@
+//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
@@ -73,42 +73,6 @@ $NetBSD$
+using namespace lldb_private::process_netbsd;
+using namespace llvm;
+
-+// Private bits we only need internally.
-+
-+static bool ProcessVmReadvSupported() {
-+ static bool is_supported;
-+ static std::once_flag flag;
-+
-+ std::call_once(flag, [] {
-+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+
-+ uint32_t source = 0x47424742;
-+ uint32_t dest = 0;
-+
-+ struct iovec local, remote;
-+ remote.iov_base = &source;
-+ local.iov_base = &dest;
-+ remote.iov_len = local.iov_len = sizeof source;
-+
-+ // We shall try if cross-process-memory reads work by attempting to read a
-+ // value from our own process.
-+ ssize_t res = process_vm_readv(getpid(), &local, 1, &remote, 1, 0);
-+ is_supported = (res == sizeof(source) && source == dest);
-+ if (log) {
-+ if (is_supported)
-+ log->Printf("%s: Detected kernel support for process_vm_readv syscall. "
-+ "Fast memory reads enabled.",
-+ __FUNCTION__);
-+ else
-+ log->Printf("%s: syscall process_vm_readv failed (error: %s). Fast "
-+ "memory reads disabled.",
-+ __FUNCTION__, strerror(errno));
-+ }
-+ });
-+
-+ return is_supported;
-+}
-+
+namespace {
+void MaybeLogLaunchInfo(const ProcessLaunchInfo &info) {
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
@@ -378,21 +342,6 @@ $NetBSD$
+ log->Printf("NativeProcessNetBSD::%s inferior started, now in stopped state",
+ __FUNCTION__);
+
-+ error = SetDefaultPtraceOpts(pid);
-+ if (error.Fail()) {
-+ if (log)
-+ log->Printf("NativeProcessNetBSD::%s inferior failed to set default "
-+ "ptrace options: %s",
-+ __FUNCTION__, error.AsCString());
-+
-+ // Mark the inferior as invalid.
-+ // FIXME this could really use a new state - eStateLaunchFailure. For now,
-+ // using eStateInvalid.
-+ SetState(StateType::eStateInvalid);
-+
-+ return error;
-+ }
-+
+ // Release the master terminal descriptor and pass it off to the
+ // NativeProcessNetBSD instance. Similarly stash the inferior pid.
+ m_terminal_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor();
@@ -487,10 +436,6 @@ $NetBSD$
+ }
+ }
+
-+ error = SetDefaultPtraceOpts(tid);
-+ if (error.Fail())
-+ return -1;
-+
+ if (log)
+ log->Printf("NativeProcessNetBSD::%s() adding tid = %" PRIu64,
+ __FUNCTION__, tid);
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 9a8534e..c3d097f 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
@@ -2,7 +2,7 @@ $NetBSD$
--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.h.orig 2016-12-17 13:23:23.783483302 +0000
+++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
-@@ -0,0 +1,225 @@
+@@ -0,0 +1,223 @@
+//===-- NativeProcessNetBSD.h ---------------------------------- -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
@@ -145,8 +145,6 @@ $NetBSD$
+
+ ::pid_t Attach(lldb::pid_t pid, Error &error);
+
-+ static Error SetDefaultPtraceOpts(const lldb::pid_t);
-+
+ static void *MonitorThread(void *baton);
+
+ void MonitorCallback(lldb::pid_t pid, bool exited, int signal, int status);
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp
index d043cfd..84e9310 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp
@@ -2,7 +2,7 @@ $NetBSD$
--- source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp.orig 2016-12-17 13:23:23.784160224 +0000
+++ source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
-@@ -0,0 +1,1220 @@
+@@ -0,0 +1,1215 @@
+//===-- NativeRegisterContextNetBSD_x86_64.cpp ---------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
@@ -24,7 +24,7 @@ $NetBSD$
+
+#include "Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h"
+
-+#include <netbsd/elf.h>
++#include <sys/exec_elf.h>
+
+using namespace lldb_private;
+using namespace lldb_private::process_netbsd;
@@ -261,16 +261,11 @@ $NetBSD$
+
+static RegisterInfoInterface *
+CreateRegisterInfoInterface(const ArchSpec &target_arch) {
-+ if (HostInfo::GetArchitecture().GetAddressByteSize() == 4) {
-+ // 32-bit hosts run with a RegisterContextNetBSD_i386 context.
-+ return new RegisterContextNetBSD_i386(target_arch);
-+ } else {
-+ assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
-+ "Register setting path assumes this is a 64-bit host");
-+ // X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the
-+ // x86_64 register context.
-+ return new RegisterContextNetBSD_x86_64(target_arch);
-+ }
++ assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
++ "Register setting path assumes this is a 64-bit host");
++ // X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the
++ // x86_64 register context.
++ return new RegisterContextNetBSD_x86_64(target_arch);
+}
+
+NativeRegisterContextNetBSD_x86_64::NativeRegisterContextNetBSD_x86_64(
Home |
Main Index |
Thread Index |
Old Index