[Lldb-commits] [lldb] r296335 - Merge Linux and FreeBSD arm register contexts

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 27 05:00:51 PST 2017


Author: labath
Date: Mon Feb 27 07:00:50 2017
New Revision: 296335

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

Summary:
These two register contexts were identical, so this shouldn't cause any
regressions, but I'd appreciate it if you can check that this at least compiles.

Reviewers: emaste, sas

Subscribers: aemerson, rengolin, lldb-commits, mgorny

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

Added:
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp
      - copied, changed from r296334, lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h
      - copied, changed from r296334, lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h
Removed:
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.h
Modified:
    lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.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=296335&r1=296334&r2=296335&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Mon Feb 27 07:00:50 2017
@@ -18,11 +18,11 @@
 // Project includes
 #include "FreeBSDThread.h"
 #include "POSIXStopInfo.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_arm.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_arm.h"
 #include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
 #include "Plugins/Process/Utility/UnwindLLDB.h"
 #include "ProcessFreeBSD.h"
@@ -137,7 +137,7 @@ lldb::RegisterContextSP FreeBSDThread::G
       reg_interface = new RegisterInfoPOSIX_arm64(target_arch);
       break;
     case llvm::Triple::arm:
-      reg_interface = new RegisterContextFreeBSD_arm(target_arch);
+      reg_interface = new RegisterInfoPOSIX_arm(target_arch);
       break;
     case llvm::Triple::ppc:
 #ifndef __powerpc64__

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp?rev=296335&r1=296334&r2=296335&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp Mon Feb 27 07:00:50 2017
@@ -18,7 +18,7 @@
 
 #include "Plugins/Process/Linux/Procfs.h"
 #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
 
 #include <elf.h>
 #include <sys/socket.h>
@@ -109,7 +109,7 @@ NativeRegisterContextLinux_arm::NativeRe
     const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
     uint32_t concrete_frame_idx)
     : NativeRegisterContextLinux(native_thread, concrete_frame_idx,
-                                 new RegisterContextLinux_arm(target_arch)) {
+                                 new RegisterInfoPOSIX_arm(target_arch)) {
   switch (target_arch.GetMachine()) {
   case llvm::Triple::arm:
     m_reg_info.num_registers = k_num_registers_arm;

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=296335&r1=296334&r2=296335&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt Mon Feb 27 07:00:50 2017
@@ -15,13 +15,11 @@ add_lldb_library(lldbPluginProcessUtilit
   RegisterContextDarwin_i386.cpp
   RegisterContextDarwin_x86_64.cpp
   RegisterContextDummy.cpp
-  RegisterContextFreeBSD_arm.cpp
   RegisterContextFreeBSD_i386.cpp
   RegisterContextFreeBSD_mips64.cpp
   RegisterContextFreeBSD_powerpc.cpp
   RegisterContextFreeBSD_x86_64.cpp
   RegisterContextHistory.cpp
-  RegisterContextLinux_arm.cpp
   RegisterContextLinux_i386.cpp
   RegisterContextLinux_x86_64.cpp
   RegisterContextLinux_mips64.cpp
@@ -41,6 +39,7 @@ add_lldb_library(lldbPluginProcessUtilit
   RegisterContextPOSIX_s390x.cpp
   RegisterContextPOSIX_x86.cpp
   RegisterContextThreadMemory.cpp
+  RegisterInfoPOSIX_arm.cpp
   RegisterInfoPOSIX_arm64.cpp
   StopInfoMachException.cpp
   ThreadMemory.cpp

Removed: lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp?rev=296334&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp (removed)
@@ -1,97 +0,0 @@
-//===-- RegisterContextFreeBSD_arm.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 "RegisterContextFreeBSD_arm.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-// Based on RegisterContextLinux_arm.cpp and
-// http://svnweb.freebsd.org/base/head/sys/arm/include/reg.h
-#define GPR_OFFSET(idx) ((idx)*4)
-#define FPU_OFFSET(idx) ((idx)*4 + sizeof(RegisterContextFreeBSD_arm::GPR))
-#define FPSCR_OFFSET                                                           \
-  (LLVM_EXTENSION offsetof(RegisterContextFreeBSD_arm::FPU, fpscr) +           \
-   sizeof(RegisterContextFreeBSD_arm::GPR))
-#define EXC_OFFSET(idx)                                                        \
-  ((idx)*4 + sizeof(RegisterContextFreeBSD_arm::GPR) +                         \
-   sizeof(RegisterContextFreeBSD_arm::FPU))
-#define DBG_OFFSET(reg)                                                        \
-  ((LLVM_EXTENSION offsetof(RegisterContextFreeBSD_arm::DBG, reg) +            \
-    sizeof(RegisterContextFreeBSD_arm::GPR) +                                  \
-    sizeof(RegisterContextFreeBSD_arm::FPU) +                                  \
-    sizeof(RegisterContextFreeBSD_arm::EXC)))
-
-#define DEFINE_DBG(reg, i)                                                     \
-  #reg, NULL, sizeof(((RegisterContextFreeBSD_arm::DBG *) NULL)->reg[i]),      \
-                      DBG_OFFSET(reg[i]), eEncodingUint, 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_arm::GPR) +                                   \
-   sizeof(RegisterContextFreeBSD_arm::FPU) +                                   \
-   sizeof(RegisterContextFreeBSD_arm::EXC))
-
-//-----------------------------------------------------------------------------
-// Include RegisterInfos_arm to declare our g_register_infos_arm structure.
-//-----------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_ARM_STRUCT
-#include "RegisterInfos_arm.h"
-#undef DECLARE_REGISTER_INFOS_ARM_STRUCT
-
-static const lldb_private::RegisterInfo *
-GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
-  switch (target_arch.GetMachine()) {
-  case llvm::Triple::arm:
-    return g_register_infos_arm;
-  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::arm:
-    return static_cast<uint32_t>(sizeof(g_register_infos_arm) /
-                                 sizeof(g_register_infos_arm[0]));
-  default:
-    assert(false && "Unhandled target architecture.");
-    return 0;
-  }
-}
-
-RegisterContextFreeBSD_arm::RegisterContextFreeBSD_arm(
-    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 RegisterContextFreeBSD_arm::GetGPRSize() const {
-  return sizeof(struct RegisterContextFreeBSD_arm::GPR);
-}
-
-const lldb_private::RegisterInfo *
-RegisterContextFreeBSD_arm::GetRegisterInfo() const {
-  return m_register_info_p;
-}
-
-uint32_t RegisterContextFreeBSD_arm::GetRegisterCount() const {
-  return m_register_info_count;
-}

Removed: lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h?rev=296334&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h (removed)
@@ -1,62 +0,0 @@
-//===-- RegisterContextFreeBSD_arm.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_arm_h_
-#define liblldb_RegisterContextFreeBSD_arm_h_
-
-#include "RegisterInfoInterface.h"
-#include "lldb/Target/RegisterContext.h"
-#include "lldb/lldb-private.h"
-
-class RegisterContextFreeBSD_arm : public lldb_private::RegisterInfoInterface {
-public:
-  struct GPR {
-    uint32_t r[16]; // R0-R15
-    uint32_t cpsr;  // CPSR
-  };
-
-  struct QReg {
-    uint8_t bytes[16];
-  };
-
-  struct FPU {
-    union {
-      uint32_t s[32];
-      uint64_t d[32];
-      QReg q[16]; // the 128-bit NEON registers
-    } floats;
-    uint32_t fpscr;
-  };
-  struct EXC {
-    uint32_t exception;
-    uint32_t fsr; /* Fault status */
-    uint32_t far; /* Virtual Fault Address */
-  };
-
-  struct DBG {
-    uint32_t bvr[16];
-    uint32_t bcr[16];
-    uint32_t wvr[16];
-    uint32_t wcr[16];
-  };
-
-  RegisterContextFreeBSD_arm(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 // liblldb_RegisterContextFreeBSD_arm_h_

Removed: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp?rev=296334&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp (removed)
@@ -1,96 +0,0 @@
-//===-- RegisterContextLinux_arm.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_arm.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-// Based on RegisterContextDarwin_arm.cpp
-#define GPR_OFFSET(idx) ((idx)*4)
-#define FPU_OFFSET(idx) ((idx)*4 + sizeof(RegisterContextLinux_arm::GPR))
-#define FPSCR_OFFSET                                                           \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm::FPU, fpscr) +             \
-   sizeof(RegisterContextLinux_arm::GPR))
-#define EXC_OFFSET(idx)                                                        \
-  ((idx)*4 + sizeof(RegisterContextLinux_arm::GPR) +                           \
-   sizeof(RegisterContextLinux_arm::FPU))
-#define DBG_OFFSET(reg)                                                        \
-  ((LLVM_EXTENSION offsetof(RegisterContextLinux_arm::DBG, reg) +              \
-    sizeof(RegisterContextLinux_arm::GPR) +                                    \
-    sizeof(RegisterContextLinux_arm::FPU) +                                    \
-    sizeof(RegisterContextLinux_arm::EXC)))
-
-#define DEFINE_DBG(reg, i)                                                     \
-  #reg, NULL, sizeof(((RegisterContextLinux_arm::DBG *) NULL)->reg[i]),        \
-                      DBG_OFFSET(reg[i]), eEncodingUint, 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_arm::GPR) +                                     \
-   sizeof(RegisterContextLinux_arm::FPU) +                                     \
-   sizeof(RegisterContextLinux_arm::EXC))
-
-//-----------------------------------------------------------------------------
-// Include RegisterInfos_arm to declare our g_register_infos_arm structure.
-//-----------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_ARM_STRUCT
-#include "RegisterInfos_arm.h"
-#undef DECLARE_REGISTER_INFOS_ARM_STRUCT
-
-static const lldb_private::RegisterInfo *
-GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
-  switch (target_arch.GetMachine()) {
-  case llvm::Triple::arm:
-    return g_register_infos_arm;
-  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::arm:
-    return static_cast<uint32_t>(sizeof(g_register_infos_arm) /
-                                 sizeof(g_register_infos_arm[0]));
-  default:
-    assert(false && "Unhandled target architecture.");
-    return 0;
-  }
-}
-
-RegisterContextLinux_arm::RegisterContextLinux_arm(
-    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_arm::GetGPRSize() const {
-  return sizeof(struct RegisterContextLinux_arm::GPR);
-}
-
-const lldb_private::RegisterInfo *
-RegisterContextLinux_arm::GetRegisterInfo() const {
-  return m_register_info_p;
-}
-
-uint32_t RegisterContextLinux_arm::GetRegisterCount() const {
-  return m_register_info_count;
-}

Removed: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.h?rev=296334&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.h (removed)
@@ -1,62 +0,0 @@
-//===-- RegisterContextLinux_arm.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_arm_h_
-#define liblldb_RegisterContextLinux_arm_h_
-
-#include "RegisterInfoInterface.h"
-#include "lldb/Target/RegisterContext.h"
-#include "lldb/lldb-private.h"
-
-class RegisterContextLinux_arm : public lldb_private::RegisterInfoInterface {
-public:
-  struct GPR {
-    uint32_t r[16]; // R0-R15
-    uint32_t cpsr;  // CPSR
-  };
-
-  struct QReg {
-    uint8_t bytes[16];
-  };
-
-  struct FPU {
-    union {
-      uint32_t s[32];
-      uint64_t d[32];
-      QReg q[16]; // the 128-bit NEON registers
-    } floats;
-    uint32_t fpscr;
-  };
-  struct EXC {
-    uint32_t exception;
-    uint32_t fsr; /* Fault status */
-    uint32_t far; /* Virtual Fault Address */
-  };
-
-  struct DBG {
-    uint32_t bvr[16];
-    uint32_t bcr[16];
-    uint32_t wvr[16];
-    uint32_t wcr[16];
-  };
-
-  RegisterContextLinux_arm(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 // liblldb_RegisterContextLinux_arm_h_

Copied: lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp (from r296334, lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp?p2=lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp&p1=lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp&r1=296334&r2=296335&rev=296335&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp Mon Feb 27 07:00:50 2017
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_arm.cpp ---------------------------*- C++ -*-===//
+//===-- RegisterInfoPOSIX_arm.cpp ------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -14,37 +14,35 @@
 #include "lldb/lldb-defines.h"
 #include "llvm/Support/Compiler.h"
 
-#include "RegisterContextLinux_arm.h"
+#include "RegisterInfoPOSIX_arm.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
 // Based on RegisterContextDarwin_arm.cpp
 #define GPR_OFFSET(idx) ((idx)*4)
-#define FPU_OFFSET(idx) ((idx)*4 + sizeof(RegisterContextLinux_arm::GPR))
+#define FPU_OFFSET(idx) ((idx)*4 + sizeof(RegisterInfoPOSIX_arm::GPR))
 #define FPSCR_OFFSET                                                           \
-  (LLVM_EXTENSION offsetof(RegisterContextLinux_arm::FPU, fpscr) +             \
-   sizeof(RegisterContextLinux_arm::GPR))
+  (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm::FPU, fpscr) +                \
+   sizeof(RegisterInfoPOSIX_arm::GPR))
 #define EXC_OFFSET(idx)                                                        \
-  ((idx)*4 + sizeof(RegisterContextLinux_arm::GPR) +                           \
-   sizeof(RegisterContextLinux_arm::FPU))
+  ((idx)*4 + sizeof(RegisterInfoPOSIX_arm::GPR) +                              \
+   sizeof(RegisterInfoPOSIX_arm::FPU))
 #define DBG_OFFSET(reg)                                                        \
-  ((LLVM_EXTENSION offsetof(RegisterContextLinux_arm::DBG, reg) +              \
-    sizeof(RegisterContextLinux_arm::GPR) +                                    \
-    sizeof(RegisterContextLinux_arm::FPU) +                                    \
-    sizeof(RegisterContextLinux_arm::EXC)))
+  ((LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm::DBG, reg) +                 \
+    sizeof(RegisterInfoPOSIX_arm::GPR) + sizeof(RegisterInfoPOSIX_arm::FPU) +  \
+    sizeof(RegisterInfoPOSIX_arm::EXC)))
 
 #define DEFINE_DBG(reg, i)                                                     \
-  #reg, NULL, sizeof(((RegisterContextLinux_arm::DBG *) NULL)->reg[i]),        \
+  #reg, NULL, sizeof(((RegisterInfoPOSIX_arm::DBG *) NULL)->reg[i]),           \
                       DBG_OFFSET(reg[i]), eEncodingUint, 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_arm::GPR) +                                     \
-   sizeof(RegisterContextLinux_arm::FPU) +                                     \
-   sizeof(RegisterContextLinux_arm::EXC))
+  (sizeof(RegisterInfoPOSIX_arm::GPR) + sizeof(RegisterInfoPOSIX_arm::FPU) +   \
+   sizeof(RegisterInfoPOSIX_arm::EXC))
 
 //-----------------------------------------------------------------------------
 // Include RegisterInfos_arm to declare our g_register_infos_arm structure.
@@ -76,21 +74,21 @@ GetRegisterInfoCount(const lldb_private:
   }
 }
 
-RegisterContextLinux_arm::RegisterContextLinux_arm(
+RegisterInfoPOSIX_arm::RegisterInfoPOSIX_arm(
     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_arm::GetGPRSize() const {
-  return sizeof(struct RegisterContextLinux_arm::GPR);
+size_t RegisterInfoPOSIX_arm::GetGPRSize() const {
+  return sizeof(struct RegisterInfoPOSIX_arm::GPR);
 }
 
 const lldb_private::RegisterInfo *
-RegisterContextLinux_arm::GetRegisterInfo() const {
+RegisterInfoPOSIX_arm::GetRegisterInfo() const {
   return m_register_info_p;
 }
 
-uint32_t RegisterContextLinux_arm::GetRegisterCount() const {
+uint32_t RegisterInfoPOSIX_arm::GetRegisterCount() const {
   return m_register_info_count;
 }

Copied: lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h (from r296334, lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h?p2=lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h&p1=lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h&r1=296334&r2=296335&rev=296335&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h Mon Feb 27 07:00:50 2017
@@ -1,4 +1,4 @@
-//===-- RegisterContextFreeBSD_arm.h ----------------------------*- C++ -*-===//
+//===-- RegisterInfoPOSIX_arm.h ---------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,14 +7,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef liblldb_RegisterContextFreeBSD_arm_h_
-#define liblldb_RegisterContextFreeBSD_arm_h_
+#ifndef liblldb_RegisterInfoPOSIX_arm_h_
+#define liblldb_RegisterInfoPOSIX_arm_h_
 
 #include "RegisterInfoInterface.h"
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/lldb-private.h"
 
-class RegisterContextFreeBSD_arm : public lldb_private::RegisterInfoInterface {
+class RegisterInfoPOSIX_arm : public lldb_private::RegisterInfoInterface {
 public:
   struct GPR {
     uint32_t r[16]; // R0-R15
@@ -46,7 +46,7 @@ public:
     uint32_t wcr[16];
   };
 
-  RegisterContextFreeBSD_arm(const lldb_private::ArchSpec &target_arch);
+  RegisterInfoPOSIX_arm(const lldb_private::ArchSpec &target_arch);
 
   size_t GetGPRSize() const override;
 
@@ -59,4 +59,4 @@ private:
   uint32_t m_register_info_count;
 };
 
-#endif // liblldb_RegisterContextFreeBSD_arm_h_
+#endif // liblldb_RegisterInfoPOSIX_arm_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=296335&r1=296334&r2=296335&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp Mon Feb 27 07:00:50 2017
@@ -14,15 +14,14 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Unwind.h"
 
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_arm.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_i386.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_s390x.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
 #include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
 #include "ProcessElfCore.h"
 #include "RegisterContextPOSIXCore_arm.h"
@@ -88,7 +87,7 @@ ThreadElfCore::CreateRegisterContextForF
         reg_interface = new RegisterInfoPOSIX_arm64(arch);
         break;
       case llvm::Triple::arm:
-        reg_interface = new RegisterContextFreeBSD_arm(arch);
+        reg_interface = new RegisterInfoPOSIX_arm(arch);
         break;
       case llvm::Triple::ppc:
         reg_interface = new RegisterContextFreeBSD_powerpc32(arch);
@@ -114,7 +113,7 @@ ThreadElfCore::CreateRegisterContextForF
     case llvm::Triple::Linux: {
       switch (arch.GetMachine()) {
       case llvm::Triple::arm:
-        reg_interface = new RegisterContextLinux_arm(arch);
+        reg_interface = new RegisterInfoPOSIX_arm(arch);
         break;
       case llvm::Triple::aarch64:
         reg_interface = new RegisterInfoPOSIX_arm64(arch);




More information about the lldb-commits mailing list