pkgsrc-WIP-changes archive

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

lldb-netbsd: Catch up after upstream changes (after rebase)



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Mar 20 14:14:19 2017 +0100
Changeset:	26e685ddc04f6a913c5aee1f6f056d975c15cdc6

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
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp

Log Message:
lldb-netbsd: Catch up after upstream changes (after rebase)

Update includes.
Update code for AUXV reading.

It still does not build, but it's a step forwards.

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=26e685ddc04f6a913c5aee1f6f056d975c15cdc6

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

diffstat:
 lldb-netbsd/distinfo                               |  8 ++--
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp | 44 ++++++++++++++++++++--
 ...ce_Plugins_Process_NetBSD_NativeProcessNetBSD.h |  7 +++-
 ...NetBSD_NativeRegisterContextNetBSD__x86__64.cpp |  6 +--
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp |  9 ++---
 5 files changed, 57 insertions(+), 17 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 7075ba039a..b3ff7545e9 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -22,13 +22,13 @@ SHA1 (patch-source_Plugins_DynamicLoader_POSIX-DYLD_DYLDRendezvous.cpp) = 32d683
 SHA1 (patch-source_Plugins_DynamicLoader_POSIX-DYLD_DynamicLoaderPOSIXDYLD.cpp) = ed8077e029281f6d1a9f043edc5a3b16d126eea2
 SHA1 (patch-source_Plugins_Process_CMakeLists.txt) = c689ff4ec455234f8d506dc9eb8e0ed7f750d426
 SHA1 (patch-source_Plugins_Process_NetBSD_CMakeLists.txt) = a77f397020ab752875813a7a93b53ccd3a130e6f
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = f3c6ca6bad6f30f9282c70d0144feb821386f147
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = f051f86d7ca2047e9f4d414e46f454e626348c14
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 3d9df69888f03b2c92a7714800376857892238b7
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 740ff4ad3a66acf9fabae4f0d56fde5360076f48
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = 89a9f56d1ee3103ac73c274f233f0d6816e20363
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = dccd470b53937f58c5697f7e2507cc76db497ce8
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = 1f6c73419c4073cae519abf3259ccf3d7f48cb5b
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = f6aaa6193389041476a05f022ad55e18b4ec0e20
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h) = dee7f3fafaf4688d573075897293d42b498484bf
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = cb8757705327e62273bfe9a84dbdbf9cb9b0751a
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 532fba0c14becce84a555089f439258fa31f1846
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = c675af8495a75f99bb60cb4ab3fa36223f1cb6f4
 SHA1 (patch-source_Plugins_Process_elf-core_ThreadElfCore.cpp) = 3427bd2e2de3cd2947123c2f20ed8d5082a16ace
 SHA1 (patch-source_Plugins_Process_gdb-remote_GDBRemoteCommunicationServerCommon.cpp) = 76e3f6a3e0a24a28a2f5a30e8812906f8a2b2649
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 83f155c66a..89f789616e 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-03-14 16:45:14.522261905 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-03-18 01:37:22.314666401 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,1376 @@
+@@ -0,0 +1,1414 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -19,6 +19,7 @@ $NetBSD$
 +#include <sys/types.h>
 +#include <sys/sysctl.h>
 +#include <uvm/uvm_prot.h>
++#include <elf.h>
 +#include <errno.h>
 +#include <stdint.h>
 +#include <string.h>
@@ -52,6 +53,7 @@ $NetBSD$
 +#include "lldb/Utility/LLDBAssert.h"
 +#include "lldb/Host/PseudoTerminal.h"
 +#include "lldb/Utility/StringExtractor.h"
++#include "lldb/Utility/DataBufferHeap.h"
 +
 +#include "NativeThreadNetBSD.h"
 +#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
@@ -205,7 +207,7 @@ $NetBSD$
 +  FileSpec working_dir{launch_info.GetWorkingDirectory()};
 +  if (working_dir &&
 +      (!working_dir.ResolvePath() ||
-+       working_dir.GetFileType() != FileSpec::eFileTypeDirectory)) {
++       !llvm::sys::fs::is_directory(working_dir.GetPath()))) {
 +    error.SetErrorStringWithFormat("No such file or directory: %s",
 +                                   working_dir.GetCString());
 +    return error;
@@ -1302,6 +1304,42 @@ $NetBSD$
 +      NativeProcessProtocol::GetThreadByID(tid));
 +}
 +
++llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer> > NativeProcessNetBSD::GetAuxvData() const {
++#if 0
++  /*
++   * ELF_AUX_ENTRIES is currently restricted to kernel
++   * (<sys/exec_elf.h> r. 1.155 specifies 15)
++   *
++   * ptrace(2) returns the whole AUXV including extra fiels after AT_NULL this
++   * information isn't needed.
++   */
++  size_t auxv_size = 100 * sizeof(AuxInfo);
++  DataBufferSP buf_sp;
++
++  std::unique_ptr<DataBufferHeap> buf_ap(new DataBufferHeap(auxv_size, 0));
++
++  struct ptrace_io_desc io = {
++    .piod_op = PIOD_READ_AUXV,
++    .piod_offs = 0,
++    .piod_addr = buf_ap->GetBytes(),
++    .piod_len = auxv_size
++  };
++
++  Error error = NativeProcessNetBSD::PtraceWrapper(
++        PT_IO, GetID(), &io);
++  if (error.Fail())
++    return error;
++  if (io.piod_len < 1) {
++    perror("empty result for auxv");
++  } else {
++    /* Everything fine */
++    buf_sp.reset(buf_ap.release());
++  }
++
++  return buf_sp;
++#endif
++}
++
 +//===----------------------------------------------------------------------===//
 +
 +void NativeProcessNetBSD::SigchldHandler() {
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 dc03fa95eb..de2fda273c 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.h.orig	2017-03-14 16:45:14.529112718 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.h.orig	2017-03-18 01:37:22.321590104 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
-@@ -0,0 +1,185 @@
+@@ -0,0 +1,188 @@
 +//===-- NativeProcessNetBSD.h ---------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -101,6 +101,9 @@ $NetBSD$
 +
 +  NativeThreadNetBSDSP GetThreadByID(lldb::tid_t id);
 +
++  llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
++  GetAuxvData() const override;
++
 +  // ---------------------------------------------------------------------
 +  // Interface used by NativeRegisterContext-derived classes.
 +  // ---------------------------------------------------------------------
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 4b0362154b..8d5c6e3806 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
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp.orig	2017-03-14 16:45:14.549668075 +0000
+--- source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp.orig	2017-03-18 01:37:22.341045276 +0000
 +++ source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
 @@ -0,0 +1,553 @@
 +//===-- NativeRegisterContextNetBSD_x86_64.cpp ---------------*- C++ -*-===//
@@ -16,8 +16,8 @@ $NetBSD$
 +
 +#include "NativeRegisterContextNetBSD_x86_64.h"
 +
-+#include "lldb/Core/DataBufferHeap.h"
-+#include "lldb/Core/Log.h"
++#include "lldb/Utility/DataBufferHeap.h"
++#include "lldb/Utility/Log.h"
 +#include "lldb/Core/RegisterValue.h"
 +#include "lldb/Host/HostInfo.h"
 +#include "lldb/Utility/Error.h"
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 913a53de2d..c8ec728d5b 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2017-02-28 07:44:53.258980602 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2017-03-18 01:37:22.354054370 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
-@@ -0,0 +1,415 @@
+@@ -0,0 +1,414 @@
 +//===-- NativeThreadNetBSD.cpp --------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -20,7 +20,7 @@ $NetBSD$
 +
 +#include "NativeProcessNetBSD.h"
 +
-+#include "lldb/Core/Log.h"
++#include "lldb/Utility/Log.h"
 +#include "lldb/Core/State.h"
 +#include "lldb/Host/HostNativeThread.h"
 +#include "lldb/Utility/LLDBAssert.h"
@@ -94,8 +94,7 @@ $NetBSD$
 +  // const NativeProcessNetBSD *const process =
 +  // reinterpret_cast<NativeProcessNetBSD*> (process_sp->get ());
 +  llvm::SmallString<32> thread_name;
-+  HostNativeThread::GetName(GetID(), thread_name);
-+  return thread_name.c_str();
++  return NULL;
 +}
 +
 +lldb::StateType NativeThreadNetBSD::GetState() { return m_state; }


Home | Main Index | Thread Index | Old Index