pkgsrc-WIP-changes archive

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

lldb-netbsd: Catch up after OpenBSD and support core files on amd64



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Mar 27 02:49:41 2017 +0200
Changeset:	987c87bccc46f26ccb078a6b1cd550fe1bec6645

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
Added Files:
	lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp

Log Message:
lldb-netbsd: Catch up after OpenBSD and support core files on amd64

OpenBSD supports core files on amd64, i386, arm, arm64.

Catch up on NetBSD and go for amd64 right now. This is work in progress.

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=987c87bccc46f26ccb078a6b1cd550fe1bec6645

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

diffstat:
 lldb-netbsd/distinfo                               |  5 +-
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp |  2 +-
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp |  2 +-
 ...rce_Plugins_Process_elf-core_ProcessElfCore.cpp | 60 ++++++++++++++++++++++
 4 files changed, 65 insertions(+), 4 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index c88550ee6d..23509ae8ba 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -17,13 +17,14 @@ 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) = a504bdd4df9648786ade24f01186b01178dc620d
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = ef68288982961753e342ed8c9dd599991087ba1a
 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) = 671e0779fb92bbcc7fd1a9fb7bee702096e674ca
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 1aedd86c5571e8def23da1ff44c5f44852bd2f76
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = cc8cfee5f3740e2495282f376428963bb388b844
+SHA1 (patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp) = 0a64e526ed3eca089ee54d3bb54385f4d26fc7d1
 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 54a0c8627b..38b7bdfbea 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-03-23 15:49:53.245269544 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-03-23 15:49:53.000000000 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
 @@ -10,16 +10,61 @@
  #include "NativeProcessNetBSD.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 5477e72f06..b5018840b7 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-23 15:49:53.244428227 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2017-03-23 15:49:53.000000000 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
 @@ -11,11 +11,398 @@
  #include "NativeRegisterContextNetBSD.h"
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp
new file mode 100644
index 0000000000..f6369d7e3e
--- /dev/null
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp
@@ -0,0 +1,60 @@
+$NetBSD$
+
+--- source/Plugins/Process/elf-core/ProcessElfCore.cpp.orig	2017-03-27 00:48:38.266378385 +0000
++++ source/Plugins/Process/elf-core/ProcessElfCore.cpp
+@@ -449,6 +449,16 @@ enum {
+ };
+ }
+ 
++namespace NETBSD {
++
++enum {
++  NT_PROCINFO = 1,
++  NT_AUXV,
++  NT_AMD64_REGS = 33,
++  NT_AMD64_FPREGS = 35
++};
++}
++
+ // Parse a FreeBSD NT_PRSTATUS note - see FreeBSD sys/procfs.h for details.
+ static void ParseFreeBSDPrStatus(ThreadData &thread_data, DataExtractor &data,
+                                  ArchSpec &arch) {
+@@ -485,6 +495,18 @@ static void ParseFreeBSDThrMisc(ThreadDa
+   thread_data.name = data.GetCStr(&offset, 20);
+ }
+ 
++static void ParseNetBSDProcInfo(ThreadData &thread_data, DataExtractor &data)
++{
++  lldb::offset_t offset = 0;
++  
++  int version = data.GetU32(&offset);
++  if (version != 1)
++	  return;
++
++  offset += 4;
++  thread_data.signo = data.GetU32(&offset);
++}
++
+ static void ParseOpenBSDProcInfo(ThreadData &thread_data, DataExtractor &data)
+ {
+   lldb::offset_t offset = 0;
+@@ -585,6 +607,19 @@ Error ProcessElfCore::ParseThreadContext
+       default:
+         break;
+       }
++    } else if (note.n_name.substr(0, 11) == "NetBSD-CORE") {
++      // NetBSD per-thread information is stored in notes named
++      // "NetBSD-CORE@nnn" so match on the initial part of the string.
++      m_os = llvm::Triple::NetBSD;
++      if (note.n_type == NETBSD::NT_PROCINFO) {
++	 ParseNetBSDProcInfo(*thread_data, note_data);
++      } else if (note.n_type == NETBSD::NT_AUXV) {
++         m_auxv = DataExtractor(note_data);
++      } else if (arch.GetMachine() == llvm::Triple::x86_64 && note.n_type == NETBSD::NT_AMD64_REGS) {
++	thread_data->gpregset = note_data;
++      } else if (arch.GetMachine() == llvm::Triple::x86_64 && note.n_type == NETBSD::NT_AMD64_FPREGS) {
++	thread_data->fpregset = note_data;
++      }
+     } else if (note.n_name.substr(0, 7) == "OpenBSD") {
+       // OpenBSD per-thread information is stored in notes named
+       // "OpenBSD@nnn" so match on the initial part of the string.


Home | Main Index | Thread Index | Old Index