pkgsrc-WIP-changes archive

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

lldb-netbsd: Resurrect lldb to a functional stage



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Mar 23 22:10:41 2017 +0100
Changeset:	120d1baf8955db69bb7b4d7ea4b29d3aa07d09a5

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: Resurrect lldb to a functional stage

Add stub for retrieveing a thread name.
Refactor code for AUXV reading.

===================
Test Result Summary
===================
Test Methods:       1247
Reruns:                0
Success:             608
Expected Failure:     23
Failure:              94
Error:                89
Exceptional Exit:      0
Unexpected Success:    1
Skip:                431
Timeout:               1
Expected Timeout:      0

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=120d1baf8955db69bb7b4d7ea4b29d3aa07d09a5

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 | 31 ++++++++++------------
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp |  4 +--
 3 files changed, 18 insertions(+), 21 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index ded72fac10..c88550ee6d 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -17,13 +17,13 @@ SHA1 (patch-source_Host_common_Host.cpp) = 7d48b8bb1e4350ba6d3ddc6357b9b8dc82d6b
 SHA1 (patch-source_Host_netbsd_Host.cpp) = 92ea9aa9c21d11126e7532a860e59f408175d8d4
 SHA1 (patch-source_Plugins_DynamicLoader_POSIX-DYLD_DYLDRendezvous.cpp) = 32d683eb388ded96e7f9aedec827202b5b056392
 SHA1 (patch-source_Plugins_Process_NetBSD_CMakeLists.txt) = 558379a5f3b47235dbf670742467e64c05e5900f
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = d4695c351974a6df766b4f4b63acf2314541cc46
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = a504bdd4df9648786ade24f01186b01178dc620d
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 3c9d87046a4399f4ca8a48721b81b49b416ac3e0
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = 53e098aaaf0b124d98ce57569065924cd8569151
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = be4c4eae10cf5d18ad6e6f0523aaf59ce60cde5b
 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) = 872d32b6f534c1fbcb1c6c2c584085b161d07f74
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 671e0779fb92bbcc7fd1a9fb7bee702096e674ca
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = cc8cfee5f3740e2495282f376428963bb388b844
 SHA1 (patch-source_Plugins_Process_elf-core_ThreadElfCore.cpp) = 3427bd2e2de3cd2947123c2f20ed8d5082a16ace
 SHA1 (patch-source_Plugins_Process_minidump_ProcessMinidump.cpp) = a71464df2ef56b8b2c8905e8169a85a05cfd27ba
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 9364a14665..54a0c8627b 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-21 20:01:05.000000000 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-03-23 15:49:53.245269544 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -10,16 +10,59 @@
+@@ -10,16 +10,61 @@
  #include "NativeProcessNetBSD.h"
  
  // C Includes
@@ -45,6 +45,8 @@ $NetBSD$
 +#include "lldb/Utility/StringExtractor.h"
 +#include "lldb/Utility/DataBufferHeap.h"
  
++#include "llvm/Support/MemoryBuffer.h"
++
 +#include "NativeThreadNetBSD.h"
  #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
  
@@ -62,7 +64,7 @@ $NetBSD$
  
  using namespace lldb;
  using namespace lldb_private;
-@@ -27,6 +70,132 @@ using namespace lldb_private::process_ne
+@@ -27,6 +72,132 @@ using namespace lldb_private::process_ne
  using namespace llvm;
  
  // -----------------------------------------------------------------------------
@@ -195,7 +197,7 @@ $NetBSD$
  // Public Static Methods
  // -----------------------------------------------------------------------------
  
-@@ -34,18 +203,1218 @@ Error NativeProcessProtocol::Launch(
+@@ -34,18 +205,1213 @@ Error NativeProcessProtocol::Launch(
      ProcessLaunchInfo &launch_info,
      NativeProcessProtocol::NativeDelegate &native_delegate, MainLoop &mainloop,
      NativeProcessProtocolSP &native_process_sp) {
@@ -1306,7 +1308,6 @@ $NetBSD$
 +}
 +
 +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)
@@ -1315,30 +1316,26 @@ $NetBSD$
 +   * 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));
++  ErrorOr<std::unique_ptr<MemoryBuffer>> buf = llvm::MemoryBuffer::getNewMemBuffer(auxv_size);
 +
 +  struct ptrace_io_desc io = {
 +    .piod_op = PIOD_READ_AUXV,
 +    .piod_offs = 0,
-+    .piod_addr = buf_ap->GetBytes(),
++    .piod_addr = (void *)buf.get()->getBufferStart(),
 +    .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 std::error_code(error.GetError(), std::generic_category());
 +
-+  return buf_sp;
-+#endif
++  if (io.piod_len < 1)
++    return std::error_code(ECANCELED, std::generic_category());
++
++  return buf;
 +}
 +
 +//===----------------------------------------------------------------------===//
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 fe98255f14..5477e72f06 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2017-03-21 20:01:05.000000000 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2017-03-23 15:49:53.244428227 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
 @@ -11,11 +11,398 @@
  #include "NativeRegisterContextNetBSD.h"
@@ -80,7 +80,7 @@ $NetBSD$
 +  // const NativeProcessNetBSD *const process =
 +  // reinterpret_cast<NativeProcessNetBSD*> (process_sp->get ());
 +  llvm::SmallString<32> thread_name;
-+  return NULL;
++  return std::string("");
 +}
 +
 +lldb::StateType NativeThreadNetBSD::GetState() { return m_state; }


Home | Main Index | Thread Index | Old Index