[Lldb-commits] [lldb] r287916 - Merge Linux and FreeBSD arm64 register contexts

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 25 02:28:10 PST 2016


Author: labath
Date: Fri Nov 25 04:28:09 2016
New Revision: 287916

URL: http://llvm.org/viewvc/llvm-project?rev=287916&view=rev
Log:
Merge Linux and FreeBSD arm64 register contexts

Summary:
This is a test-the-water change about possibilities of reducing duplication in
the register context definitions.

I've named the new class RegisterInfoPOSIX, as RegisterContextPOSIX was already
taken :(.  The two files were identical except for a fix by Tamas in D12636,
which was applied to the Linux version only, which fixed a discrepancy between
the definitions of fpsr and fpcr on one hand, and all other floating point
register definitions on the other.

Linux test suite still passes after this change. For freebsd, make the floating
point register behavior consistent, but I don't know whether it will be
consistently fixed, or consistently broken. By eyeballing the code, I have a
feeling that a similar fix to D12636 will be required in
RegisterContextPOSIXProcessMonitor_arm64::ReadRegister, but I can't be sure as I
have no way to test it (the assert in that function should fire upon accessing
the registers if it is wrong though).

Reviewers: emaste, clayborg

Subscribers: aemerson, rengolin, beanz, mgorny, modocache, dmikulin, lldb-commits

Differential Revision: https://reviews.llvm.org/D25947

Added:
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
      - copied, changed from r287896, lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
      - copied, changed from r287896, lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h
Removed:
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h
Modified:
    lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
    lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp?rev=287916&r1=287915&r2=287916&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Fri Nov 25 04:28:09 2016
@@ -19,11 +19,11 @@
 #include "FreeBSDThread.h"
 #include "POSIXStopInfo.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_arm.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
 #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/RegisterInfoPOSIX_arm64.h"
 #include "Plugins/Process/Utility/UnwindLLDB.h"
 #include "ProcessFreeBSD.h"
 #include "ProcessMonitor.h"
@@ -135,7 +135,7 @@ lldb::RegisterContextSP FreeBSDThread::G
     assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD);
     switch (target_arch.GetMachine()) {
     case llvm::Triple::aarch64:
-      reg_interface = new RegisterContextFreeBSD_arm64(target_arch);
+      reg_interface = new RegisterInfoPOSIX_arm64(target_arch);
       break;
     case llvm::Triple::arm:
       reg_interface = new RegisterContextFreeBSD_arm(target_arch);

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp?rev=287916&r1=287915&r2=287916&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp Fri Nov 25 04:28:09 2016
@@ -25,7 +25,7 @@
 #include "Plugins/Process/Linux/NativeProcessLinux.h"
 #include "Plugins/Process/Linux/Procfs.h"
 #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
 
 // System includes - They have to be included after framework includes because
 // they define some
@@ -138,7 +138,7 @@ NativeRegisterContextLinux_arm64::Native
     const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
     uint32_t concrete_frame_idx)
     : NativeRegisterContextLinux(native_thread, concrete_frame_idx,
-                                 new RegisterContextLinux_arm64(target_arch)) {
+                                 new RegisterInfoPOSIX_arm64(target_arch)) {
   switch (target_arch.GetMachine()) {
   case llvm::Triple::aarch64:
     m_reg_info.num_registers = k_num_registers_arm64;

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=287916&r1=287915&r2=287916&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt Fri Nov 25 04:28:09 2016
@@ -16,14 +16,12 @@ add_lldb_library(lldbPluginProcessUtilit
   RegisterContextDarwin_x86_64.cpp
   RegisterContextDummy.cpp
   RegisterContextFreeBSD_arm.cpp
-  RegisterContextFreeBSD_arm64.cpp
   RegisterContextFreeBSD_i386.cpp
   RegisterContextFreeBSD_mips64.cpp
   RegisterContextFreeBSD_powerpc.cpp
   RegisterContextFreeBSD_x86_64.cpp
   RegisterContextHistory.cpp
   RegisterContextLinux_arm.cpp
-  RegisterContextLinux_arm64.cpp
   RegisterContextLinux_i386.cpp
   RegisterContextLinux_x86_64.cpp
   RegisterContextLinux_mips64.cpp
@@ -43,6 +41,7 @@ add_lldb_library(lldbPluginProcessUtilit
   RegisterContextPOSIX_s390x.cpp
   RegisterContextPOSIX_x86.cpp
   RegisterContextThreadMemory.cpp
+  RegisterInfoPOSIX_arm64.cpp
   StopInfoMachException.cpp
   ThreadMemory.cpp
   UnwindLLDB.cpp

Removed: lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp?rev=287915&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp (removed)
@@ -1,95 +0,0 @@
-//===-- RegisterContextFreeBSD_arm64.cpp ----------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-
-#include "RegisterContextFreeBSD_arm64.h"
-#include "RegisterContextPOSIX_arm64.h"
-#include <vector>
-
-using namespace lldb;
-
-// Based on RegisterContextDarwin_arm64.cpp
-#define GPR_OFFSET(idx) ((idx)*8)
-#define GPR_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextFreeBSD_arm64::GPR, reg))
-
-#define FPU_OFFSET(idx) ((idx)*16 + sizeof(RegisterContextFreeBSD_arm64::GPR))
-#define FPU_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextFreeBSD_arm64::FPU, reg))
-
-#define EXC_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextFreeBSD_arm64::EXC, reg) +           \
-   sizeof(RegisterContextFreeBSD_arm64::GPR) +                                 \
-   sizeof(RegisterContextFreeBSD_arm64::FPU))
-#define DBG_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextFreeBSD_arm64::DBG, reg) +           \
-   sizeof(RegisterContextFreeBSD_arm64::GPR) +                                 \
-   sizeof(RegisterContextFreeBSD_arm64::FPU) +                                 \
-   sizeof(RegisterContextFreeBSD_arm64::EXC))
-
-#define DEFINE_DBG(reg, i)                                                     \
-  #reg, NULL,                                                                  \
-      sizeof(((RegisterContextFreeBSD_arm64::DBG *) NULL)->reg[i]),            \
-              DBG_OFFSET_NAME(reg[i]), lldb::eEncodingUint, lldb::eFormatHex,  \
-                              {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,       \
-                               LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,       \
-                               dbg_##reg##i },                                 \
-                               NULL, NULL, NULL, 0
-#define REG_CONTEXT_SIZE                                                       \
-  (sizeof(RegisterContextFreeBSD_arm64::GPR) +                                 \
-   sizeof(RegisterContextFreeBSD_arm64::FPU) +                                 \
-   sizeof(RegisterContextFreeBSD_arm64::EXC))
-
-//-----------------------------------------------------------------------------
-// Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure.
-//-----------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
-#include "RegisterInfos_arm64.h"
-#undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
-
-static const lldb_private::RegisterInfo *
-GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
-  switch (target_arch.GetMachine()) {
-  case llvm::Triple::aarch64:
-    return g_register_infos_arm64_le;
-  default:
-    assert(false && "Unhandled target architecture.");
-    return nullptr;
-  }
-}
-
-static uint32_t
-GetRegisterInfoCount(const lldb_private::ArchSpec &target_arch) {
-  switch (target_arch.GetMachine()) {
-  case llvm::Triple::aarch64:
-    return static_cast<uint32_t>(sizeof(g_register_infos_arm64_le) /
-                                 sizeof(g_register_infos_arm64_le[0]));
-  default:
-    assert(false && "Unhandled target architecture.");
-    return 0;
-  }
-}
-
-RegisterContextFreeBSD_arm64::RegisterContextFreeBSD_arm64(
-    const lldb_private::ArchSpec &target_arch)
-    : RegisterInfoInterface(target_arch),
-      m_register_info_p(GetRegisterInfoPtr(target_arch)),
-      m_register_info_count(GetRegisterInfoCount(target_arch)) {}
-
-size_t RegisterContextFreeBSD_arm64::GetGPRSize() const {
-  return sizeof(struct RegisterContextFreeBSD_arm64::GPR);
-}
-
-const lldb_private::RegisterInfo *
-RegisterContextFreeBSD_arm64::GetRegisterInfo() const {
-  return m_register_info_p;
-}
-
-uint32_t RegisterContextFreeBSD_arm64::GetRegisterCount() const {
-  return m_register_info_count;
-}

Removed: lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h?rev=287915&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h (removed)
@@ -1,69 +0,0 @@
-//===-- RegisterContextFreeBSD_arm64.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_RegisterContextFreeBSD_arm64_H_
-#define liblldb_RegisterContextFreeBSD_arm64_H_
-
-#include "RegisterInfoInterface.h"
-
-class RegisterContextFreeBSD_arm64
-    : public lldb_private::RegisterInfoInterface {
-public:
-  // based on RegisterContextDarwin_arm64.h
-  struct GPR {
-    uint64_t x[29]; // x0-x28
-    uint64_t fp;    // x29
-    uint64_t lr;    // x30
-    uint64_t sp;    // x31
-    uint64_t pc;    // pc
-    uint32_t cpsr;  // cpsr
-  };
-
-  // based on RegisterContextDarwin_arm64.h
-  struct VReg {
-    uint8_t bytes[16];
-  };
-
-  // based on RegisterContextDarwin_arm64.h
-  struct FPU {
-    VReg v[32];
-    uint32_t fpsr;
-    uint32_t fpcr;
-  };
-
-  // based on RegisterContextDarwin_arm64.h
-  struct EXC {
-    uint64_t far;       // Virtual Fault Address
-    uint32_t esr;       // Exception syndrome
-    uint32_t exception; // number of arm exception token
-  };
-
-  // based on RegisterContextDarwin_arm64.h
-  struct DBG {
-    uint64_t bvr[16];
-    uint64_t bcr[16];
-    uint64_t wvr[16];
-    uint64_t wcr[16];
-    uint64_t mdscr_el1;
-  };
-
-  RegisterContextFreeBSD_arm64(const lldb_private::ArchSpec &target_arch);
-
-  size_t GetGPRSize() const override;
-
-  const lldb_private::RegisterInfo *GetRegisterInfo() const override;
-
-  uint32_t GetRegisterCount() const override;
-
-private:
-  const lldb_private::RegisterInfo *m_register_info_p;
-  uint32_t m_register_info_count;
-};
-
-#endif

Removed: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp?rev=287915&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp (removed)
@@ -1,99 +0,0 @@
-//===-- RegisterContextLinux_arm64.cpp -------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-
-#include <cassert>
-#include <stddef.h>
-#include <vector>
-
-#include "lldb/lldb-defines.h"
-#include "llvm/Support/Compiler.h"
-
-#include "RegisterContextLinux_arm64.h"
-
-// Based on RegisterContextDarwin_arm64.cpp
-#define GPR_OFFSET(idx) ((idx)*8)
-#define GPR_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::GPR, reg))
-
-#define FPU_OFFSET(idx) ((idx)*16 + sizeof(RegisterContextLinux_arm64::GPR))
-#define FPU_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::FPU, reg) +             \
-   sizeof(RegisterContextLinux_arm64::GPR))
-
-#define EXC_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::EXC, reg) +             \
-   sizeof(RegisterContextLinux_arm64::GPR) +                                   \
-   sizeof(RegisterContextLinux_arm64::FPU))
-#define DBG_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::DBG, reg) +             \
-   sizeof(RegisterContextLinux_arm64::GPR) +                                   \
-   sizeof(RegisterContextLinux_arm64::FPU) +                                   \
-   sizeof(RegisterContextLinux_arm64::EXC))
-
-#define DEFINE_DBG(reg, i)                                                     \
-  #reg, NULL,                                                                  \
-      sizeof(((RegisterContextLinux_arm64::DBG *) NULL)->reg[i]),              \
-              DBG_OFFSET_NAME(reg[i]), lldb::eEncodingUint, lldb::eFormatHex,  \
-                              {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,       \
-                               LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,       \
-                               dbg_##reg##i },                                 \
-                               NULL, NULL, NULL, 0
-#define REG_CONTEXT_SIZE                                                       \
-  (sizeof(RegisterContextLinux_arm64::GPR) +                                   \
-   sizeof(RegisterContextLinux_arm64::FPU) +                                   \
-   sizeof(RegisterContextLinux_arm64::EXC))
-
-//-----------------------------------------------------------------------------
-// Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure.
-//-----------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
-#include "RegisterInfos_arm64.h"
-#undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
-
-static const lldb_private::RegisterInfo *
-GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
-  switch (target_arch.GetMachine()) {
-  case llvm::Triple::aarch64:
-    return g_register_infos_arm64_le;
-  default:
-    assert(false && "Unhandled target architecture.");
-    return NULL;
-  }
-}
-
-static uint32_t
-GetRegisterInfoCount(const lldb_private::ArchSpec &target_arch) {
-  switch (target_arch.GetMachine()) {
-  case llvm::Triple::aarch64:
-    return static_cast<uint32_t>(sizeof(g_register_infos_arm64_le) /
-                                 sizeof(g_register_infos_arm64_le[0]));
-  default:
-    assert(false && "Unhandled target architecture.");
-    return 0;
-  }
-}
-
-RegisterContextLinux_arm64::RegisterContextLinux_arm64(
-    const lldb_private::ArchSpec &target_arch)
-    : lldb_private::RegisterInfoInterface(target_arch),
-      m_register_info_p(GetRegisterInfoPtr(target_arch)),
-      m_register_info_count(GetRegisterInfoCount(target_arch)) {}
-
-size_t RegisterContextLinux_arm64::GetGPRSize() const {
-  return sizeof(struct RegisterContextLinux_arm64::GPR);
-}
-
-const lldb_private::RegisterInfo *
-RegisterContextLinux_arm64::GetRegisterInfo() const {
-  return m_register_info_p;
-}
-
-uint32_t RegisterContextLinux_arm64::GetRegisterCount() const {
-  return m_register_info_count;
-}

Removed: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h?rev=287915&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h (removed)
@@ -1,70 +0,0 @@
-//===-- RegisterContextLinux_arm64.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_RegisterContextLinux_arm64_H_
-#define liblldb_RegisterContextLinux_arm64_H_
-
-#include "RegisterInfoInterface.h"
-#include "lldb/Target/RegisterContext.h"
-#include "lldb/lldb-private.h"
-
-class RegisterContextLinux_arm64 : public lldb_private::RegisterInfoInterface {
-public:
-  // based on RegisterContextDarwin_arm64.h
-  struct GPR {
-    uint64_t x[29]; // x0-x28
-    uint64_t fp;    // x29
-    uint64_t lr;    // x30
-    uint64_t sp;    // x31
-    uint64_t pc;    // pc
-    uint32_t cpsr;  // cpsr
-  };
-
-  // based on RegisterContextDarwin_arm64.h
-  struct VReg {
-    uint8_t bytes[16];
-  };
-
-  // based on RegisterContextDarwin_arm64.h
-  struct FPU {
-    VReg v[32];
-    uint32_t fpsr;
-    uint32_t fpcr;
-  };
-
-  // based on RegisterContextDarwin_arm64.h
-  struct EXC {
-    uint64_t far;       // Virtual Fault Address
-    uint32_t esr;       // Exception syndrome
-    uint32_t exception; // number of arm exception token
-  };
-
-  // based on RegisterContextDarwin_arm64.h
-  struct DBG {
-    uint64_t bvr[16];
-    uint64_t bcr[16];
-    uint64_t wvr[16];
-    uint64_t wcr[16];
-    uint64_t mdscr_el1;
-  };
-
-  RegisterContextLinux_arm64(const lldb_private::ArchSpec &target_arch);
-
-  size_t GetGPRSize() const override;
-
-  const lldb_private::RegisterInfo *GetRegisterInfo() const override;
-
-  uint32_t GetRegisterCount() const override;
-
-private:
-  const lldb_private::RegisterInfo *m_register_info_p;
-  uint32_t m_register_info_count;
-};
-
-#endif

Copied: lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp (from r287896, lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp?p2=lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp&p1=lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp&r1=287896&r2=287916&rev=287916&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp Fri Nov 25 04:28:09 2016
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_arm64.cpp -------------------------*- C++ -*-===//
+//===-- RegisterInfoPOSIX_arm64.cpp ----------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -14,40 +14,40 @@
 #include "lldb/lldb-defines.h"
 #include "llvm/Support/Compiler.h"
 
-#include "RegisterContextLinux_arm64.h"
+#include "RegisterInfoPOSIX_arm64.h"
 
 // Based on RegisterContextDarwin_arm64.cpp
 #define GPR_OFFSET(idx) ((idx)*8)
 #define GPR_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::GPR, reg))
+  (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::GPR, reg))
 
-#define FPU_OFFSET(idx) ((idx)*16 + sizeof(RegisterContextLinux_arm64::GPR))
+#define FPU_OFFSET(idx) ((idx)*16 + sizeof(RegisterInfoPOSIX_arm64::GPR))
 #define FPU_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::FPU, reg) +             \
-   sizeof(RegisterContextLinux_arm64::GPR))
+  (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::FPU, reg) +                \
+   sizeof(RegisterInfoPOSIX_arm64::GPR))
 
 #define EXC_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::EXC, reg) +             \
-   sizeof(RegisterContextLinux_arm64::GPR) +                                   \
-   sizeof(RegisterContextLinux_arm64::FPU))
+  (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::EXC, reg) +                \
+   sizeof(RegisterInfoPOSIX_arm64::GPR) +                                      \
+   sizeof(RegisterInfoPOSIX_arm64::FPU))
 #define DBG_OFFSET_NAME(reg)                                                   \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm64::DBG, reg) +             \
-   sizeof(RegisterContextLinux_arm64::GPR) +                                   \
-   sizeof(RegisterContextLinux_arm64::FPU) +                                   \
-   sizeof(RegisterContextLinux_arm64::EXC))
+  (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::DBG, reg) +                \
+   sizeof(RegisterInfoPOSIX_arm64::GPR) +                                      \
+   sizeof(RegisterInfoPOSIX_arm64::FPU) +                                      \
+   sizeof(RegisterInfoPOSIX_arm64::EXC))
 
 #define DEFINE_DBG(reg, i)                                                     \
   #reg, NULL,                                                                  \
-      sizeof(((RegisterContextLinux_arm64::DBG *) NULL)->reg[i]),              \
+      sizeof(((RegisterInfoPOSIX_arm64::DBG *) NULL)->reg[i]),                 \
               DBG_OFFSET_NAME(reg[i]), lldb::eEncodingUint, lldb::eFormatHex,  \
                               {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,       \
                                LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,       \
                                dbg_##reg##i },                                 \
                                NULL, NULL, NULL, 0
 #define REG_CONTEXT_SIZE                                                       \
-  (sizeof(RegisterContextLinux_arm64::GPR) +                                   \
-   sizeof(RegisterContextLinux_arm64::FPU) +                                   \
-   sizeof(RegisterContextLinux_arm64::EXC))
+  (sizeof(RegisterInfoPOSIX_arm64::GPR) +                                      \
+   sizeof(RegisterInfoPOSIX_arm64::FPU) +                                      \
+   sizeof(RegisterInfoPOSIX_arm64::EXC))
 
 //-----------------------------------------------------------------------------
 // Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure.
@@ -79,21 +79,21 @@ GetRegisterInfoCount(const lldb_private:
   }
 }
 
-RegisterContextLinux_arm64::RegisterContextLinux_arm64(
+RegisterInfoPOSIX_arm64::RegisterInfoPOSIX_arm64(
     const lldb_private::ArchSpec &target_arch)
     : lldb_private::RegisterInfoInterface(target_arch),
       m_register_info_p(GetRegisterInfoPtr(target_arch)),
       m_register_info_count(GetRegisterInfoCount(target_arch)) {}
 
-size_t RegisterContextLinux_arm64::GetGPRSize() const {
-  return sizeof(struct RegisterContextLinux_arm64::GPR);
+size_t RegisterInfoPOSIX_arm64::GetGPRSize() const {
+  return sizeof(struct RegisterInfoPOSIX_arm64::GPR);
 }
 
 const lldb_private::RegisterInfo *
-RegisterContextLinux_arm64::GetRegisterInfo() const {
+RegisterInfoPOSIX_arm64::GetRegisterInfo() const {
   return m_register_info_p;
 }
 
-uint32_t RegisterContextLinux_arm64::GetRegisterCount() const {
+uint32_t RegisterInfoPOSIX_arm64::GetRegisterCount() const {
   return m_register_info_count;
 }

Copied: lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h (from r287896, lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h?p2=lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h&p1=lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h&r1=287896&r2=287916&rev=287916&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h Fri Nov 25 04:28:09 2016
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_arm64.h ----------------------------*- C++ -*-===//
+//===-- RegisterInfoPOSIX_arm64.h -------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -14,7 +14,7 @@
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/lldb-private.h"
 
-class RegisterContextLinux_arm64 : public lldb_private::RegisterInfoInterface {
+class RegisterInfoPOSIX_arm64 : public lldb_private::RegisterInfoInterface {
 public:
   // based on RegisterContextDarwin_arm64.h
   struct GPR {
@@ -54,7 +54,7 @@ public:
     uint64_t mdscr_el1;
   };
 
-  RegisterContextLinux_arm64(const lldb_private::ArchSpec &target_arch);
+  RegisterInfoPOSIX_arm64(const lldb_private::ArchSpec &target_arch);
 
   size_t GetGPRSize() const override;
 

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=287916&r1=287915&r2=287916&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp Fri Nov 25 04:28:09 2016
@@ -15,16 +15,15 @@
 #include "lldb/Target/Unwind.h"
 
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_arm.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
 #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_arm.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_arm64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_s390x.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
 #include "ProcessElfCore.h"
 #include "RegisterContextPOSIXCore_arm.h"
 #include "RegisterContextPOSIXCore_arm64.h"
@@ -86,7 +85,7 @@ ThreadElfCore::CreateRegisterContextForF
     case llvm::Triple::FreeBSD: {
       switch (arch.GetMachine()) {
       case llvm::Triple::aarch64:
-        reg_interface = new RegisterContextFreeBSD_arm64(arch);
+        reg_interface = new RegisterInfoPOSIX_arm64(arch);
         break;
       case llvm::Triple::arm:
         reg_interface = new RegisterContextFreeBSD_arm(arch);
@@ -118,7 +117,7 @@ ThreadElfCore::CreateRegisterContextForF
         reg_interface = new RegisterContextLinux_arm(arch);
         break;
       case llvm::Triple::aarch64:
-        reg_interface = new RegisterContextLinux_arm64(arch);
+        reg_interface = new RegisterInfoPOSIX_arm64(arch);
         break;
       case llvm::Triple::systemz:
         reg_interface = new RegisterContextLinux_s390x(arch);




More information about the lldb-commits mailing list