[Lldb-commits] [lldb] 192331b - [lldb] [Process/Linux] Support arbitrarily-sized FPR writes on ARM
Michał Górny via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 20 06:07:31 PDT 2021
Author: Michał Górny
Date: 2021-10-20T15:06:44+02:00
New Revision: 192331b890e238a8ede4e61e6c5294e7eaa365fd
URL: https://github.com/llvm/llvm-project/commit/192331b890e238a8ede4e61e6c5294e7eaa365fd
DIFF: https://github.com/llvm/llvm-project/commit/192331b890e238a8ede4e61e6c5294e7eaa365fd.diff
LOG: [lldb] [Process/Linux] Support arbitrarily-sized FPR writes on ARM
Support arbitrarily-sized FPR writes on ARM in order to fix writing qN
registers directly. Currently, writing them works only by accident
due to value_regs splitting them into smaller writes via dN and sN
registers.
Differential Revision: https://reviews.llvm.org/D112131
Added:
Modified:
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
index dcd68ddd279d..7e798ac3cb56 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -182,27 +182,9 @@ NativeRegisterContextLinux_arm::WriteRegister(const RegisterInfo *reg_info,
uint32_t fpr_offset = CalculateFprOffset(reg_info);
assert(fpr_offset < sizeof m_fpr);
uint8_t *dst = (uint8_t *)&m_fpr + fpr_offset;
- switch (reg_info->byte_size) {
- case 2:
- *(uint16_t *)dst = reg_value.GetAsUInt16();
- break;
- case 4:
- *(uint32_t *)dst = reg_value.GetAsUInt32();
- break;
- case 8:
- *(uint64_t *)dst = reg_value.GetAsUInt64();
- break;
- default:
- assert(false && "Unhandled data size.");
- return Status("unhandled register data size %" PRIu32,
- reg_info->byte_size);
- }
+ ::memcpy(dst, reg_value.GetBytes(), reg_info->byte_size);
- Status error = WriteFPR();
- if (error.Fail())
- return error;
-
- return Status();
+ return WriteFPR();
}
return Status("failed - register wasn't recognized to be a GPR or an FPR, "
More information about the lldb-commits
mailing list