[Lldb-commits] [PATCH] D112131: [lldb] [Process/Linux] Support arbitrarily-sized FPR writes on ARM
Michał Górny via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 20 04:38:19 PDT 2021
mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste, teemperor.
Herald added a subscriber: kristof.beyls.
mgorny requested review of this revision.
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.
https://reviews.llvm.org/D112131
Files:
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
Index: lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
===================================================================
--- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -182,27 +182,9 @@
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, "
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112131.380896.patch
Type: text/x-patch
Size: 1179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211020/8b19fe9f/attachment-0001.bin>
More information about the lldb-commits
mailing list