Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ NativeRegisterContextLinux_arm64::NativeRegisterContextLinux_arm64(
std::unique_ptr<RegisterInfoPOSIX_arm64> register_info_up)
: NativeRegisterContextRegisterInfo(native_thread,
register_info_up.release()),
NativeRegisterContextLinux(native_thread) {
NativeRegisterContextLinux(native_thread),
NativeRegisterContextDBReg_arm64(1U) {
g_register_flags_detector.UpdateRegisterInfo(
GetRegisterInfoInterface().GetRegisterInfo(),
GetRegisterInfoInterface().GetRegisterCount());
Expand Down Expand Up @@ -1067,10 +1068,9 @@ bool NativeRegisterContextLinux_arm64::IsFPMR(unsigned reg) const {
return GetRegisterInfo().IsFPMRReg(reg);
}

llvm::Error NativeRegisterContextLinux_arm64::ReadHardwareDebugInfo() {
if (!m_refresh_hwdebug_info) {
return llvm::Error::success();
}
Status NativeRegisterContextLinux_arm64::ReadHardwareDebugInfo() {
if (!m_refresh_hwdebug_info)
return Status();

::pid_t tid = m_thread.GetID();

Expand All @@ -1085,7 +1085,7 @@ llvm::Error NativeRegisterContextLinux_arm64::ReadHardwareDebugInfo() {
&ioVec, ioVec.iov_len);

if (error.Fail())
return error.ToError();
return error;

m_max_hwp_supported = dreg_state.dbg_info & 0xff;

Expand All @@ -1094,15 +1094,15 @@ llvm::Error NativeRegisterContextLinux_arm64::ReadHardwareDebugInfo() {
&ioVec, ioVec.iov_len);

if (error.Fail())
return error.ToError();
return error;

m_max_hbp_supported = dreg_state.dbg_info & 0xff;
m_refresh_hwdebug_info = false;

return llvm::Error::success();
return Status();
}

llvm::Error
Status
NativeRegisterContextLinux_arm64::WriteHardwareDebugRegs(DREGType hwbType) {
struct iovec ioVec;
struct user_hwdebug_state dreg_state;
Expand Down Expand Up @@ -1135,8 +1135,7 @@ NativeRegisterContextLinux_arm64::WriteHardwareDebugRegs(DREGType hwbType) {
}

return NativeProcessLinux::PtraceWrapper(PTRACE_SETREGSET, m_thread.GetID(),
&regset, &ioVec, ioVec.iov_len)
.ToError();
&regset, &ioVec, ioVec.iov_len);
}

Status NativeRegisterContextLinux_arm64::ReadGPR() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ class NativeRegisterContextLinux_arm64

size_t GetFPMRBufferSize() { return sizeof(m_fpmr_reg); }

llvm::Error ReadHardwareDebugInfo() override;
Status ReadHardwareDebugInfo() override;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@labath I seem to remember you saying we want to move to or away from Status, if I didn't imagine that, which is it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wangleiat can you explain why this switched from Status to llvm::Error? Was it that one copy of the code used Status and the other llvm::Erorr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I noticed that the function calling it returns a Status (virtual Status ClearAllHardwareWatchpoints() in file lldb/include/lldb/Host/common/NativeRegisterContext.h), and other architectures, such as ARM (not AArch64) and PPC, also return a Status.
Should consistency be maintained here? If llvm::Error is required, I will revert it. I also made a mistake—the definition in this file NativeRegisterContextFreeBSD_arm64.h hasn't been updated yet. I apologize for my carelessness.


llvm::Error WriteHardwareDebugRegs(DREGType hwbType) override;
Status WriteHardwareDebugRegs(DREGType hwbType) override;

uint32_t CalculateFprOffset(const RegisterInfo *reg_info) const;

Expand Down
1 change: 1 addition & 0 deletions lldb/source/Plugins/Process/Utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_lldb_library(lldbPluginProcessUtility
LinuxSignals.cpp
MemoryTagManagerAArch64MTE.cpp
NativeProcessSoftwareSingleStep.cpp
NativeRegisterContextDBReg.cpp
NativeRegisterContextDBReg_arm64.cpp
NativeRegisterContextDBReg_x86.cpp
NativeRegisterContextRegisterInfo.cpp
Expand Down
Loading
Loading