[lldb][NativeRegisterContext] Rename to x86 for shared files (#180624)
This commit is contained in:
@@ -4,7 +4,7 @@ add_lldb_library(lldbPluginProcessFreeBSD
|
||||
NativeRegisterContextFreeBSD_arm.cpp
|
||||
NativeRegisterContextFreeBSD_arm64.cpp
|
||||
NativeRegisterContextFreeBSD_powerpc.cpp
|
||||
NativeRegisterContextFreeBSD_x86_64.cpp
|
||||
NativeRegisterContextFreeBSD_x86.cpp
|
||||
NativeThreadFreeBSD.cpp
|
||||
|
||||
LINK_COMPONENTS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- NativeRegisterContextFreeBSD_x86_64.cpp ---------------------------===//
|
||||
//===-- NativeRegisterContextFreeBSD_x86.cpp ------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#include "NativeRegisterContextFreeBSD_x86_64.h"
|
||||
#include "NativeRegisterContextFreeBSD_x86.h"
|
||||
|
||||
// clang-format off
|
||||
#include <x86/fpu.h>
|
||||
@@ -238,10 +238,10 @@ static const RegisterSet g_reg_sets_x86_64[k_num_register_sets] = {
|
||||
NativeRegisterContextFreeBSD *
|
||||
NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(
|
||||
const ArchSpec &target_arch, NativeThreadFreeBSD &native_thread) {
|
||||
return new NativeRegisterContextFreeBSD_x86_64(target_arch, native_thread);
|
||||
return new NativeRegisterContextFreeBSD_x86(target_arch, native_thread);
|
||||
}
|
||||
|
||||
// NativeRegisterContextFreeBSD_x86_64 members.
|
||||
// NativeRegisterContextFreeBSD_x86 members.
|
||||
|
||||
static RegisterInfoInterface *
|
||||
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
|
||||
@@ -257,7 +257,7 @@ CreateRegisterInfoInterface(const ArchSpec &target_arch) {
|
||||
}
|
||||
}
|
||||
|
||||
NativeRegisterContextFreeBSD_x86_64::NativeRegisterContextFreeBSD_x86_64(
|
||||
NativeRegisterContextFreeBSD_x86::NativeRegisterContextFreeBSD_x86(
|
||||
const ArchSpec &target_arch, NativeThreadFreeBSD &native_thread)
|
||||
: NativeRegisterContextRegisterInfo(
|
||||
native_thread, CreateRegisterInfoInterface(target_arch)),
|
||||
@@ -284,12 +284,12 @@ NativeRegisterContextFreeBSD_x86_64::NativeRegisterContextFreeBSD_x86_64(
|
||||
.byte_offset;
|
||||
}
|
||||
|
||||
uint32_t NativeRegisterContextFreeBSD_x86_64::GetRegisterSetCount() const {
|
||||
uint32_t NativeRegisterContextFreeBSD_x86::GetRegisterSetCount() const {
|
||||
return k_num_register_sets;
|
||||
}
|
||||
|
||||
const RegisterSet *
|
||||
NativeRegisterContextFreeBSD_x86_64::GetRegisterSet(uint32_t set_index) const {
|
||||
NativeRegisterContextFreeBSD_x86::GetRegisterSet(uint32_t set_index) const {
|
||||
switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
|
||||
case llvm::Triple::x86:
|
||||
return &g_reg_sets_i386[set_index];
|
||||
@@ -300,8 +300,8 @@ NativeRegisterContextFreeBSD_x86_64::GetRegisterSet(uint32_t set_index) const {
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<NativeRegisterContextFreeBSD_x86_64::RegSetKind>
|
||||
NativeRegisterContextFreeBSD_x86_64::GetSetForNativeRegNum(
|
||||
std::optional<NativeRegisterContextFreeBSD_x86::RegSetKind>
|
||||
NativeRegisterContextFreeBSD_x86::GetSetForNativeRegNum(
|
||||
uint32_t reg_num) const {
|
||||
switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
|
||||
case llvm::Triple::x86:
|
||||
@@ -339,7 +339,7 @@ NativeRegisterContextFreeBSD_x86_64::GetSetForNativeRegNum(
|
||||
llvm_unreachable("Register does not belong to any register set");
|
||||
}
|
||||
|
||||
Status NativeRegisterContextFreeBSD_x86_64::ReadRegisterSet(RegSetKind set) {
|
||||
Status NativeRegisterContextFreeBSD_x86::ReadRegisterSet(RegSetKind set) {
|
||||
switch (set) {
|
||||
case GPRegSet:
|
||||
return NativeProcessFreeBSD::PtraceWrapper(PT_GETREGS, m_thread.GetID(),
|
||||
@@ -377,10 +377,10 @@ Status NativeRegisterContextFreeBSD_x86_64::ReadRegisterSet(RegSetKind set) {
|
||||
m_xsave.data(), m_xsave.size());
|
||||
}
|
||||
}
|
||||
llvm_unreachable("NativeRegisterContextFreeBSD_x86_64::ReadRegisterSet");
|
||||
llvm_unreachable("NativeRegisterContextFreeBSD_x86::ReadRegisterSet");
|
||||
}
|
||||
|
||||
Status NativeRegisterContextFreeBSD_x86_64::WriteRegisterSet(RegSetKind set) {
|
||||
Status NativeRegisterContextFreeBSD_x86::WriteRegisterSet(RegSetKind set) {
|
||||
switch (set) {
|
||||
case GPRegSet:
|
||||
return NativeProcessFreeBSD::PtraceWrapper(PT_SETREGS, m_thread.GetID(),
|
||||
@@ -403,11 +403,11 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteRegisterSet(RegSetKind set) {
|
||||
return NativeProcessFreeBSD::PtraceWrapper(PT_SETXSTATE, GetProcessPid(),
|
||||
m_xsave.data(), m_xsave.size());
|
||||
}
|
||||
llvm_unreachable("NativeRegisterContextFreeBSD_x86_64::WriteRegisterSet");
|
||||
llvm_unreachable("NativeRegisterContextFreeBSD_x86::WriteRegisterSet");
|
||||
}
|
||||
|
||||
Status
|
||||
NativeRegisterContextFreeBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
|
||||
NativeRegisterContextFreeBSD_x86::ReadRegister(const RegisterInfo *reg_info,
|
||||
RegisterValue ®_value) {
|
||||
Status error;
|
||||
|
||||
@@ -473,7 +473,7 @@ NativeRegisterContextFreeBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
|
||||
return error;
|
||||
}
|
||||
|
||||
Status NativeRegisterContextFreeBSD_x86_64::WriteRegister(
|
||||
Status NativeRegisterContextFreeBSD_x86::WriteRegister(
|
||||
const RegisterInfo *reg_info, const RegisterValue ®_value) {
|
||||
|
||||
Status error;
|
||||
@@ -539,7 +539,7 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteRegister(
|
||||
return WriteRegisterSet(set);
|
||||
}
|
||||
|
||||
Status NativeRegisterContextFreeBSD_x86_64::ReadAllRegisterValues(
|
||||
Status NativeRegisterContextFreeBSD_x86::ReadAllRegisterValues(
|
||||
lldb::WritableDataBufferSP &data_sp) {
|
||||
Status error;
|
||||
|
||||
@@ -555,20 +555,20 @@ Status NativeRegisterContextFreeBSD_x86_64::ReadAllRegisterValues(
|
||||
return error;
|
||||
}
|
||||
|
||||
Status NativeRegisterContextFreeBSD_x86_64::WriteAllRegisterValues(
|
||||
Status NativeRegisterContextFreeBSD_x86::WriteAllRegisterValues(
|
||||
const lldb::DataBufferSP &data_sp) {
|
||||
Status error;
|
||||
|
||||
if (!data_sp) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextFreeBSD_x86_64::%s invalid data_sp provided",
|
||||
"NativeRegisterContextFreeBSD_x86::%s invalid data_sp provided",
|
||||
__FUNCTION__);
|
||||
return error;
|
||||
}
|
||||
|
||||
if (data_sp->GetByteSize() != REG_CONTEXT_SIZE) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextFreeBSD_x86_64::%s data_sp contained mismatched "
|
||||
"NativeRegisterContextFreeBSD_x86::%s data_sp contained mismatched "
|
||||
"data size, expected %zu, actual %" PRIu64,
|
||||
__FUNCTION__, REG_CONTEXT_SIZE, data_sp->GetByteSize());
|
||||
return error;
|
||||
@@ -577,7 +577,7 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteAllRegisterValues(
|
||||
const uint8_t *src = data_sp->GetBytes();
|
||||
if (src == nullptr) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextFreeBSD_x86_64::%s "
|
||||
"NativeRegisterContextFreeBSD_x86::%s "
|
||||
"DataBuffer::GetBytes() returned a null "
|
||||
"pointer",
|
||||
__FUNCTION__);
|
||||
@@ -593,9 +593,9 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteAllRegisterValues(
|
||||
return error;
|
||||
}
|
||||
|
||||
llvm::Error NativeRegisterContextFreeBSD_x86_64::CopyHardwareWatchpointsFrom(
|
||||
llvm::Error NativeRegisterContextFreeBSD_x86::CopyHardwareWatchpointsFrom(
|
||||
NativeRegisterContextFreeBSD &source) {
|
||||
auto &r_source = static_cast<NativeRegisterContextFreeBSD_x86_64 &>(source);
|
||||
auto &r_source = static_cast<NativeRegisterContextFreeBSD_x86 &>(source);
|
||||
// NB: This implicitly reads the whole dbreg set.
|
||||
RegisterValue dr7;
|
||||
Status res = r_source.ReadRegister(GetDR(7), dr7);
|
||||
@@ -611,7 +611,7 @@ llvm::Error NativeRegisterContextFreeBSD_x86_64::CopyHardwareWatchpointsFrom(
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
NativeRegisterContextFreeBSD_x86_64::GetOffsetRegSetData(RegSetKind set,
|
||||
NativeRegisterContextFreeBSD_x86::GetOffsetRegSetData(RegSetKind set,
|
||||
size_t reg_offset) {
|
||||
uint8_t *base;
|
||||
switch (set) {
|
||||
@@ -633,8 +633,8 @@ NativeRegisterContextFreeBSD_x86_64::GetOffsetRegSetData(RegSetKind set,
|
||||
return base + (reg_offset - m_regset_offsets[set]);
|
||||
}
|
||||
|
||||
std::optional<NativeRegisterContextFreeBSD_x86_64::YMMSplitPtr>
|
||||
NativeRegisterContextFreeBSD_x86_64::GetYMMSplitReg(uint32_t reg) {
|
||||
std::optional<NativeRegisterContextFreeBSD_x86::YMMSplitPtr>
|
||||
NativeRegisterContextFreeBSD_x86::GetYMMSplitReg(uint32_t reg) {
|
||||
uint32_t offset = m_xsave_offsets[YMMRegSet];
|
||||
if (offset == LLDB_INVALID_XSAVE_OFFSET)
|
||||
return std::nullopt;
|
||||
@@ -657,4 +657,4 @@ NativeRegisterContextFreeBSD_x86_64::GetYMMSplitReg(uint32_t reg) {
|
||||
return YMMSplitPtr{&fpreg->sv_xmm[reg_index], &ymmreg[reg_index]};
|
||||
}
|
||||
|
||||
#endif // defined(__x86_64__)
|
||||
#endif // defined(__i386__) || defined(__x86_64__)
|
||||
@@ -94,4 +94,4 @@ private:
|
||||
|
||||
#endif // #ifndef lldb_NativeRegisterContextFreeBSD_x86_64_h
|
||||
|
||||
#endif // defined(__x86_64__)
|
||||
#endif // defined(__i386__) || defined(__x86_64__)
|
||||
@@ -13,7 +13,7 @@ add_lldb_library(lldbPluginProcessLinux
|
||||
NativeRegisterContextLinux_ppc64le.cpp
|
||||
NativeRegisterContextLinux_riscv64.cpp
|
||||
NativeRegisterContextLinux_s390x.cpp
|
||||
NativeRegisterContextLinux_x86_64.cpp
|
||||
NativeRegisterContextLinux_x86.cpp
|
||||
NativeThreadLinux.cpp
|
||||
Perf.cpp
|
||||
Procfs.cpp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- NativeRegisterContextLinux_x86_64.cpp -----------------------------===//
|
||||
//===-- NativeRegisterContextLinux_x86.cpp --------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#include "NativeRegisterContextLinux_x86_64.h"
|
||||
#include "NativeRegisterContextLinux_x86.h"
|
||||
#include "Plugins/Process/Linux/NativeThreadLinux.h"
|
||||
#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
|
||||
#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
|
||||
@@ -253,7 +253,7 @@ std::unique_ptr<NativeRegisterContextLinux>
|
||||
NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
|
||||
const ArchSpec &target_arch, NativeThreadLinux &native_thread) {
|
||||
return std::unique_ptr<NativeRegisterContextLinux>(
|
||||
new NativeRegisterContextLinux_x86_64(target_arch, native_thread));
|
||||
new NativeRegisterContextLinux_x86(target_arch, native_thread));
|
||||
}
|
||||
|
||||
llvm::Expected<ArchSpec>
|
||||
@@ -262,7 +262,7 @@ NativeRegisterContextLinux::DetermineArchitecture(lldb::tid_t tid) {
|
||||
tid, RegisterContextLinux_x86_64::GetGPRSizeStatic());
|
||||
}
|
||||
|
||||
// NativeRegisterContextLinux_x86_64 members.
|
||||
// NativeRegisterContextLinux_x86 members.
|
||||
|
||||
static std::unique_ptr<RegisterContextLinux_x86>
|
||||
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
|
||||
@@ -295,7 +295,7 @@ static std::size_t GetXSTATESize() {
|
||||
return std::max<std::size_t>(ecx, sizeof(FPR));
|
||||
}
|
||||
|
||||
NativeRegisterContextLinux_x86_64::NativeRegisterContextLinux_x86_64(
|
||||
NativeRegisterContextLinux_x86::NativeRegisterContextLinux_x86(
|
||||
const ArchSpec &target_arch, NativeThreadProtocol &native_thread)
|
||||
: NativeRegisterContextRegisterInfo(
|
||||
native_thread, CreateRegisterInfoInterface(target_arch).release()),
|
||||
@@ -375,7 +375,7 @@ NativeRegisterContextLinux_x86_64::NativeRegisterContextLinux_x86_64(
|
||||
|
||||
// CONSIDER after local and llgs debugging are merged, register set support can
|
||||
// be moved into a base x86-64 class with IsRegisterSetAvailable made virtual.
|
||||
uint32_t NativeRegisterContextLinux_x86_64::GetRegisterSetCount() const {
|
||||
uint32_t NativeRegisterContextLinux_x86::GetRegisterSetCount() const {
|
||||
uint32_t sets = 0;
|
||||
for (uint32_t set_index = 0; set_index < k_num_register_sets; ++set_index) {
|
||||
if (IsRegisterSetAvailable(set_index))
|
||||
@@ -385,7 +385,7 @@ uint32_t NativeRegisterContextLinux_x86_64::GetRegisterSetCount() const {
|
||||
return sets;
|
||||
}
|
||||
|
||||
uint32_t NativeRegisterContextLinux_x86_64::GetUserRegisterCount() const {
|
||||
uint32_t NativeRegisterContextLinux_x86::GetUserRegisterCount() const {
|
||||
uint32_t count = 0;
|
||||
for (uint32_t set_index = 0; set_index < k_num_register_sets; ++set_index) {
|
||||
const RegisterSet *set = GetRegisterSet(set_index);
|
||||
@@ -396,7 +396,7 @@ uint32_t NativeRegisterContextLinux_x86_64::GetUserRegisterCount() const {
|
||||
}
|
||||
|
||||
const RegisterSet *
|
||||
NativeRegisterContextLinux_x86_64::GetRegisterSet(uint32_t set_index) const {
|
||||
NativeRegisterContextLinux_x86::GetRegisterSet(uint32_t set_index) const {
|
||||
if (!IsRegisterSetAvailable(set_index))
|
||||
return nullptr;
|
||||
|
||||
@@ -414,7 +414,7 @@ NativeRegisterContextLinux_x86_64::GetRegisterSet(uint32_t set_index) const {
|
||||
}
|
||||
|
||||
Status
|
||||
NativeRegisterContextLinux_x86_64::ReadRegister(const RegisterInfo *reg_info,
|
||||
NativeRegisterContextLinux_x86::ReadRegister(const RegisterInfo *reg_info,
|
||||
RegisterValue ®_value) {
|
||||
Status error;
|
||||
|
||||
@@ -566,7 +566,7 @@ NativeRegisterContextLinux_x86_64::ReadRegister(const RegisterInfo *reg_info,
|
||||
return error;
|
||||
}
|
||||
|
||||
void NativeRegisterContextLinux_x86_64::UpdateXSTATEforWrite(
|
||||
void NativeRegisterContextLinux_x86::UpdateXSTATEforWrite(
|
||||
uint32_t reg_index) {
|
||||
XSAVE_HDR::XFeature &xstate_bv = m_xstate->xsave.header.xstate_bv;
|
||||
if (IsFPR(reg_index)) {
|
||||
@@ -582,7 +582,7 @@ void NativeRegisterContextLinux_x86_64::UpdateXSTATEforWrite(
|
||||
}
|
||||
}
|
||||
|
||||
Status NativeRegisterContextLinux_x86_64::WriteRegister(
|
||||
Status NativeRegisterContextLinux_x86::WriteRegister(
|
||||
const RegisterInfo *reg_info, const RegisterValue ®_value) {
|
||||
assert(reg_info && "reg_info is null");
|
||||
|
||||
@@ -697,7 +697,7 @@ Status NativeRegisterContextLinux_x86_64::WriteRegister(
|
||||
"write strategy unknown");
|
||||
}
|
||||
|
||||
Status NativeRegisterContextLinux_x86_64::ReadAllRegisterValues(
|
||||
Status NativeRegisterContextLinux_x86::ReadAllRegisterValues(
|
||||
lldb::WritableDataBufferSP &data_sp) {
|
||||
Status error;
|
||||
|
||||
@@ -724,7 +724,7 @@ Status NativeRegisterContextLinux_x86_64::ReadAllRegisterValues(
|
||||
++reg) {
|
||||
if (!CopyXSTATEtoYMM(reg, byte_order)) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextLinux_x86_64::%s "
|
||||
"NativeRegisterContextLinux_x86::%s "
|
||||
"CopyXSTATEtoYMM() failed for reg num "
|
||||
"%" PRIu32,
|
||||
__FUNCTION__, reg);
|
||||
@@ -738,7 +738,7 @@ Status NativeRegisterContextLinux_x86_64::ReadAllRegisterValues(
|
||||
++reg) {
|
||||
if (!CopyXSTATEtoMPX(reg)) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextLinux_x86_64::%s "
|
||||
"NativeRegisterContextLinux_x86::%s "
|
||||
"CopyXSTATEtoMPX() failed for reg num "
|
||||
"%" PRIu32,
|
||||
__FUNCTION__, reg);
|
||||
@@ -767,13 +767,13 @@ Status NativeRegisterContextLinux_x86_64::ReadAllRegisterValues(
|
||||
return error;
|
||||
}
|
||||
|
||||
Status NativeRegisterContextLinux_x86_64::WriteAllRegisterValues(
|
||||
Status NativeRegisterContextLinux_x86::WriteAllRegisterValues(
|
||||
const lldb::DataBufferSP &data_sp) {
|
||||
Status error;
|
||||
|
||||
if (!data_sp) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextLinux_x86_64::%s invalid data_sp provided",
|
||||
"NativeRegisterContextLinux_x86::%s invalid data_sp provided",
|
||||
__FUNCTION__);
|
||||
return error;
|
||||
}
|
||||
@@ -788,7 +788,7 @@ Status NativeRegisterContextLinux_x86_64::WriteAllRegisterValues(
|
||||
const uint8_t *src = data_sp->GetBytes();
|
||||
if (src == nullptr) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextLinux_x86_64::%s "
|
||||
"NativeRegisterContextLinux_x86::%s "
|
||||
"DataBuffer::GetBytes() returned a null "
|
||||
"pointer",
|
||||
__FUNCTION__);
|
||||
@@ -819,7 +819,7 @@ Status NativeRegisterContextLinux_x86_64::WriteAllRegisterValues(
|
||||
++reg) {
|
||||
if (!CopyYMMtoXSTATE(reg, byte_order)) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextLinux_x86_64::%s "
|
||||
"NativeRegisterContextLinux_x86::%s "
|
||||
"CopyYMMtoXSTATE() failed for reg num "
|
||||
"%" PRIu32,
|
||||
__FUNCTION__, reg);
|
||||
@@ -833,7 +833,7 @@ Status NativeRegisterContextLinux_x86_64::WriteAllRegisterValues(
|
||||
++reg) {
|
||||
if (!CopyMPXtoXSTATE(reg)) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextLinux_x86_64::%s "
|
||||
"NativeRegisterContextLinux_x86::%s "
|
||||
"CopyMPXtoXSTATE() failed for reg num "
|
||||
"%" PRIu32,
|
||||
__FUNCTION__, reg);
|
||||
@@ -846,10 +846,10 @@ Status NativeRegisterContextLinux_x86_64::WriteAllRegisterValues(
|
||||
return error;
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::IsCPUFeatureAvailable(
|
||||
bool NativeRegisterContextLinux_x86::IsCPUFeatureAvailable(
|
||||
RegSet feature_code) const {
|
||||
if (m_xstate_type == XStateType::Invalid) {
|
||||
if (const_cast<NativeRegisterContextLinux_x86_64 *>(this)->ReadFPR().Fail())
|
||||
if (const_cast<NativeRegisterContextLinux_x86 *>(this)->ReadFPR().Fail())
|
||||
return false;
|
||||
}
|
||||
switch (feature_code) {
|
||||
@@ -870,7 +870,7 @@ bool NativeRegisterContextLinux_x86_64::IsCPUFeatureAvailable(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::IsRegisterSetAvailable(
|
||||
bool NativeRegisterContextLinux_x86::IsRegisterSetAvailable(
|
||||
uint32_t set_index) const {
|
||||
uint32_t num_sets = k_num_register_sets - k_num_extended_register_sets;
|
||||
|
||||
@@ -886,22 +886,22 @@ bool NativeRegisterContextLinux_x86_64::IsRegisterSetAvailable(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::IsGPR(uint32_t reg_index) const {
|
||||
bool NativeRegisterContextLinux_x86::IsGPR(uint32_t reg_index) const {
|
||||
// GPRs come first.
|
||||
return reg_index <= m_reg_info.last_gpr;
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::IsFPR(uint32_t reg_index) const {
|
||||
bool NativeRegisterContextLinux_x86::IsFPR(uint32_t reg_index) const {
|
||||
return (m_reg_info.first_fpr <= reg_index &&
|
||||
reg_index <= m_reg_info.last_fpr);
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::IsDR(uint32_t reg_index) const {
|
||||
bool NativeRegisterContextLinux_x86::IsDR(uint32_t reg_index) const {
|
||||
return (m_reg_info.first_dr <= reg_index &&
|
||||
reg_index <= m_reg_info.last_dr);
|
||||
}
|
||||
|
||||
Status NativeRegisterContextLinux_x86_64::WriteFPR() {
|
||||
Status NativeRegisterContextLinux_x86::WriteFPR() {
|
||||
switch (m_xstate_type) {
|
||||
case XStateType::FXSAVE:
|
||||
return WriteRegisterSet(
|
||||
@@ -914,14 +914,14 @@ Status NativeRegisterContextLinux_x86_64::WriteFPR() {
|
||||
}
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::IsAVX(uint32_t reg_index) const {
|
||||
bool NativeRegisterContextLinux_x86::IsAVX(uint32_t reg_index) const {
|
||||
if (!IsCPUFeatureAvailable(RegSet::avx))
|
||||
return false;
|
||||
return (m_reg_info.first_ymm <= reg_index &&
|
||||
reg_index <= m_reg_info.last_ymm);
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::CopyXSTATEtoYMM(
|
||||
bool NativeRegisterContextLinux_x86::CopyXSTATEtoYMM(
|
||||
uint32_t reg_index, lldb::ByteOrder byte_order) {
|
||||
if (!IsAVX(reg_index))
|
||||
return false;
|
||||
@@ -937,7 +937,7 @@ bool NativeRegisterContextLinux_x86_64::CopyXSTATEtoYMM(
|
||||
return false; // unsupported or invalid byte order
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::CopyYMMtoXSTATE(
|
||||
bool NativeRegisterContextLinux_x86::CopyYMMtoXSTATE(
|
||||
uint32_t reg, lldb::ByteOrder byte_order) {
|
||||
if (!IsAVX(reg))
|
||||
return false;
|
||||
@@ -953,7 +953,7 @@ bool NativeRegisterContextLinux_x86_64::CopyYMMtoXSTATE(
|
||||
return false; // unsupported or invalid byte order
|
||||
}
|
||||
|
||||
void *NativeRegisterContextLinux_x86_64::GetFPRBuffer() {
|
||||
void *NativeRegisterContextLinux_x86::GetFPRBuffer() {
|
||||
switch (m_xstate_type) {
|
||||
case XStateType::FXSAVE:
|
||||
return &m_xstate->fxsave;
|
||||
@@ -964,7 +964,7 @@ void *NativeRegisterContextLinux_x86_64::GetFPRBuffer() {
|
||||
}
|
||||
}
|
||||
|
||||
size_t NativeRegisterContextLinux_x86_64::GetFPRSize() {
|
||||
size_t NativeRegisterContextLinux_x86::GetFPRSize() {
|
||||
switch (m_xstate_type) {
|
||||
case XStateType::FXSAVE:
|
||||
return sizeof(m_xstate->fxsave);
|
||||
@@ -975,7 +975,7 @@ size_t NativeRegisterContextLinux_x86_64::GetFPRSize() {
|
||||
}
|
||||
}
|
||||
|
||||
Status NativeRegisterContextLinux_x86_64::ReadFPR() {
|
||||
Status NativeRegisterContextLinux_x86::ReadFPR() {
|
||||
Status error;
|
||||
|
||||
// Probe XSAVE and if it is not supported fall back to FXSAVE.
|
||||
@@ -996,14 +996,14 @@ Status NativeRegisterContextLinux_x86_64::ReadFPR() {
|
||||
return Status::FromErrorString("Unrecognized FPR type.");
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::IsMPX(uint32_t reg_index) const {
|
||||
bool NativeRegisterContextLinux_x86::IsMPX(uint32_t reg_index) const {
|
||||
if (!IsCPUFeatureAvailable(RegSet::mpx))
|
||||
return false;
|
||||
return (m_reg_info.first_mpxr <= reg_index &&
|
||||
reg_index <= m_reg_info.last_mpxc);
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::CopyXSTATEtoMPX(uint32_t reg) {
|
||||
bool NativeRegisterContextLinux_x86::CopyXSTATEtoMPX(uint32_t reg) {
|
||||
if (!IsMPX(reg))
|
||||
return false;
|
||||
|
||||
@@ -1019,7 +1019,7 @@ bool NativeRegisterContextLinux_x86_64::CopyXSTATEtoMPX(uint32_t reg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_x86_64::CopyMPXtoXSTATE(uint32_t reg) {
|
||||
bool NativeRegisterContextLinux_x86::CopyMPXtoXSTATE(uint32_t reg) {
|
||||
if (!IsMPX(reg))
|
||||
return false;
|
||||
|
||||
@@ -1034,14 +1034,14 @@ bool NativeRegisterContextLinux_x86_64::CopyMPXtoXSTATE(uint32_t reg) {
|
||||
}
|
||||
|
||||
uint32_t
|
||||
NativeRegisterContextLinux_x86_64::GetPtraceOffset(uint32_t reg_index) {
|
||||
NativeRegisterContextLinux_x86::GetPtraceOffset(uint32_t reg_index) {
|
||||
// If register is MPX, remove extra factor from gdb offset
|
||||
return GetRegisterInfoAtIndex(reg_index)->byte_offset -
|
||||
(IsMPX(reg_index) ? 128 : 0);
|
||||
}
|
||||
|
||||
std::optional<NativeRegisterContextLinux::SyscallData>
|
||||
NativeRegisterContextLinux_x86_64::GetSyscallData() {
|
||||
NativeRegisterContextLinux_x86::GetSyscallData() {
|
||||
switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
|
||||
case llvm::Triple::x86: {
|
||||
static const uint8_t Int80[] = {0xcd, 0x80};
|
||||
@@ -1063,7 +1063,7 @@ NativeRegisterContextLinux_x86_64::GetSyscallData() {
|
||||
}
|
||||
|
||||
std::optional<NativeRegisterContextLinux::MmapData>
|
||||
NativeRegisterContextLinux_x86_64::GetMmapData() {
|
||||
NativeRegisterContextLinux_x86::GetMmapData() {
|
||||
switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
|
||||
case llvm::Triple::x86:
|
||||
return MmapData{192, 91};
|
||||
@@ -1074,7 +1074,7 @@ NativeRegisterContextLinux_x86_64::GetMmapData() {
|
||||
}
|
||||
}
|
||||
|
||||
const RegisterInfo *NativeRegisterContextLinux_x86_64::GetDR(int num) const {
|
||||
const RegisterInfo *NativeRegisterContextLinux_x86::GetDR(int num) const {
|
||||
assert(num >= 0 && num <= 7);
|
||||
switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
|
||||
case llvm::Triple::x86:
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- NativeRegisterContextLinux_x86_64.h ---------------------*- C++ -*-===//
|
||||
//===-- NativeRegisterContextLinux_x86.h ------------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#ifndef lldb_NativeRegisterContextLinux_x86_64_h
|
||||
#define lldb_NativeRegisterContextLinux_x86_64_h
|
||||
#ifndef lldb_NativeRegisterContextLinux_x86_h
|
||||
#define lldb_NativeRegisterContextLinux_x86_h
|
||||
|
||||
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
|
||||
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h"
|
||||
@@ -24,11 +24,11 @@ namespace process_linux {
|
||||
|
||||
class NativeProcessLinux;
|
||||
|
||||
class NativeRegisterContextLinux_x86_64
|
||||
class NativeRegisterContextLinux_x86
|
||||
: public NativeRegisterContextLinux,
|
||||
public NativeRegisterContextDBReg_x86 {
|
||||
public:
|
||||
NativeRegisterContextLinux_x86_64(const ArchSpec &target_arch,
|
||||
NativeRegisterContextLinux_x86(const ArchSpec &target_arch,
|
||||
NativeThreadProtocol &native_thread);
|
||||
|
||||
uint32_t GetRegisterSetCount() const override;
|
||||
@@ -143,6 +143,6 @@ private:
|
||||
} // namespace process_linux
|
||||
} // namespace lldb_private
|
||||
|
||||
#endif // #ifndef lldb_NativeRegisterContextLinux_x86_64_h
|
||||
#endif // #ifndef lldb_NativeRegisterContextLinux_x86_h
|
||||
|
||||
#endif // defined(__i386__) || defined(__x86_64__)
|
||||
@@ -1,7 +1,7 @@
|
||||
add_lldb_library(lldbPluginProcessNetBSD
|
||||
NativeProcessNetBSD.cpp
|
||||
NativeRegisterContextNetBSD.cpp
|
||||
NativeRegisterContextNetBSD_x86_64.cpp
|
||||
NativeRegisterContextNetBSD_x86.cpp
|
||||
NativeThreadNetBSD.cpp
|
||||
|
||||
LINK_COMPONENTS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- NativeRegisterContextNetBSD_x86_64.cpp ----------------------------===//
|
||||
//===-- NativeRegisterContextNetBSD_x86.cpp -------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#include "NativeRegisterContextNetBSD_x86_64.h"
|
||||
#include "NativeRegisterContextNetBSD_x86.h"
|
||||
|
||||
#include "lldb/Host/HostInfo.h"
|
||||
#include "lldb/Utility/DataBufferHeap.h"
|
||||
@@ -245,10 +245,10 @@ static const RegisterSet g_reg_sets_x86_64[k_num_register_sets] = {
|
||||
NativeRegisterContextNetBSD *
|
||||
NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD(
|
||||
const ArchSpec &target_arch, NativeThreadProtocol &native_thread) {
|
||||
return new NativeRegisterContextNetBSD_x86_64(target_arch, native_thread);
|
||||
return new NativeRegisterContextNetBSD_x86(target_arch, native_thread);
|
||||
}
|
||||
|
||||
// NativeRegisterContextNetBSD_x86_64 members.
|
||||
// NativeRegisterContextNetBSD_x86 members.
|
||||
|
||||
static RegisterInfoInterface *
|
||||
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
|
||||
@@ -264,7 +264,7 @@ CreateRegisterInfoInterface(const ArchSpec &target_arch) {
|
||||
}
|
||||
}
|
||||
|
||||
NativeRegisterContextNetBSD_x86_64::NativeRegisterContextNetBSD_x86_64(
|
||||
NativeRegisterContextNetBSD_x86::NativeRegisterContextNetBSD_x86(
|
||||
const ArchSpec &target_arch, NativeThreadProtocol &native_thread)
|
||||
: NativeRegisterContextRegisterInfo(
|
||||
native_thread, CreateRegisterInfoInterface(target_arch)),
|
||||
@@ -291,12 +291,12 @@ NativeRegisterContextNetBSD_x86_64::NativeRegisterContextNetBSD_x86_64(
|
||||
.byte_offset;
|
||||
}
|
||||
|
||||
uint32_t NativeRegisterContextNetBSD_x86_64::GetRegisterSetCount() const {
|
||||
uint32_t NativeRegisterContextNetBSD_x86::GetRegisterSetCount() const {
|
||||
return k_num_register_sets;
|
||||
}
|
||||
|
||||
const RegisterSet *
|
||||
NativeRegisterContextNetBSD_x86_64::GetRegisterSet(uint32_t set_index) const {
|
||||
NativeRegisterContextNetBSD_x86::GetRegisterSet(uint32_t set_index) const {
|
||||
switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
|
||||
case llvm::Triple::x86:
|
||||
return &g_reg_sets_i386[set_index];
|
||||
@@ -307,8 +307,8 @@ NativeRegisterContextNetBSD_x86_64::GetRegisterSet(uint32_t set_index) const {
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<NativeRegisterContextNetBSD_x86_64::RegSetKind>
|
||||
NativeRegisterContextNetBSD_x86_64::GetSetForNativeRegNum(
|
||||
std::optional<NativeRegisterContextNetBSD_x86::RegSetKind>
|
||||
NativeRegisterContextNetBSD_x86::GetSetForNativeRegNum(
|
||||
uint32_t reg_num) const {
|
||||
switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
|
||||
case llvm::Triple::x86:
|
||||
@@ -346,7 +346,7 @@ NativeRegisterContextNetBSD_x86_64::GetSetForNativeRegNum(
|
||||
llvm_unreachable("Register does not belong to any register set");
|
||||
}
|
||||
|
||||
Status NativeRegisterContextNetBSD_x86_64::ReadRegisterSet(RegSetKind set) {
|
||||
Status NativeRegisterContextNetBSD_x86::ReadRegisterSet(RegSetKind set) {
|
||||
switch (set) {
|
||||
case GPRegSet:
|
||||
return DoRegisterSet(PT_GETREGS, m_gpr.data());
|
||||
@@ -361,10 +361,10 @@ Status NativeRegisterContextNetBSD_x86_64::ReadRegisterSet(RegSetKind set) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
llvm_unreachable("NativeRegisterContextNetBSD_x86_64::ReadRegisterSet");
|
||||
llvm_unreachable("NativeRegisterContextNetBSD_x86::ReadRegisterSet");
|
||||
}
|
||||
|
||||
Status NativeRegisterContextNetBSD_x86_64::WriteRegisterSet(RegSetKind set) {
|
||||
Status NativeRegisterContextNetBSD_x86::WriteRegisterSet(RegSetKind set) {
|
||||
switch (set) {
|
||||
case GPRegSet:
|
||||
return DoRegisterSet(PT_SETREGS, m_gpr.data());
|
||||
@@ -377,11 +377,11 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegisterSet(RegSetKind set) {
|
||||
return DoRegisterSet(PT_SETXSTATE, &iov);
|
||||
}
|
||||
}
|
||||
llvm_unreachable("NativeRegisterContextNetBSD_x86_64::WriteRegisterSet");
|
||||
llvm_unreachable("NativeRegisterContextNetBSD_x86::WriteRegisterSet");
|
||||
}
|
||||
|
||||
Status
|
||||
NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
|
||||
NativeRegisterContextNetBSD_x86::ReadRegister(const RegisterInfo *reg_info,
|
||||
RegisterValue ®_value) {
|
||||
Status error;
|
||||
|
||||
@@ -448,7 +448,7 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
|
||||
return error;
|
||||
}
|
||||
|
||||
Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
|
||||
Status NativeRegisterContextNetBSD_x86::WriteRegister(
|
||||
const RegisterInfo *reg_info, const RegisterValue ®_value) {
|
||||
|
||||
Status error;
|
||||
@@ -529,7 +529,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
|
||||
return WriteRegisterSet(set);
|
||||
}
|
||||
|
||||
Status NativeRegisterContextNetBSD_x86_64::ReadAllRegisterValues(
|
||||
Status NativeRegisterContextNetBSD_x86::ReadAllRegisterValues(
|
||||
lldb::WritableDataBufferSP &data_sp) {
|
||||
Status error;
|
||||
|
||||
@@ -545,20 +545,20 @@ Status NativeRegisterContextNetBSD_x86_64::ReadAllRegisterValues(
|
||||
return error;
|
||||
}
|
||||
|
||||
Status NativeRegisterContextNetBSD_x86_64::WriteAllRegisterValues(
|
||||
Status NativeRegisterContextNetBSD_x86::WriteAllRegisterValues(
|
||||
const lldb::DataBufferSP &data_sp) {
|
||||
Status error;
|
||||
|
||||
if (!data_sp) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextNetBSD_x86_64::%s invalid data_sp provided",
|
||||
"NativeRegisterContextNetBSD_x86::%s invalid data_sp provided",
|
||||
__FUNCTION__);
|
||||
return error;
|
||||
}
|
||||
|
||||
if (data_sp->GetByteSize() != REG_CONTEXT_SIZE) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextNetBSD_x86_64::%s data_sp contained mismatched "
|
||||
"NativeRegisterContextNetBSD_x86::%s data_sp contained mismatched "
|
||||
"data size, expected %zu, actual %" PRIu64,
|
||||
__FUNCTION__, REG_CONTEXT_SIZE, data_sp->GetByteSize());
|
||||
return error;
|
||||
@@ -567,7 +567,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteAllRegisterValues(
|
||||
const uint8_t *src = data_sp->GetBytes();
|
||||
if (src == nullptr) {
|
||||
error = Status::FromErrorStringWithFormat(
|
||||
"NativeRegisterContextNetBSD_x86_64::%s "
|
||||
"NativeRegisterContextNetBSD_x86::%s "
|
||||
"DataBuffer::GetBytes() returned a null "
|
||||
"pointer",
|
||||
__FUNCTION__);
|
||||
@@ -583,9 +583,9 @@ Status NativeRegisterContextNetBSD_x86_64::WriteAllRegisterValues(
|
||||
return error;
|
||||
}
|
||||
|
||||
llvm::Error NativeRegisterContextNetBSD_x86_64::CopyHardwareWatchpointsFrom(
|
||||
llvm::Error NativeRegisterContextNetBSD_x86::CopyHardwareWatchpointsFrom(
|
||||
NativeRegisterContextNetBSD &source) {
|
||||
auto &r_source = static_cast<NativeRegisterContextNetBSD_x86_64 &>(source);
|
||||
auto &r_source = static_cast<NativeRegisterContextNetBSD_x86 &>(source);
|
||||
// NB: This implicitly reads the whole dbreg set.
|
||||
RegisterValue dr7;
|
||||
Status res = r_source.ReadRegister(GetDR(7), dr7);
|
||||
@@ -601,7 +601,7 @@ llvm::Error NativeRegisterContextNetBSD_x86_64::CopyHardwareWatchpointsFrom(
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
NativeRegisterContextNetBSD_x86_64::GetOffsetRegSetData(RegSetKind set,
|
||||
NativeRegisterContextNetBSD_x86::GetOffsetRegSetData(RegSetKind set,
|
||||
size_t reg_offset) {
|
||||
uint8_t *base;
|
||||
switch (set) {
|
||||
@@ -623,8 +623,8 @@ NativeRegisterContextNetBSD_x86_64::GetOffsetRegSetData(RegSetKind set,
|
||||
return base + (reg_offset - m_regset_offsets[set]);
|
||||
}
|
||||
|
||||
std::optional<NativeRegisterContextNetBSD_x86_64::YMMSplitPtr>
|
||||
NativeRegisterContextNetBSD_x86_64::GetYMMSplitReg(uint32_t reg) {
|
||||
std::optional<NativeRegisterContextNetBSD_x86::YMMSplitPtr>
|
||||
NativeRegisterContextNetBSD_x86::GetYMMSplitReg(uint32_t reg) {
|
||||
auto xst = reinterpret_cast<xstate *>(m_xstate.data());
|
||||
if (!(xst->xs_rfbm & XCR0_SSE) || !(xst->xs_rfbm & XCR0_YMM_Hi128))
|
||||
return std::nullopt;
|
||||
@@ -645,4 +645,4 @@ NativeRegisterContextNetBSD_x86_64::GetYMMSplitReg(uint32_t reg) {
|
||||
&xst->xs_ymm_hi128.xs_ymm[reg_index]};
|
||||
}
|
||||
|
||||
#endif // defined(__x86_64__)
|
||||
#endif // defined(__i386__) || defined(__x86_64__)
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- NativeRegisterContextNetBSD_x86_64.h --------------------*- C++ -*-===//
|
||||
//===-- NativeRegisterContextNetBSD_x86.h -----------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
|
||||
#define lldb_NativeRegisterContextNetBSD_x86_64_h
|
||||
#ifndef lldb_NativeRegisterContextNetBSD_x86_h
|
||||
#define lldb_NativeRegisterContextNetBSD_x86_h
|
||||
|
||||
// clang-format off
|
||||
#include <sys/param.h>
|
||||
@@ -31,11 +31,11 @@ namespace process_netbsd {
|
||||
|
||||
class NativeProcessNetBSD;
|
||||
|
||||
class NativeRegisterContextNetBSD_x86_64
|
||||
class NativeRegisterContextNetBSD_x86
|
||||
: public NativeRegisterContextNetBSD,
|
||||
public NativeRegisterContextDBReg_x86 {
|
||||
public:
|
||||
NativeRegisterContextNetBSD_x86_64(const ArchSpec &target_arch,
|
||||
NativeRegisterContextNetBSD_x86(const ArchSpec &target_arch,
|
||||
NativeThreadProtocol &native_thread);
|
||||
uint32_t GetRegisterSetCount() const override;
|
||||
|
||||
@@ -89,6 +89,6 @@ private:
|
||||
} // namespace process_netbsd
|
||||
} // namespace lldb_private
|
||||
|
||||
#endif // #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
|
||||
#endif // #ifndef lldb_NativeRegisterContextNetBSD_x86_h
|
||||
|
||||
#endif // defined(__x86_64__)
|
||||
#endif // defined(__i386__) || defined(__x86_64__)
|
||||
@@ -1,13 +1,13 @@
|
||||
add_lldb_library(lldbPluginProcessElfCore PLUGIN
|
||||
ProcessElfCore.cpp
|
||||
ThreadElfCore.cpp
|
||||
RegisterContextLinuxCore_x86_64.cpp
|
||||
RegisterContextLinuxCore_x86.cpp
|
||||
RegisterContextPOSIXCore_arm.cpp
|
||||
RegisterContextPOSIXCore_arm64.cpp
|
||||
RegisterContextPOSIXCore_powerpc.cpp
|
||||
RegisterContextPOSIXCore_ppc64le.cpp
|
||||
RegisterContextPOSIXCore_s390x.cpp
|
||||
RegisterContextPOSIXCore_x86_64.cpp
|
||||
RegisterContextPOSIXCore_x86.cpp
|
||||
RegisterContextPOSIXCore_riscv32.cpp
|
||||
RegisterContextPOSIXCore_riscv64.cpp
|
||||
RegisterContextPOSIXCore_loongarch64.cpp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- RegisterContextLinuxCore_x86_64.cpp -------------------------------===//
|
||||
//===-- RegisterContextLinuxCore_x86.cpp ----------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,7 +6,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "RegisterContextLinuxCore_x86_64.h"
|
||||
#include "RegisterContextLinuxCore_x86.h"
|
||||
#include "lldb/Target/Thread.h"
|
||||
#include "lldb/Utility/DataExtractor.h"
|
||||
#include "lldb/Utility/RegisterValue.h"
|
||||
@@ -210,12 +210,12 @@ static const RegisterSet g_reg_sets_x86_64[] = {
|
||||
{"Advanced Vector Extensions", "avx", x86_64_with_base::k_num_avx_registers,
|
||||
g_avx_regnums_x86_64}};
|
||||
|
||||
RegisterContextLinuxCore_x86_64::RegisterContextLinuxCore_x86_64(
|
||||
RegisterContextLinuxCore_x86::RegisterContextLinuxCore_x86(
|
||||
Thread &thread, RegisterInfoInterface *register_info,
|
||||
const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
|
||||
: RegisterContextCorePOSIX_x86_64(thread, register_info, gpregset, notes) {}
|
||||
: RegisterContextCorePOSIX_x86(thread, register_info, gpregset, notes) {}
|
||||
|
||||
const RegisterSet *RegisterContextLinuxCore_x86_64::GetRegisterSet(size_t set) {
|
||||
const RegisterSet *RegisterContextLinuxCore_x86::GetRegisterSet(size_t set) {
|
||||
if (IsRegisterSetAvailable(set)) {
|
||||
switch (m_register_info_up->GetTargetArchitecture().GetMachine()) {
|
||||
case llvm::Triple::x86:
|
||||
@@ -230,7 +230,7 @@ const RegisterSet *RegisterContextLinuxCore_x86_64::GetRegisterSet(size_t set) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RegInfo &RegisterContextLinuxCore_x86_64::GetRegInfo() {
|
||||
RegInfo &RegisterContextLinuxCore_x86::GetRegInfo() {
|
||||
return GetRegInfoShared(
|
||||
m_register_info_up->GetTargetArchitecture().GetMachine(),
|
||||
/*with_base=*/true);
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- RegisterContextLinuxCore_x86_64.h -----------------------*- C++ -*-===//
|
||||
//===-- RegisterContextLinuxCore_x86.h --------------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,15 +6,15 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTLINUXCORE_X86_64_H
|
||||
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTLINUXCORE_X86_64_H
|
||||
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTLINUXCORE_X86_H
|
||||
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTLINUXCORE_X86_H
|
||||
|
||||
#include "Plugins/Process/elf-core/RegisterUtilities.h"
|
||||
#include "RegisterContextPOSIXCore_x86_64.h"
|
||||
#include "RegisterContextPOSIXCore_x86.h"
|
||||
|
||||
class RegisterContextLinuxCore_x86_64 : public RegisterContextCorePOSIX_x86_64 {
|
||||
class RegisterContextLinuxCore_x86 : public RegisterContextCorePOSIX_x86 {
|
||||
public:
|
||||
RegisterContextLinuxCore_x86_64(
|
||||
RegisterContextLinuxCore_x86(
|
||||
lldb_private::Thread &thread,
|
||||
lldb_private::RegisterInfoInterface *register_info,
|
||||
const lldb_private::DataExtractor &gpregset,
|
||||
@@ -25,4 +25,4 @@ public:
|
||||
lldb_private::RegInfo &GetRegInfo() override;
|
||||
};
|
||||
|
||||
#endif // LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTLINUXCORE_X86_64_H
|
||||
#endif // LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTLINUXCORE_X86_H
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- RegisterContextPOSIXCore_x86_64.cpp -------------------------------===//
|
||||
//===-- RegisterContextPOSIXCore_x86.cpp ----------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,14 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "RegisterContextPOSIXCore_x86_64.h"
|
||||
#include "RegisterContextPOSIXCore_x86.h"
|
||||
#include "lldb/Target/Thread.h"
|
||||
#include "lldb/Utility/DataExtractor.h"
|
||||
#include "lldb/Utility/RegisterValue.h"
|
||||
|
||||
using namespace lldb_private;
|
||||
|
||||
RegisterContextCorePOSIX_x86_64::RegisterContextCorePOSIX_x86_64(
|
||||
RegisterContextCorePOSIX_x86::RegisterContextCorePOSIX_x86(
|
||||
Thread &thread, RegisterInfoInterface *register_info,
|
||||
const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
|
||||
: RegisterContextPOSIX_x86(thread, 0, register_info) {
|
||||
@@ -36,25 +36,25 @@ RegisterContextCorePOSIX_x86_64::RegisterContextCorePOSIX_x86_64(
|
||||
m_fpregset.reset();
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::ReadGPR() {
|
||||
bool RegisterContextCorePOSIX_x86::ReadGPR() {
|
||||
return m_gpregset != nullptr;
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::ReadFPR() {
|
||||
bool RegisterContextCorePOSIX_x86::ReadFPR() {
|
||||
return m_fpregset != nullptr;
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::WriteGPR() {
|
||||
bool RegisterContextCorePOSIX_x86::WriteGPR() {
|
||||
assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::WriteFPR() {
|
||||
bool RegisterContextCorePOSIX_x86::WriteFPR() {
|
||||
assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::ReadRegister(const RegisterInfo *reg_info,
|
||||
bool RegisterContextCorePOSIX_x86::ReadRegister(const RegisterInfo *reg_info,
|
||||
RegisterValue &value) {
|
||||
const uint8_t *src;
|
||||
size_t offset;
|
||||
@@ -79,21 +79,21 @@ bool RegisterContextCorePOSIX_x86_64::ReadRegister(const RegisterInfo *reg_info,
|
||||
return error.Success();
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::ReadAllRegisterValues(
|
||||
bool RegisterContextCorePOSIX_x86::ReadAllRegisterValues(
|
||||
lldb::WritableDataBufferSP &data_sp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::WriteRegister(
|
||||
bool RegisterContextCorePOSIX_x86::WriteRegister(
|
||||
const RegisterInfo *reg_info, const RegisterValue &value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::WriteAllRegisterValues(
|
||||
bool RegisterContextCorePOSIX_x86::WriteAllRegisterValues(
|
||||
const lldb::DataBufferSP &data_sp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RegisterContextCorePOSIX_x86_64::HardwareSingleStep(bool enable) {
|
||||
bool RegisterContextCorePOSIX_x86::HardwareSingleStep(bool enable) {
|
||||
return false;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- RegisterContextPOSIXCore_x86_64.h -----------------------*- C++ -*-===//
|
||||
//===-- RegisterContextPOSIXCore_x86.h --------------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,15 +6,15 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_X86_64_H
|
||||
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_X86_64_H
|
||||
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_X86_H
|
||||
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_X86_H
|
||||
|
||||
#include "Plugins/Process/Utility/RegisterContextPOSIX_x86.h"
|
||||
#include "Plugins/Process/elf-core/RegisterUtilities.h"
|
||||
|
||||
class RegisterContextCorePOSIX_x86_64 : public RegisterContextPOSIX_x86 {
|
||||
class RegisterContextCorePOSIX_x86 : public RegisterContextPOSIX_x86 {
|
||||
public:
|
||||
RegisterContextCorePOSIX_x86_64(
|
||||
RegisterContextCorePOSIX_x86(
|
||||
lldb_private::Thread &thread,
|
||||
lldb_private::RegisterInfoInterface *register_info,
|
||||
const lldb_private::DataExtractor &gpregset,
|
||||
@@ -46,4 +46,4 @@ private:
|
||||
std::unique_ptr<uint8_t[]> m_fpregset;
|
||||
};
|
||||
|
||||
#endif // LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_X86_64_H
|
||||
#endif // LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_X86_H
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
|
||||
#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h"
|
||||
#include "ProcessElfCore.h"
|
||||
#include "RegisterContextLinuxCore_x86_64.h"
|
||||
#include "RegisterContextLinuxCore_x86.h"
|
||||
#include "RegisterContextPOSIXCore_arm.h"
|
||||
#include "RegisterContextPOSIXCore_arm64.h"
|
||||
#include "RegisterContextPOSIXCore_loongarch64.h"
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "RegisterContextPOSIXCore_riscv32.h"
|
||||
#include "RegisterContextPOSIXCore_riscv64.h"
|
||||
#include "RegisterContextPOSIXCore_s390x.h"
|
||||
#include "RegisterContextPOSIXCore_x86_64.h"
|
||||
#include "RegisterContextPOSIXCore_x86.h"
|
||||
#include "ThreadElfCore.h"
|
||||
|
||||
#include <memory>
|
||||
@@ -216,10 +216,10 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
|
||||
case llvm::Triple::x86:
|
||||
case llvm::Triple::x86_64:
|
||||
if (is_linux) {
|
||||
m_thread_reg_ctx_sp = std::make_shared<RegisterContextLinuxCore_x86_64>(
|
||||
m_thread_reg_ctx_sp = std::make_shared<RegisterContextLinuxCore_x86>(
|
||||
*this, reg_interface, m_gpregset_data, m_notes);
|
||||
} else {
|
||||
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_x86_64>(
|
||||
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_x86>(
|
||||
*this, reg_interface, m_gpregset_data, m_notes);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
|
||||
#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
|
||||
#include "Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h"
|
||||
#include "Plugins/Process/elf-core/RegisterContextPOSIXCore_x86.h"
|
||||
#include "Plugins/Process/elf-core/RegisterUtilities.h"
|
||||
|
||||
#include "lldb/Target/RegisterContext.h"
|
||||
@@ -73,7 +73,7 @@ ThreadMinidump::CreateRegisterContextForFrame(StackFrame *frame) {
|
||||
lldb::DataBufferSP buf =
|
||||
ConvertMinidumpContext_x86_32(m_gpregset_data, reg_interface);
|
||||
DataExtractor gpregset(buf, lldb::eByteOrderLittle, 4);
|
||||
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_x86_64>(
|
||||
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_x86>(
|
||||
*this, reg_interface, gpregset,
|
||||
llvm::ArrayRef<lldb_private::CoreNote>());
|
||||
break;
|
||||
@@ -83,7 +83,7 @@ ThreadMinidump::CreateRegisterContextForFrame(StackFrame *frame) {
|
||||
lldb::DataBufferSP buf =
|
||||
ConvertMinidumpContext_x86_64(m_gpregset_data, reg_interface);
|
||||
DataExtractor gpregset(buf, lldb::eByteOrderLittle, 8);
|
||||
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_x86_64>(
|
||||
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_x86>(
|
||||
*this, reg_interface, gpregset,
|
||||
llvm::ArrayRef<lldb_private::CoreNote>());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user