pkgsrc-WIP-changes archive

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

lldb-netbsd: Fix PtraceWrapper() prototype, adaptions for GPR read on NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Dec 19 01:34:59 2016 +0100
Changeset:	0749df83af1aee6c89844700e7157a922065d462

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

Log Message:
lldb-netbsd: Fix PtraceWrapper() prototype, adaptions for GPR read on NetBSD

Kill also more i386 code.

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=0749df83af1aee6c89844700e7157a922065d462

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

diffstat:
 lldb-netbsd/distinfo                                 | 10 +++++-----
 ...urce_Plugins_Process_NetBSD_NativeProcessNetBSD.h |  5 ++---
 ...ns_Process_NetBSD_NativeRegisterContextNetBSD.cpp | 20 +++++++++-----------
 ...gins_Process_NetBSD_NativeRegisterContextNetBSD.h |  4 ++--
 ...s_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp | 10 ++--------
 ...ess_NetBSD_NativeRegisterContextNetBSD__x86__64.h |  8 +++-----
 6 files changed, 23 insertions(+), 34 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index e1c0d63..f5fab48 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -22,11 +22,11 @@ SHA1 (patch-source_Host_netbsd_ThisThread.cpp) = f0d32c81bc1b8fe9aeb86519ea46ba2
 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
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 201c4e5fcc7ac28f4c6d236d60935c0ee91f9259
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = 61512fb22cc5d1f4747a6af09d34723809fa8943
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = 2c45e7cd731a9c41fe14d866f9cd5ef5f838019b
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = 98e3381d060880450b6760ed108a7d9f5ba8dce8
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h) = bec448e65a6c72506a821624eb3d107c76f732af
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 7cf588554bab15f4cc5c8510e92884af52fff7e4
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = a886cdbe3444f7e228b9b5df77f47283262b0199
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = 83fdae48ce361a652709e126caae681e3af8428a
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = 43cfbfb9afc66c8d131f78847a65688e96a0f044
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h) = 18c60c7828dfa356dfe2cc6910a63137bb6143d3
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 2af7386b293d6a087fddd6b62a6712195bcd0892
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = b65394500b6c5d01fcf3294a57ec5a8a086df45a
 SHA1 (patch-source_Plugins_Process_NetBSD_ProcFileReader.cpp) = dff1193e16aa79d8a577a3db4a9056521911d6f1
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 c504095..b0d80fc 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,192 @@
+@@ -0,0 +1,191 @@
 +//===-- NativeProcessNetBSD.h ---------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -105,8 +105,7 @@ $NetBSD$
 +  // Interface used by NativeRegisterContext-derived classes.
 +  // ---------------------------------------------------------------------
 +  static Error PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr,
-+                             void *data = nullptr, size_t data_size = 0,
-+                             long *result = nullptr);
++                             int data = 0, int *result = nullptr);
 +
 +  bool SupportHardwareSingleStepping() const;
 +
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp
index 697eb94..59cb4bc 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp.orig	2016-12-17 13:23:23.783623245 +0000
 +++ source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
-@@ -0,0 +1,171 @@
+@@ -0,0 +1,169 @@
 +//===-- NativeRegisterContextNetBSD.cpp --------------------------*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -115,18 +115,16 @@ $NetBSD$
 +  void *buf = GetGPRBuffer();
 +  if (!buf)
 +    return Error("GPR buffer is NULL");
-+  size_t buf_size = GetGPRSize();
 +
-+  return DoReadGPR(buf, buf_size);
++  return DoReadGPR(buf);
 +}
 +
 +Error NativeRegisterContextNetBSD::WriteGPR() {
 +  void *buf = GetGPRBuffer();
 +  if (!buf)
 +    return Error("GPR buffer is NULL");
-+  size_t buf_size = GetGPRSize();
 +
-+  return DoWriteGPR(buf, buf_size);
++  return DoWriteGPR(buf);
 +}
 +
 +Error NativeRegisterContextNetBSD::DoReadRegisterValue(uint32_t offset,
@@ -165,12 +163,12 @@ $NetBSD$
 +      PTRACE_POKEUSER, m_thread.GetID(), reinterpret_cast<void *>(offset), buf);
 +}
 +
-+Error NativeRegisterContextNetBSD::DoReadGPR(void *buf, size_t buf_size) {
-+  return NativeProcessNetBSD::PtraceWrapper(PTRACE_GETREGS, m_thread.GetID(),
-+                                           nullptr, buf, buf_size);
++Error NativeRegisterContextNetBSD::DoReadGPR(void *buf) {
++  return NativeProcessNetBSD::PtraceWrapper(PT_GETREGS, GetID(), buf,
++                                           m_thread.GetID());
 +}
 +
-+Error NativeRegisterContextNetBSD::DoWriteGPR(void *buf, size_t buf_size) {
-+  return NativeProcessNetBSD::PtraceWrapper(PTRACE_SETREGS, m_thread.GetID(),
-+                                           nullptr, buf, buf_size);
++Error NativeRegisterContextNetBSD::DoWriteGPR(void *buf) {
++  return NativeProcessNetBSD::PtraceWrapper(PT_SETREGS, GetID(), buf,
++                                           m_thread.GetID());
 +}
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h
index 915403a..b8d2ff8 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h
@@ -68,9 +68,9 @@ $NetBSD$
 +  virtual Error DoWriteRegisterValue(uint32_t offset, const char *reg_name,
 +                                     const RegisterValue &value);
 +
-+  virtual Error DoReadGPR(void *buf, size_t buf_size);
++  virtual Error DoReadGPR(void *buf);
 +
-+  virtual Error DoWriteGPR(void *buf, size_t buf_size);
++  virtual Error DoWriteGPR(void *buf);
 +};
 +
 +} // namespace process_netbsd
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 9236ea5..04f7d62 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,321 @@
+@@ -0,0 +1,315 @@
 +//===-- NativeRegisterContextNetBSD_x86_64.cpp ---------------*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -215,8 +215,7 @@ $NetBSD$
 +                                              ? reg_info->name
 +                                              : "<unknown register>");
 +
-+  if (IsGPR(reg_index))
-+    return WriteRegisterRaw(reg_index, reg_value);
++  return WriteRegisterRaw(reg_index, reg_value);
 +
 +  return Error("failed - register wasn't recognized to be a GPR, "
 +               "write strategy unknown");
@@ -318,9 +317,4 @@ $NetBSD$
 +  return false;
 +}
 +
-+bool NativeRegisterContextNetBSD_x86_64::IsGPR(uint32_t reg_index) const {
-+  // GPRs come first.
-+  return reg_index <= m_reg_info.last_gpr;
-+}
-+
 +#endif // defined(__x86_64__)
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h
index 2c5838b..dc82f27 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h.orig	2016-12-17 13:23:23.784681789 +0000
 +++ source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,77 @@
 +//===-- NativeRegisterContextNetBSD_x86_64.h ---------------------*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -12,7 +12,7 @@ $NetBSD$
 +//
 +//===----------------------------------------------------------------------===//
 +
-+#if defined(__i386__) || defined(__x86_64__)
++#if defined(__x86_64__)
 +
 +#ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
 +#define lldb_NativeRegisterContextNetBSD_x86_64_h
@@ -72,8 +72,6 @@ $NetBSD$
 +  bool IsCPUFeatureAvailable(RegSet feature_code) const;
 +
 +  bool IsRegisterSetAvailable(uint32_t set_index) const;
-+
-+  bool IsGPR(uint32_t reg_index) const;
 +};
 +
 +} // namespace process_netbsd
@@ -81,4 +79,4 @@ $NetBSD$
 +
 +#endif // #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
 +
-+#endif // defined(__i386__) || defined(__x86_64__)
++#endif defined(__x86_64__)


Home | Main Index | Thread Index | Old Index