diff options
author | David Spickett <david.spickett@linaro.org> | 2024-09-24 12:40:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 12:40:42 +0100 |
commit | 497759e872a53964a54db941f3a1ed74446c5ed4 (patch) | |
tree | ad4530f93db181b34f04ed1889f65ab80ec7e44b /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 4f8e76684f4c1e67726222c35f173ef722464a7e (diff) | |
download | llvm-497759e872a53964a54db941f3a1ed74446c5ed4.zip llvm-497759e872a53964a54db941f3a1ed74446c5ed4.tar.gz llvm-497759e872a53964a54db941f3a1ed74446c5ed4.tar.bz2 |
[lldb][AArch64] Create Neon subregs when XML only includes SVE (#108365)
Fixes #107864
QEMU decided that when SVE is enabled it will only tell us about SVE
registers in the XML, and not include Neon registers. On the grounds
that the Neon V registers can be read from the bottom 128 bits of a SVE
Z register (SVE's vector length is always >= 128 bits).
To support this we create sub-registers just as we do for S and D
registers of the V registers. Except this time we use part of the Z
registers.
This change also updates our fallback for registers with unknown types
that are > 128 bit. This is detailed in
https://github.com/llvm/llvm-project/issues/87471, though that covers
more than this change fixes.
We'll now treat any register of unknown type that is >= 128 bit as a
vector of bytes. So that the user gets to see something
even if the order might be wrong.
And until lldb supports vector and union types for registers, this is
also the only way we can get a value to apply the sub-reg to, to make
the V registers.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 9e8c604..3e09c31 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -4716,9 +4716,14 @@ bool ParseRegisters( reg_info.encoding = eEncodingIEEE754; } else if (gdb_type == "aarch64v" || llvm::StringRef(gdb_type).starts_with("vec") || - gdb_type == "i387_ext" || gdb_type == "uint128") { + gdb_type == "i387_ext" || gdb_type == "uint128" || + reg_info.byte_size > 16) { // lldb doesn't handle 128-bit uints correctly (for ymm*h), so - // treat them as vector (similarly to xmm/ymm) + // treat them as vector (similarly to xmm/ymm). + // We can fall back to handling anything else <= 128 bit as an + // unsigned integer, more than that, call it a vector of bytes. + // This can happen if we don't recognise the type for AArc64 SVE + // registers. reg_info.format = eFormatVectorOfUInt8; reg_info.encoding = eEncodingVector; } else { |