Index: source/Plugins/Process/FreeBSD/FreeBSDThread.cpp =================================================================== --- source/Plugins/Process/FreeBSD/FreeBSDThread.cpp +++ source/Plugins/Process/FreeBSD/FreeBSDThread.cpp @@ -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" @@ -138,7 +138,7 @@ 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__ Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp =================================================================== --- source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp +++ source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp @@ -17,7 +17,7 @@ #include "lldb/Core/RegisterValue.h" #include "Plugins/Process/Linux/Procfs.h" -#include "Plugins/Process/Utility/RegisterContextLinux_arm.h" +#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h" #include #include @@ -108,7 +108,7 @@ 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; Index: source/Plugins/Process/Utility/CMakeLists.txt =================================================================== --- source/Plugins/Process/Utility/CMakeLists.txt +++ source/Plugins/Process/Utility/CMakeLists.txt @@ -15,13 +15,11 @@ 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 @@ RegisterContextPOSIX_s390x.cpp RegisterContextPOSIX_x86.cpp RegisterContextThreadMemory.cpp + RegisterInfoPOSIX_arm.cpp RegisterInfoPOSIX_arm64.cpp StopInfoMachException.cpp ThreadMemory.cpp Index: source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp =================================================================== --- source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp +++ /dev/null @@ -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 -#include -#include - -#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(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; -} Index: source/Plugins/Process/Utility/RegisterContextLinux_arm.h =================================================================== --- source/Plugins/Process/Utility/RegisterContextLinux_arm.h +++ /dev/null @@ -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_ Index: source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h =================================================================== --- source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h +++ source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h @@ -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 @@ 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 @@ uint32_t m_register_info_count; }; -#endif // liblldb_RegisterContextFreeBSD_arm_h_ +#endif // liblldb_RegisterInfoPOSIX_arm_h_ Index: source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp =================================================================== --- source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp +++ source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp @@ -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 @@ } } -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; } Index: source/Plugins/Process/elf-core/ThreadElfCore.cpp =================================================================== --- source/Plugins/Process/elf-core/ThreadElfCore.cpp +++ source/Plugins/Process/elf-core/ThreadElfCore.cpp @@ -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 @@ 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 @@ 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);