pkgsrc-WIP-changes archive

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

lldb-netbsd: Fix more fallout after recent changes and fix code bugs



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Dec 19 02:44:52 2016 +0100
Changeset:	2b575b968243690e01e59520efa0630bfc8a8d58

Modified Files:
	lldb-netbsd/distinfo
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp

Log Message:
lldb-netbsd: Fix more fallout after recent changes and fix code bugs

Fix typo tid -> pid.
Try to io.piod_len assignment.
Include <sys/ptrace.h>
Kill more register related 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=2b575b968243690e01e59520efa0630bfc8a8d58

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

diffstat:
 lldb-netbsd/distinfo                               |  4 ++--
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp |  7 ++++---
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp | 24 ++--------------------
 3 files changed, 8 insertions(+), 27 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 80dd6ae..f3415be 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -20,9 +20,9 @@ SHA1 (patch-source_Host_netbsd_HostThreadNetBSD.cpp) = a1b0fbdad062309a845cfefe4
 SHA1 (patch-source_Host_netbsd_ThisThread.cpp) = f0d32c81bc1b8fe9aeb86519ea46ba2cb16571c2
 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) = 9a95d51ba4f45ee532f68d041ed9d29653bcc339
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = a8d0c21f775aa8e0acfb1051716785897a6d560c
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 7cf588554bab15f4cc5c8510e92884af52fff7e4
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = f06d30a489349cbe0f92b876e7cc79d713cc2794
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 739cb25a654c746a6e6a7ed818b824205411e4fe
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = b65394500b6c5d01fcf3294a57ec5a8a086df45a
 SHA1 (patch-tools_lldb-mi_MICmnBase.cpp) = 851c82ac61e1241018755fbd7236af00379ac986
 SHA1 (patch-tools_lldb-mi_MICmnBase.h) = f550d5e10bcf02fb46472733acdbb820791f22e5
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 09218ba..5312759 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-19 01:22:58.080559848 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,1852 @@
+@@ -0,0 +1,1853 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -404,7 +404,7 @@ $NetBSD$
 +  int status;
 +  // Need to use WALLSIG otherwise we receive an error with errno=ECHLD
 +  // At this point we should have a thread stopped if waitpid succeeds.
-+  if ((status = waitpid(tid, NULL, WALLSIG)) < 0)
++  if ((status = waitpid(pid, NULL, WALLSIG)) < 0)
 +    return -1;
 +
 +  m_pid = pid;
@@ -1348,11 +1348,11 @@ $NetBSD$
 +
 +  bytes_read = 0;
 +  io.piod_op = PIOD_READ_D;
++  io.piod_len = size;
 +
 +  do {
 +    io.piod_offs = (void *)(addr + bytes_read);
 +    io.piod_offs = dst + bytes_read;
-+    io.piod_len = buf;
 +
 +    Error error = NativeProcessNetBSD::PtraceWrapper(
 +        PT_IO, GetID(), &io);
@@ -1363,6 +1363,7 @@ $NetBSD$
 +    }
 +
 +    bytes_read = io.piod_len;
++    io.piod_len = size - bytes_read;
 +  } while(bytes_read < size);
 +
 +  if (log)
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 fdc6f3d..f74e782 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2016-12-19 01:22:58.093122208 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
-@@ -0,0 +1,313 @@
+@@ -0,0 +1,293 @@
 +//===-- NativeThreadNetBSD.cpp --------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -29,6 +29,7 @@ $NetBSD$
 +
 +#include "Plugins/Process/POSIX/CrashReason.h"
 +
++#include <sys/ptrace.h>
 +#include <sys/syscall.h>
 +
 +using namespace lldb;
@@ -135,27 +136,6 @@ $NetBSD$
 +  llvm_unreachable("unhandled StateType!");
 +}
 +
-+NativeRegisterContextSP NativeThreadNetBSD::GetRegisterContext() {
-+  // Return the register context if we already created it.
-+  if (m_reg_context_sp)
-+    return m_reg_context_sp;
-+
-+  NativeProcessProtocolSP m_process_sp = m_process_wp.lock();
-+  if (!m_process_sp)
-+    return NativeRegisterContextSP();
-+
-+  ArchSpec target_arch;
-+  if (!m_process_sp->GetArchitecture(target_arch))
-+    return NativeRegisterContextSP();
-+
-+  const uint32_t concrete_frame_idx = 0;
-+  m_reg_context_sp.reset(
-+      NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD(
-+          target_arch, *this, concrete_frame_idx));
-+
-+  return m_reg_context_sp;
-+}
-+
 +Error NativeThreadNetBSD::Resume(uint32_t signo) {
 +  const StateType new_state = StateType::eStateRunning;
 +  MaybeLogStateChange(new_state);


Home | Main Index | Thread Index | Old Index