diff options
author | Jason Molenda <jmolenda@apple.com> | 2023-08-15 13:19:07 -0700 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2023-08-15 13:21:33 -0700 |
commit | 3ad618f4aea1ef7442f7ff75d92632aec177a4fd (patch) | |
tree | d98cd63991a5a484a70a3c270c215765bfb48a2d /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | fa6726e27bb872ada13fe44c6609e9336785dd36 (diff) | |
download | llvm-3ad618f4aea1ef7442f7ff75d92632aec177a4fd.zip llvm-3ad618f4aea1ef7442f7ff75d92632aec177a4fd.tar.gz llvm-3ad618f4aea1ef7442f7ff75d92632aec177a4fd.tar.bz2 |
Update qHostInfo/LC_NOTE so multiple address bits can be specified
On AArch64 systems, we may have different page table setups for
low memory and high memory, and therefore a different number of
bits used for addressing depending on which half of memory the
address is in.
This patch extends the qHostInfo and LC_NOTE "addrable bits" so
that it can specify the number of addressing bits in high memory
and in low memory separately. It builds on the patch I added in
https://reviews.llvm.org/D151292 where Process tracks the separate
address masks, and there is a user setting to set them manually.
Differential Revision: https://reviews.llvm.org/D157667
rdar://113225907
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index c650312..f836f08 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1265,7 +1265,15 @@ bool GDBRemoteCommunicationClient::GetHostInfo(bool force) { if (!value.getAsInteger(0, pointer_byte_size)) ++num_keys_decoded; } else if (name.equals("addressing_bits")) { - if (!value.getAsInteger(0, m_addressing_bits)) + if (!value.getAsInteger(0, m_low_mem_addressing_bits)) { + m_high_mem_addressing_bits = m_low_mem_addressing_bits; + ++num_keys_decoded; + } + } else if (name.equals("high_mem_addressing_bits")) { + if (!value.getAsInteger(0, m_high_mem_addressing_bits)) + ++num_keys_decoded; + } else if (name.equals("low_mem_addressing_bits")) { + if (!value.getAsInteger(0, m_low_mem_addressing_bits)) ++num_keys_decoded; } else if (name.equals("os_version") || name.equals("version")) // Older debugserver binaries used @@ -1407,11 +1415,19 @@ GDBRemoteCommunicationClient::GetHostArchitecture() { return m_host_arch; } -uint32_t GDBRemoteCommunicationClient::GetAddressingBits() { +bool GDBRemoteCommunicationClient::GetAddressableBits( + lldb_private::AddressableBits &addressable_bits) { + addressable_bits.Clear(); if (m_qHostInfo_is_valid == eLazyBoolCalculate) GetHostInfo(); - return m_addressing_bits; + if (m_low_mem_addressing_bits != 0 || m_high_mem_addressing_bits != 0) { + addressable_bits.SetAddressableBits(m_low_mem_addressing_bits, + m_high_mem_addressing_bits); + return true; + } + return false; } + seconds GDBRemoteCommunicationClient::GetHostDefaultPacketTimeout() { if (m_qHostInfo_is_valid == eLazyBoolCalculate) GetHostInfo(); |