[Lldb-commits] [lldb] r318399 - Implement core dump debugging for PPC64le

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 16 05:38:57 PST 2017


Author: labath
Date: Thu Nov 16 05:38:57 2017
New Revision: 318399

URL: http://llvm.org/viewvc/llvm-project?rev=318399&view=rev
Log:
Implement core dump debugging for PPC64le

Summary: Implement core dump debugging for PPC64le.

Reviewers: labath

Reviewed By: labath

Subscribers: JDevlieghere, krytarowski, clayborg, labath, lbianc, nemanjai, gut, anajuliapc, mgorny, kbarton, lldb-commits

Differential Revision: https://reviews.llvm.org/D39681
Patch by Alexandre Yukio Yamashita <alexandre.yamashita at eldorado.org.br>

Added:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.core
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out   (with props)
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h
    lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h
Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
    lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h
    lldb/trunk/source/Plugins/Process/elf-core/CMakeLists.txt
    lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
    lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
    lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py?rev=318399&r1=318398&r2=318399&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py Thu Nov 16 05:38:57 2017
@@ -24,11 +24,13 @@ class LinuxCoreTestCase(TestBase):
     _mips64_n64_pid = 25619
     _mips64_n32_pid = 3670
     _mips_o32_pid = 3532
+    _ppc64le_pid = 28147
 
     _i386_regions = 4
     _x86_64_regions = 5
     _s390x_regions = 2
     _mips_regions = 5
+    _ppc64le_regions = 2
 
     def setUp(self):
         super(LinuxCoreTestCase, self).setUp()
@@ -58,6 +60,12 @@ class LinuxCoreTestCase(TestBase):
 
     @skipIf(oslist=['windows'])
     @skipIf(triple='^mips')
+    def test_ppc64le(self):
+        """Test that lldb can read the process information from an ppc64le linux core file."""
+        self.do_test("linux-ppc64le", self._ppc64le_pid, self._ppc64le_regions)
+
+    @skipIf(oslist=['windows'])
+    @skipIf(triple='^mips')
     def test_x86_64(self):
         """Test that lldb can read the process information from an x86_64 linux core file."""
         self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions)

Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.core
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.core?rev=318399&view=auto
==============================================================================
Binary files lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.core (added) and lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.core Thu Nov 16 05:38:57 2017 differ

Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out?rev=318399&view=auto
==============================================================================
Binary files lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out (added) and lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out Thu Nov 16 05:38:57 2017 differ

Propchange: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out
------------------------------------------------------------------------------
    svn:executable = *

Modified: lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt?rev=318399&r1=318398&r2=318399&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt Thu Nov 16 05:38:57 2017
@@ -39,6 +39,7 @@ add_lldb_library(lldbPluginProcessUtilit
   RegisterContextPOSIX_arm64.cpp
   RegisterContextPOSIX_mips64.cpp
   RegisterContextPOSIX_powerpc.cpp
+  RegisterContextPOSIX_ppc64le.cpp
   RegisterContextPOSIX_s390x.cpp
   RegisterContextPOSIX_x86.cpp
   RegisterContextThreadMemory.cpp

Added: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp?rev=318399&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp (added)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp Thu Nov 16 05:38:57 2017
@@ -0,0 +1,216 @@
+//===-- RegisterContextPOSIX_ppc64le.cpp -------------------------*- C++-*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <cstring>
+#include <errno.h>
+#include <stdint.h>
+
+#include "lldb/Core/RegisterValue.h"
+#include "lldb/Core/Scalar.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
+#include "lldb/Utility/Endian.h"
+#include "llvm/Support/Compiler.h"
+
+#include "Plugins/Process/elf-core/ProcessElfCore.h"
+#include "RegisterContextPOSIX_ppc64le.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+static const uint32_t g_gpr_regnums[] = {
+    gpr_r0_ppc64le,   gpr_r1_ppc64le,  gpr_r2_ppc64le,     gpr_r3_ppc64le,
+    gpr_r4_ppc64le,   gpr_r5_ppc64le,  gpr_r6_ppc64le,     gpr_r7_ppc64le,
+    gpr_r8_ppc64le,   gpr_r9_ppc64le,  gpr_r10_ppc64le,    gpr_r11_ppc64le,
+    gpr_r12_ppc64le,  gpr_r13_ppc64le, gpr_r14_ppc64le,    gpr_r15_ppc64le,
+    gpr_r16_ppc64le,  gpr_r17_ppc64le, gpr_r18_ppc64le,    gpr_r19_ppc64le,
+    gpr_r20_ppc64le,  gpr_r21_ppc64le, gpr_r22_ppc64le,    gpr_r23_ppc64le,
+    gpr_r24_ppc64le,  gpr_r25_ppc64le, gpr_r26_ppc64le,    gpr_r27_ppc64le,
+    gpr_r28_ppc64le,  gpr_r29_ppc64le, gpr_r30_ppc64le,    gpr_r31_ppc64le,
+    gpr_pc_ppc64le,   gpr_msr_ppc64le, gpr_origr3_ppc64le, gpr_ctr_ppc64le,
+    gpr_lr_ppc64le,   gpr_xer_ppc64le, gpr_cr_ppc64le,     gpr_softe_ppc64le,
+    gpr_trap_ppc64le,
+};
+
+static const uint32_t g_fpr_regnums[] = {
+    fpr_f0_ppc64le,    fpr_f1_ppc64le,  fpr_f2_ppc64le,  fpr_f3_ppc64le,
+    fpr_f4_ppc64le,    fpr_f5_ppc64le,  fpr_f6_ppc64le,  fpr_f7_ppc64le,
+    fpr_f8_ppc64le,    fpr_f9_ppc64le,  fpr_f10_ppc64le, fpr_f11_ppc64le,
+    fpr_f12_ppc64le,   fpr_f13_ppc64le, fpr_f14_ppc64le, fpr_f15_ppc64le,
+    fpr_f16_ppc64le,   fpr_f17_ppc64le, fpr_f18_ppc64le, fpr_f19_ppc64le,
+    fpr_f20_ppc64le,   fpr_f21_ppc64le, fpr_f22_ppc64le, fpr_f23_ppc64le,
+    fpr_f24_ppc64le,   fpr_f25_ppc64le, fpr_f26_ppc64le, fpr_f27_ppc64le,
+    fpr_f28_ppc64le,   fpr_f29_ppc64le, fpr_f30_ppc64le, fpr_f31_ppc64le,
+    fpr_fpscr_ppc64le,
+};
+
+static const uint32_t g_vmx_regnums[] = {
+    vmx_vr0_ppc64le,  vmx_vr1_ppc64le,    vmx_vr2_ppc64le,  vmx_vr3_ppc64le,
+    vmx_vr4_ppc64le,  vmx_vr5_ppc64le,    vmx_vr6_ppc64le,  vmx_vr7_ppc64le,
+    vmx_vr8_ppc64le,  vmx_vr9_ppc64le,    vmx_vr10_ppc64le, vmx_vr11_ppc64le,
+    vmx_vr12_ppc64le, vmx_vr13_ppc64le,   vmx_vr14_ppc64le, vmx_vr15_ppc64le,
+    vmx_vr16_ppc64le, vmx_vr17_ppc64le,   vmx_vr18_ppc64le, vmx_vr19_ppc64le,
+    vmx_vr20_ppc64le, vmx_vr21_ppc64le,   vmx_vr22_ppc64le, vmx_vr23_ppc64le,
+    vmx_vr24_ppc64le, vmx_vr25_ppc64le,   vmx_vr26_ppc64le, vmx_vr27_ppc64le,
+    vmx_vr28_ppc64le, vmx_vr29_ppc64le,   vmx_vr30_ppc64le, vmx_vr31_ppc64le,
+    vmx_vscr_ppc64le, vmx_vrsave_ppc64le,
+};
+
+static const uint32_t g_vsx_regnums[] = {
+    vsx_vs0_ppc64le,  vsx_vs1_ppc64le,  vsx_vs2_ppc64le,  vsx_vs3_ppc64le,
+    vsx_vs4_ppc64le,  vsx_vs5_ppc64le,  vsx_vs6_ppc64le,  vsx_vs7_ppc64le,
+    vsx_vs8_ppc64le,  vsx_vs9_ppc64le,  vsx_vs10_ppc64le, vsx_vs11_ppc64le,
+    vsx_vs12_ppc64le, vsx_vs13_ppc64le, vsx_vs14_ppc64le, vsx_vs15_ppc64le,
+    vsx_vs16_ppc64le, vsx_vs17_ppc64le, vsx_vs18_ppc64le, vsx_vs19_ppc64le,
+    vsx_vs20_ppc64le, vsx_vs21_ppc64le, vsx_vs22_ppc64le, vsx_vs23_ppc64le,
+    vsx_vs24_ppc64le, vsx_vs25_ppc64le, vsx_vs26_ppc64le, vsx_vs27_ppc64le,
+    vsx_vs28_ppc64le, vsx_vs29_ppc64le, vsx_vs30_ppc64le, vsx_vs31_ppc64le,
+    vsx_vs32_ppc64le, vsx_vs33_ppc64le, vsx_vs34_ppc64le, vsx_vs35_ppc64le,
+    vsx_vs36_ppc64le, vsx_vs37_ppc64le, vsx_vs38_ppc64le, vsx_vs39_ppc64le,
+    vsx_vs40_ppc64le, vsx_vs41_ppc64le, vsx_vs42_ppc64le, vsx_vs43_ppc64le,
+    vsx_vs44_ppc64le, vsx_vs45_ppc64le, vsx_vs46_ppc64le, vsx_vs47_ppc64le,
+    vsx_vs48_ppc64le, vsx_vs49_ppc64le, vsx_vs50_ppc64le, vsx_vs51_ppc64le,
+    vsx_vs52_ppc64le, vsx_vs53_ppc64le, vsx_vs54_ppc64le, vsx_vs55_ppc64le,
+    vsx_vs56_ppc64le, vsx_vs57_ppc64le, vsx_vs58_ppc64le, vsx_vs59_ppc64le,
+    vsx_vs60_ppc64le, vsx_vs61_ppc64le, vsx_vs62_ppc64le, vsx_vs63_ppc64le,
+};
+
+// Number of register sets provided by this context.
+enum { k_num_register_sets = 4 };
+
+static const RegisterSet g_reg_sets_ppc64le[k_num_register_sets] = {
+    {"General Purpose Registers", "gpr", k_num_gpr_registers_ppc64le,
+     g_gpr_regnums},
+    {"Floating Point Registers", "fpr", k_num_fpr_registers_ppc64le,
+     g_fpr_regnums},
+    {"Altivec/VMX Registers", "vmx", k_num_vmx_registers_ppc64le,
+     g_vmx_regnums},
+    {"VSX Registers", "vsx", k_num_vsx_registers_ppc64le, g_vsx_regnums},
+};
+
+bool RegisterContextPOSIX_ppc64le::IsGPR(unsigned reg) {
+  return (reg <= k_last_gpr_ppc64le); // GPR's come first.
+}
+
+bool RegisterContextPOSIX_ppc64le::IsFPR(unsigned reg) {
+  return (reg >= k_first_fpr_ppc64le) && (reg <= k_last_fpr_ppc64le);
+}
+
+bool RegisterContextPOSIX_ppc64le::IsVMX(unsigned reg) {
+  return (reg >= k_first_vmx_ppc64le) && (reg <= k_last_vmx_ppc64le);
+}
+
+bool RegisterContextPOSIX_ppc64le::IsVSX(unsigned reg) {
+  return (reg >= k_first_vsx_ppc64le) && (reg <= k_last_vsx_ppc64le);
+}
+
+RegisterContextPOSIX_ppc64le::RegisterContextPOSIX_ppc64le(
+    Thread &thread, uint32_t concrete_frame_idx,
+    RegisterInfoInterface *register_info)
+    : RegisterContext(thread, concrete_frame_idx) {
+  m_register_info_ap.reset(register_info);
+
+  ProcessSP base = CalculateProcess();
+  if (base.get()->GetPluginName() == ProcessElfCore::GetPluginNameStatic())
+    return;
+}
+
+void RegisterContextPOSIX_ppc64le::InvalidateAllRegisters() {}
+
+unsigned RegisterContextPOSIX_ppc64le::GetRegisterOffset(unsigned reg) {
+  assert(reg < k_num_registers_ppc64le && "Invalid register number.");
+  return GetRegisterInfo()[reg].byte_offset;
+}
+
+unsigned RegisterContextPOSIX_ppc64le::GetRegisterSize(unsigned reg) {
+  assert(reg < k_num_registers_ppc64le && "Invalid register number.");
+  return GetRegisterInfo()[reg].byte_size;
+}
+
+size_t RegisterContextPOSIX_ppc64le::GetRegisterCount() {
+  size_t num_registers = k_num_registers_ppc64le;
+  return num_registers;
+}
+
+size_t RegisterContextPOSIX_ppc64le::GetGPRSize() {
+  return m_register_info_ap->GetGPRSize();
+}
+
+const RegisterInfo *RegisterContextPOSIX_ppc64le::GetRegisterInfo() {
+  // Commonly, this method is overridden and g_register_infos is copied and
+  // specialized.
+  // So, use GetRegisterInfo() rather than g_register_infos in this scope.
+  return m_register_info_ap->GetRegisterInfo();
+}
+
+const RegisterInfo *
+RegisterContextPOSIX_ppc64le::GetRegisterInfoAtIndex(size_t reg) {
+  if (reg < k_num_registers_ppc64le)
+    return &GetRegisterInfo()[reg];
+  else
+    return NULL;
+}
+
+size_t RegisterContextPOSIX_ppc64le::GetRegisterSetCount() {
+  size_t sets = 0;
+  for (size_t set = 0; set < k_num_register_sets; ++set) {
+    if (IsRegisterSetAvailable(set))
+      ++sets;
+  }
+
+  return sets;
+}
+
+const RegisterSet *RegisterContextPOSIX_ppc64le::GetRegisterSet(size_t set) {
+  if (IsRegisterSetAvailable(set))
+    return &g_reg_sets_ppc64le[set];
+  else
+    return NULL;
+}
+
+const char *RegisterContextPOSIX_ppc64le::GetRegisterName(unsigned reg) {
+  assert(reg < k_num_registers_ppc64le && "Invalid register offset.");
+  return GetRegisterInfo()[reg].name;
+}
+
+lldb::ByteOrder RegisterContextPOSIX_ppc64le::GetByteOrder() {
+  // Get the target process whose privileged thread was used for the register
+  // read.
+  lldb::ByteOrder byte_order = eByteOrderInvalid;
+  Process *process = CalculateProcess().get();
+
+  if (process)
+    byte_order = process->GetByteOrder();
+  return byte_order;
+}
+
+bool RegisterContextPOSIX_ppc64le::IsRegisterSetAvailable(size_t set_index) {
+  size_t num_sets = k_num_register_sets;
+
+  return (set_index < num_sets);
+}
+
+// Used when parsing DWARF and EH frame information and any other
+// object file sections that contain register numbers in them.
+uint32_t RegisterContextPOSIX_ppc64le::ConvertRegisterKindToRegisterNumber(
+    lldb::RegisterKind kind, uint32_t num) {
+  const uint32_t num_regs = GetRegisterCount();
+
+  assert(kind < kNumRegisterKinds);
+  for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
+    const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg_idx);
+
+    if (reg_info->kinds[kind] == num)
+      return reg_idx;
+  }
+
+  return LLDB_INVALID_REGNUM;
+}

Added: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h?rev=318399&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h (added)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h Thu Nov 16 05:38:57 2017
@@ -0,0 +1,82 @@
+//===-- RegisterContextPOSIX_ppc64le.h --------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_RegisterContextPOSIX_ppc64le_h_
+#define liblldb_RegisterContextPOSIX_ppc64le_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+#include "RegisterInfoInterface.h"
+#include "Utility/PPC64LE_DWARF_Registers.h"
+#include "lldb/Target/RegisterContext.h"
+#include "lldb/Utility/Log.h"
+
+class RegisterContextPOSIX_ppc64le : public lldb_private::RegisterContext {
+public:
+  RegisterContextPOSIX_ppc64le(
+      lldb_private::Thread &thread, uint32_t concrete_frame_idx,
+      lldb_private::RegisterInfoInterface *register_info);
+
+  void InvalidateAllRegisters() override;
+
+  size_t GetRegisterCount() override;
+
+  virtual size_t GetGPRSize();
+
+  virtual unsigned GetRegisterSize(unsigned reg);
+
+  virtual unsigned GetRegisterOffset(unsigned reg);
+
+  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
+
+  size_t GetRegisterSetCount() override;
+
+  const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
+
+  const char *GetRegisterName(unsigned reg);
+
+  uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind,
+                                               uint32_t num) override;
+
+protected:
+  // 64-bit general purpose registers.
+  uint64_t m_gpr_ppc64le[k_num_gpr_registers_ppc64le];
+
+  // floating-point registers including extended register.
+  uint64_t m_fpr_ppc64le[k_num_fpr_registers_ppc64le];
+
+  // VMX registers.
+  uint64_t m_vmx_ppc64le[k_num_vmx_registers_ppc64le * 2];
+
+  // VSX registers.
+  uint64_t m_vsx_ppc64le[k_num_vsx_registers_ppc64le * 2];
+
+  std::unique_ptr<lldb_private::RegisterInfoInterface> m_register_info_ap;
+
+  // Determines if an extended register set is supported on the processor
+  // running the inferior process.
+  virtual bool IsRegisterSetAvailable(size_t set_index);
+
+  virtual const lldb_private::RegisterInfo *GetRegisterInfo();
+
+  bool IsGPR(unsigned reg);
+
+  bool IsFPR(unsigned reg);
+
+  bool IsVMX(unsigned reg);
+
+  bool IsVSX(unsigned reg);
+
+  lldb::ByteOrder GetByteOrder();
+};
+
+#endif // liblldb_RegisterContextPOSIX_ppc64le_h_

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h?rev=318399&r1=318398&r2=318399&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h Thu Nov 16 05:38:57 2017
@@ -98,10 +98,10 @@
       DEFINE_GPR(r30, NULL, LLDB_INVALID_REGNUM),                              \
       DEFINE_GPR(r31, NULL, LLDB_INVALID_REGNUM),                              \
       DEFINE_GPR(pc, "pc", LLDB_REGNUM_GENERIC_PC),                            \
-      DEFINE_GPR(lr, "lr", LLDB_REGNUM_GENERIC_RA),                            \
       DEFINE_GPR(msr, "msr", LLDB_INVALID_REGNUM),                             \
       DEFINE_GPR(origr3, "orig_r3", LLDB_INVALID_REGNUM),                      \
       DEFINE_GPR(ctr, "ctr", LLDB_INVALID_REGNUM),                             \
+      DEFINE_GPR(lr, "lr", LLDB_REGNUM_GENERIC_RA),                            \
       DEFINE_GPR(xer, "xer", LLDB_INVALID_REGNUM),                             \
       DEFINE_GPR(cr, "cr", LLDB_REGNUM_GENERIC_FLAGS),                         \
       DEFINE_GPR(softe, "softe", LLDB_INVALID_REGNUM),                         \

Modified: lldb/trunk/source/Plugins/Process/elf-core/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/CMakeLists.txt?rev=318399&r1=318398&r2=318399&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/CMakeLists.txt Thu Nov 16 05:38:57 2017
@@ -7,6 +7,7 @@ add_lldb_library(lldbPluginProcessElfCor
   RegisterContextPOSIXCore_arm64.cpp
   RegisterContextPOSIXCore_mips64.cpp
   RegisterContextPOSIXCore_powerpc.cpp
+  RegisterContextPOSIXCore_ppc64le.cpp
   RegisterContextPOSIXCore_s390x.cpp
   RegisterContextPOSIXCore_x86_64.cpp
 

Modified: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp?rev=318399&r1=318398&r2=318399&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp Thu Nov 16 05:38:57 2017
@@ -36,6 +36,7 @@
 // Project includes
 #include "ProcessElfCore.h"
 #include "ThreadElfCore.h"
+#include "elf-core-enums.h"
 
 using namespace lldb_private;
 
@@ -427,40 +428,6 @@ lldb::addr_t ProcessElfCore::GetImageInf
   return LLDB_INVALID_ADDRESS;
 }
 
-/// Core files PT_NOTE segment descriptor types
-enum {
-  NT_PRSTATUS = 1,
-  NT_FPREGSET,
-  NT_PRPSINFO,
-  NT_TASKSTRUCT,
-  NT_PLATFORM,
-  NT_AUXV,
-  NT_FILE = 0x46494c45,
-  NT_PRXFPREG = 0x46e62b7f,
-  NT_SIGINFO = 0x53494749,
-  NT_OPENBSD_PROCINFO = 10,
-  NT_OPENBSD_AUXV = 11,
-  NT_OPENBSD_REGS = 20,
-  NT_OPENBSD_FPREGS = 21,
-};
-
-namespace FREEBSD {
-
-enum {
-  NT_PRSTATUS = 1,
-  NT_FPREGSET,
-  NT_PRPSINFO,
-  NT_THRMISC = 7,
-  NT_PROCSTAT_AUXV = 16,
-  NT_PPC_VMX = 0x100
-};
-}
-
-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) {
@@ -563,8 +530,12 @@ Status ProcessElfCore::ParseThreadContex
     note.Parse(segment_data, &offset);
 
     // Beginning of new thread
-    if ((note.n_type == NT_PRSTATUS && have_prstatus) ||
-        (note.n_type == NT_PRPSINFO && have_prpsinfo)) {
+    if (((note.n_type == LINUX::NT_PRSTATUS ||
+          note.n_type == FREEBSD::NT_PRSTATUS) &&
+         have_prstatus) ||
+        ((note.n_type == LINUX::NT_PRPSINFO ||
+          note.n_type == FREEBSD::NT_PRPSINFO) &&
+         have_prpsinfo)) {
       assert(thread_data->gpregset.GetByteSize() > 0);
       // Add the new thread to thread list
       m_thread_data.push_back(*thread_data);
@@ -627,22 +598,22 @@ Status ProcessElfCore::ParseThreadContex
       // "OpenBSD at nnn" so match on the initial part of the string.
       m_os = llvm::Triple::OpenBSD;
       switch (note.n_type) {
-      case NT_OPENBSD_PROCINFO:
+      case OPENBSD::NT_PROCINFO:
         ParseOpenBSDProcInfo(*thread_data, note_data);
         break;
-      case NT_OPENBSD_AUXV:
+      case OPENBSD::NT_AUXV:
         m_auxv = DataExtractor(note_data);
         break;
-      case NT_OPENBSD_REGS:
+      case OPENBSD::NT_REGS:
         thread_data->gpregset = note_data;
         break;
-      case NT_OPENBSD_FPREGS:
+      case OPENBSD::NT_FPREGS:
         thread_data->fpregset = note_data;
         break;
       }
     } else if (note.n_name == "CORE") {
       switch (note.n_type) {
-      case NT_PRSTATUS:
+      case LINUX::NT_PRSTATUS:
         have_prstatus = true;
         error = prstatus.Parse(note_data, arch);
         if (error.Fail())
@@ -652,17 +623,22 @@ Status ProcessElfCore::ParseThreadContex
         header_size = ELFLinuxPrStatus::GetSize(arch);
         len = note_data.GetByteSize() - header_size;
         thread_data->gpregset = DataExtractor(note_data, header_size, len);
+
+        if (arch.GetCore() == ArchSpec::eCore_ppc64le_generic)
+          thread_data->regsets.insert(
+              std::make_pair(note.n_type, thread_data->gpregset));
         break;
-      case NT_FPREGSET:
+      case LINUX::NT_FPREGSET:
         // In a i386 core file NT_FPREGSET is present, but it's not the result
         // of the FXSAVE instruction like in 64 bit files.
         // The result from FXSAVE is in NT_PRXFPREG for i386 core files
-        if (arch.GetCore() == ArchSpec::eCore_x86_64_x86_64)
-          thread_data->fpregset = note_data;
-        else if(arch.IsMIPS())
+        if (arch.GetCore() == ArchSpec::eCore_x86_64_x86_64 || arch.IsMIPS())
           thread_data->fpregset = note_data;
+        else if (arch.GetCore() == ArchSpec::eCore_ppc64le_generic) {
+          thread_data->regsets.insert(std::make_pair(note.n_type, note_data));
+        }
         break;
-      case NT_PRPSINFO:
+      case LINUX::NT_PRPSINFO:
         have_prpsinfo = true;
         error = prpsinfo.Parse(note_data, arch);
         if (error.Fail())
@@ -670,10 +646,10 @@ Status ProcessElfCore::ParseThreadContex
         thread_data->name = prpsinfo.pr_fname;
         SetID(prpsinfo.pr_pid);
         break;
-      case NT_AUXV:
+      case LINUX::NT_AUXV:
         m_auxv = DataExtractor(note_data);
         break;
-      case NT_FILE: {
+      case LINUX::NT_FILE: {
         m_nt_file_entries.clear();
         lldb::offset_t offset = 0;
         const uint64_t count = note_data.GetAddress(&offset);
@@ -691,7 +667,7 @@ Status ProcessElfCore::ParseThreadContex
             m_nt_file_entries[i].path.SetCString(path);
         }
       } break;
-      case NT_SIGINFO: {
+      case LINUX::NT_SIGINFO: {
         error = siginfo.Parse(note_data, arch);
         if (error.Fail())
           return error;
@@ -702,8 +678,14 @@ Status ProcessElfCore::ParseThreadContex
       }
     } else if (note.n_name == "LINUX") {
       switch (note.n_type) {
-      case NT_PRXFPREG:
+      case LINUX::NT_PRXFPREG:
         thread_data->fpregset = note_data;
+        break;
+      case LINUX::NT_PPC_VMX:
+      case LINUX::NT_PPC_VSX:
+        if (arch.GetCore() == ArchSpec::eCore_ppc64le_generic)
+          thread_data->regsets.insert(std::make_pair(note.n_type, note_data));
+        break;
       }
     }
 

Added: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp?rev=318399&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp (added)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp Thu Nov 16 05:38:57 2017
@@ -0,0 +1,132 @@
+//===-- RegisterContextPOSIXCore_ppc64le.cpp --------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "RegisterContextPOSIXCore_ppc64le.h"
+
+#include "lldb/Core/RegisterValue.h"
+#include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+
+#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+#include "elf-core-enums.h"
+
+using namespace lldb_private;
+
+RegisterContextCorePOSIX_ppc64le::RegisterContextCorePOSIX_ppc64le(
+    Thread &thread, RegisterInfoInterface *register_info,
+    const llvm::DenseMap<uint32_t, lldb_private::DataExtractor> &regsets)
+    : RegisterContextPOSIX_ppc64le(thread, 0, register_info) {
+  DataExtractor gpregset = regsets.lookup(LINUX::NT_PRSTATUS);
+  m_gpr_buffer.reset(
+      new DataBufferHeap(gpregset.GetDataStart(), gpregset.GetByteSize()));
+  m_gpr.SetData(m_gpr_buffer);
+  m_gpr.SetByteOrder(gpregset.GetByteOrder());
+
+  DataExtractor fpregset = regsets.lookup(LINUX::NT_FPREGSET);
+  m_fpr_buffer.reset(
+      new DataBufferHeap(fpregset.GetDataStart(), fpregset.GetByteSize()));
+  m_fpr.SetData(m_fpr_buffer);
+  m_fpr.SetByteOrder(fpregset.GetByteOrder());
+
+  DataExtractor vmxregset = regsets.lookup(LINUX::NT_PPC_VMX);
+  m_vmx_buffer.reset(
+      new DataBufferHeap(vmxregset.GetDataStart(), vmxregset.GetByteSize()));
+  m_vmx.SetData(m_vmx_buffer);
+  m_vmx.SetByteOrder(vmxregset.GetByteOrder());
+
+  DataExtractor vsxregset = regsets.lookup(LINUX::NT_PPC_VSX);
+  m_vsx_buffer.reset(
+      new DataBufferHeap(vsxregset.GetDataStart(), vsxregset.GetByteSize()));
+  m_vsx.SetData(m_vsx_buffer);
+  m_vsx.SetByteOrder(vsxregset.GetByteOrder());
+}
+
+size_t RegisterContextCorePOSIX_ppc64le::GetFPRSize() const {
+  return k_num_fpr_registers_ppc64le * sizeof(uint64_t);
+}
+
+size_t RegisterContextCorePOSIX_ppc64le::GetVMXSize() const {
+  return (k_num_vmx_registers_ppc64le - 1) * sizeof(uint64_t) * 2 +
+         sizeof(uint32_t);
+}
+
+size_t RegisterContextCorePOSIX_ppc64le::GetVSXSize() const {
+  return k_num_vsx_registers_ppc64le * sizeof(uint64_t) * 2;
+}
+
+bool RegisterContextCorePOSIX_ppc64le::ReadRegister(
+    const RegisterInfo *reg_info, RegisterValue &value) {
+  lldb::offset_t offset = reg_info->byte_offset;
+
+  if (IsFPR(reg_info->kinds[lldb::eRegisterKindLLDB])) {
+    uint64_t v;
+    offset -= GetGPRSize();
+    offset = m_fpr.CopyData(offset, reg_info->byte_size, &v);
+
+    if (offset == reg_info->byte_size) {
+      value.SetBytes(&v, reg_info->byte_size, m_fpr.GetByteOrder());
+      return true;
+    }
+  } else if (IsVMX(reg_info->kinds[lldb::eRegisterKindLLDB])) {
+    uint32_t v[4];
+    offset -= GetGPRSize() + GetFPRSize();
+    offset = m_vmx.CopyData(offset, reg_info->byte_size, &v);
+
+    if (offset == reg_info->byte_size) {
+      value.SetBytes(v, reg_info->byte_size, m_vmx.GetByteOrder());
+      return true;
+    }
+  } else if (IsVSX(reg_info->kinds[lldb::eRegisterKindLLDB])) {
+    uint32_t v[4];
+    lldb::offset_t tmp_offset;
+    offset -= GetGPRSize() + GetFPRSize() + GetVMXSize();
+
+    if (offset < GetVSXSize() / 2) {
+      tmp_offset = m_vsx.CopyData(offset / 2, reg_info->byte_size / 2, &v);
+
+      if (tmp_offset != reg_info->byte_size / 2) {
+        return false;
+      }
+
+      uint8_t *dst = (uint8_t *)&v + sizeof(uint64_t);
+      tmp_offset = m_fpr.CopyData(offset / 2, reg_info->byte_size / 2, dst);
+
+      if (tmp_offset != reg_info->byte_size / 2) {
+        return false;
+      }
+
+      value.SetBytes(&v, reg_info->byte_size, m_vsx.GetByteOrder());
+      return true;
+    } else {
+      offset =
+          m_vmx.CopyData(offset - GetVSXSize() / 2, reg_info->byte_size, &v);
+      if (offset == reg_info->byte_size) {
+        value.SetBytes(v, reg_info->byte_size, m_vmx.GetByteOrder());
+        return true;
+      }
+    }
+  } else {
+    uint64_t v = m_gpr.GetMaxU64(&offset, reg_info->byte_size);
+
+    if (offset == reg_info->byte_offset + reg_info->byte_size) {
+      if (reg_info->byte_size < sizeof(v))
+        value = (uint32_t)v;
+      else
+        value = v;
+      return true;
+    }
+  }
+
+  return false;
+}
+
+bool RegisterContextCorePOSIX_ppc64le::WriteRegister(
+    const RegisterInfo *reg_info, const RegisterValue &value) {
+  return false;
+}

Added: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h?rev=318399&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h (added)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h Thu Nov 16 05:38:57 2017
@@ -0,0 +1,52 @@
+//===-- RegisterContextPOSIXCore_ppc64le.h ----------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_RegisterContextCorePOSIX_ppc64le_h_
+#define liblldb_RegisterContextCorePOSIX_ppc64le_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h"
+#include "lldb/Utility/DataExtractor.h"
+#include "llvm/ADT/DenseMap.h"
+
+class RegisterContextCorePOSIX_ppc64le : public RegisterContextPOSIX_ppc64le {
+public:
+  RegisterContextCorePOSIX_ppc64le(
+      lldb_private::Thread &thread,
+      lldb_private::RegisterInfoInterface *register_info,
+      const llvm::DenseMap<uint32_t, lldb_private::DataExtractor> &regsets);
+
+  bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
+                    lldb_private::RegisterValue &value) override;
+
+  bool WriteRegister(const lldb_private::RegisterInfo *reg_info,
+                     const lldb_private::RegisterValue &value) override;
+
+protected:
+  size_t GetFPRSize() const;
+
+  size_t GetVMXSize() const;
+
+  size_t GetVSXSize() const;
+
+private:
+  lldb::DataBufferSP m_gpr_buffer;
+  lldb::DataBufferSP m_fpr_buffer;
+  lldb::DataBufferSP m_vmx_buffer;
+  lldb::DataBufferSP m_vsx_buffer;
+  lldb_private::DataExtractor m_gpr;
+  lldb_private::DataExtractor m_fpr;
+  lldb_private::DataExtractor m_vmx;
+  lldb_private::DataExtractor m_vsx;
+};
+
+#endif // liblldb_RegisterContextCorePOSIX_ppc64le_h_

Modified: lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp?rev=318399&r1=318398&r2=318399&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp Thu Nov 16 05:38:57 2017
@@ -18,9 +18,9 @@
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_mips64.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_mips.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
+#include "Plugins/Process/Utility/RegisterContextLinux_mips.h"
+#include "Plugins/Process/Utility/RegisterContextLinux_mips64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_s390x.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
 #include "Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h"
@@ -28,11 +28,13 @@
 #include "Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.h"
 #include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
 #include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h"
 #include "ProcessElfCore.h"
 #include "RegisterContextPOSIXCore_arm.h"
 #include "RegisterContextPOSIXCore_arm64.h"
 #include "RegisterContextPOSIXCore_mips64.h"
 #include "RegisterContextPOSIXCore_powerpc.h"
+#include "RegisterContextPOSIXCore_ppc64le.h"
 #include "RegisterContextPOSIXCore_s390x.h"
 #include "RegisterContextPOSIXCore_x86_64.h"
 #include "ThreadElfCore.h"
@@ -46,7 +48,8 @@ using namespace lldb_private;
 ThreadElfCore::ThreadElfCore(Process &process, const ThreadData &td)
     : Thread(process, td.tid), m_thread_name(td.name), m_thread_reg_ctx_sp(),
       m_signo(td.signo), m_gpregset_data(td.gpregset),
-      m_fpregset_data(td.fpregset), m_vregset_data(td.vregset) {}
+      m_fpregset_data(td.fpregset), m_vregset_data(td.vregset),
+      m_regsets_data(td.regsets) {}
 
 ThreadElfCore::~ThreadElfCore() { DestroyThread(); }
 
@@ -142,6 +145,9 @@ ThreadElfCore::CreateRegisterContextForF
       case llvm::Triple::mips64:
         reg_interface = new RegisterContextLinux_mips64(arch);
         break;
+      case llvm::Triple::ppc64le:
+        reg_interface = new RegisterInfoPOSIX_ppc64le(arch);
+        break;
       case llvm::Triple::systemz:
         reg_interface = new RegisterContextLinux_s390x(arch);
         break;
@@ -213,6 +219,10 @@ ThreadElfCore::CreateRegisterContextForF
           *this, reg_interface, m_gpregset_data, m_fpregset_data,
           m_vregset_data));
       break;
+    case llvm::Triple::ppc64le:
+      m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_ppc64le(
+          *this, reg_interface, m_regsets_data));
+      break;
     case llvm::Triple::systemz:
       m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_s390x(
           *this, reg_interface, m_gpregset_data, m_fpregset_data));
@@ -265,6 +275,7 @@ size_t ELFLinuxPrStatus::GetSize(lldb_pr
   switch (arch.GetCore()) {
   case lldb_private::ArchSpec::eCore_s390x_generic:
   case lldb_private::ArchSpec::eCore_x86_64_x86_64:
+  case lldb_private::ArchSpec::eCore_ppc64le_generic:
     return sizeof(ELFLinuxPrStatus);
   case lldb_private::ArchSpec::eCore_x86_32_i386:
   case lldb_private::ArchSpec::eCore_x86_32_i486:

Modified: lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h?rev=318399&r1=318398&r2=318399&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h Thu Nov 16 05:38:57 2017
@@ -18,6 +18,7 @@
 // Project includes
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/DataExtractor.h"
+#include "llvm/ADT/DenseMap.h"
 
 struct compat_timeval {
   alignas(8) uint64_t tv_sec;
@@ -131,6 +132,7 @@ struct ThreadData {
   lldb_private::DataExtractor gpregset;
   lldb_private::DataExtractor fpregset;
   lldb_private::DataExtractor vregset;
+  llvm::DenseMap<uint32_t, lldb_private::DataExtractor> regsets;
   lldb::tid_t tid;
   int signo = 0;
   int prstatus_sig = 0;
@@ -179,6 +181,7 @@ protected:
   lldb_private::DataExtractor m_gpregset_data;
   lldb_private::DataExtractor m_fpregset_data;
   lldb_private::DataExtractor m_vregset_data;
+  llvm::DenseMap<uint32_t, lldb_private::DataExtractor> m_regsets_data;
 
   bool CalculateStopInfo() override;
 };

Added: lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h?rev=318399&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h (added)
+++ lldb/trunk/source/Plugins/Process/elf-core/elf-core-enums.h Thu Nov 16 05:38:57 2017
@@ -0,0 +1,55 @@
+//===-- elf-core-enums.h ----------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_ELF_CORE_ENUMS_H
+#define LLDB_ELF_CORE_ENUMS_H
+
+/// Core files PT_NOTE segment descriptor types
+
+namespace FREEBSD {
+enum {
+  NT_PRSTATUS = 1,
+  NT_FPREGSET,
+  NT_PRPSINFO,
+  NT_THRMISC = 7,
+  NT_PROCSTAT_AUXV = 16,
+  NT_PPC_VMX = 0x100
+};
+}
+
+namespace NETBSD {
+enum { NT_PROCINFO = 1, NT_AUXV, NT_AMD64_REGS = 33, NT_AMD64_FPREGS = 35 };
+}
+
+namespace OPENBSD {
+enum {
+  NT_PROCINFO = 10,
+  NT_AUXV = 11,
+  NT_REGS = 20,
+  NT_FPREGS = 21,
+};
+}
+
+namespace LINUX {
+enum {
+  NT_PRSTATUS = 1,
+  NT_FPREGSET,
+  NT_PRPSINFO,
+  NT_TASKSTRUCT,
+  NT_PLATFORM,
+  NT_AUXV,
+  NT_FILE = 0x46494c45,
+  NT_SIGINFO = 0x53494749,
+  NT_PPC_VMX = 0x100,
+  NT_PPC_VSX = 0x102,
+  NT_PRXFPREG = 0x46e62b7f,
+};
+}
+
+#endif // #ifndef LLDB_ELF_CORE_ENUMS_H




More information about the lldb-commits mailing list