pkgsrc-WIP-changes archive

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

lldb-netbsd: Add support for retrieving pid from thread in Register Context



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Mar 2 01:44:18 2017 +0100
Changeset:	d2a8e52387e9d43ad0647403eacbf47b5b1cf792

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

Log Message:
lldb-netbsd: Add support for retrieving pid from thread in Register Context

This should be the latest part required for correct ptrace(2) calls.

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

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

diffstat:
 lldb-netbsd/distinfo                               |  4 +--
 ..._Process_NetBSD_NativeRegisterContextNetBSD.cpp | 29 ++++++++++++++++++----
 ...ns_Process_NetBSD_NativeRegisterContextNetBSD.h |  4 ++-
 3 files changed, 29 insertions(+), 8 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 5e7a9d582a..651ec0542a 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -25,8 +25,8 @@ SHA1 (patch-source_Plugins_Process_CMakeLists.txt) = c689ff4ec455234f8d506dc9eb8
 SHA1 (patch-source_Plugins_Process_NetBSD_CMakeLists.txt) = a77f397020ab752875813a7a93b53ccd3a130e6f
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 037094d3eaa832eaf2b3719833d2d3c46101e03e
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = c48bb2dd45682164ab904b8b3f7664b91ac35d5b
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = 2dff3507976723d6658e7b2527a9b689bdb7d2d6
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = d7f77fcd065f608a87e724a850dacf4e3fd8d056
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = b15ba9af606d18188dfac0e8ee39f88eae37e8f9
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = e27bbdced40cce10524ac00e91480d0d84195722
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = a5db8c3cf6cd7157093bf77944722f88cbff6325
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h) = 58803697f65411d1ad62e45c6af68c9271633bac
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = cb8757705327e62273bfe9a84dbdbf9cb9b0751a
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 7245ae998b..9415786848 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	2017-03-01 11:04:39.184136620 +0000
 +++ source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
-@@ -0,0 +1,97 @@
+@@ -0,0 +1,116 @@
 +//===-- NativeRegisterContextNetBSD.cpp --------------------------*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -82,21 +82,40 @@ $NetBSD$
 +}
 +
 +Error NativeRegisterContextNetBSD::DoReadGPR(void *buf) {
-+  return NativeProcessNetBSD::PtraceWrapper(PT_GETREGS, 0,
++  NativeProcessNetBSD &process = GetProcess();
++  lldb::pid_t pid = process.GetID();
++
++  return NativeProcessNetBSD::PtraceWrapper(PT_GETREGS, pid,
 +                                            buf, m_thread.GetID());
 +}
 +
 +Error NativeRegisterContextNetBSD::DoWriteGPR(void *buf) {
-+  return NativeProcessNetBSD::PtraceWrapper(PT_SETREGS, 0,
++  NativeProcessNetBSD &process = GetProcess();
++  lldb::pid_t pid = process.GetID();
++
++  return NativeProcessNetBSD::PtraceWrapper(PT_SETREGS, pid,
 +                                            buf, m_thread.GetID());
 +}
 +
 +Error NativeRegisterContextNetBSD::DoReadFPR(void *buf) {
-+  return NativeProcessNetBSD::PtraceWrapper(PT_GETFPREGS, 0,
++  NativeProcessNetBSD &process = GetProcess();
++  lldb::pid_t pid = process.GetID();
++
++  return NativeProcessNetBSD::PtraceWrapper(PT_GETFPREGS, pid,
 +                                            buf, m_thread.GetID());
 +}
 +
 +Error NativeRegisterContextNetBSD::DoWriteFPR(void *buf) {
-+  return NativeProcessNetBSD::PtraceWrapper(PT_SETFPREGS, 0,
++  NativeProcessNetBSD &process = GetProcess();
++  lldb::pid_t pid = process.GetID();
++
++  return NativeProcessNetBSD::PtraceWrapper(PT_SETFPREGS, pid,
 +                                            buf, m_thread.GetID());
 +}
++
++NativeProcessNetBSD &NativeRegisterContextNetBSD::GetProcess() {
++  auto process_sp = std::static_pointer_cast<NativeProcessNetBSD>(
++      m_thread.GetProcess());
++  assert(process_sp);
++  return *process_sp;
++}
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 297b6086d5..ed0d266fbd 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h.orig	2017-03-01 11:04:42.048407244 +0000
 +++ source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
-@@ -0,0 +1,72 @@
+@@ -0,0 +1,74 @@
 +//===-- NativeRegisterContextNetBSD.h ----------------------------*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -69,6 +69,8 @@ $NetBSD$
 +  virtual Error DoReadFPR(void *buf);
 +
 +  virtual Error DoWriteFPR(void *buf);
++
++  virtual NativeProcessNetBSD &GetProcess();
 +};
 +
 +} // namespace process_netbsd


Home | Main Index | Thread Index | Old Index