diff options
author | Jason Molenda <jmolenda@apple.com> | 2023-08-17 18:12:38 -0700 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2023-08-17 18:16:31 -0700 |
commit | 10f494d2896b8a58f69cc47d0db35d2b84c2fb44 (patch) | |
tree | e61ecf63b6598cd648b2d947b5d9080f60fe76dc /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | e03686f4a399d7ebe8452d510452a72384261eaf (diff) | |
download | llvm-10f494d2896b8a58f69cc47d0db35d2b84c2fb44.zip llvm-10f494d2896b8a58f69cc47d0db35d2b84c2fb44.tar.gz llvm-10f494d2896b8a58f69cc47d0db35d2b84c2fb44.tar.bz2 |
Only set the "low" address masks when only one adressable bits specified
qHostInfo / stop-reply packet / LC_NOTE "addrable bits" can all
specify either a single value for all address masks, or separate
masks for low and high memory addresses.
When the same number of addressing bits are used for all addresses,
we use the "low memory" address masks for everything. (or another
way, if the high address masks are not set, we use the low address
masks with the assumption that all memory is using the same mask --
the most common situation).
I was setting low and high address masks when I had a single value
from these metadata, but that gave the impression that the high
address mask was specified explicitly. After living on the code
a bit, it's clearly better to only set the high address masks when
we have a distinct high address mask value.
This patch is the minor adjustment to behave that way.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 1fcd850..04d98b9 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1266,7 +1266,6 @@ bool GDBRemoteCommunicationClient::GetHostInfo(bool force) { ++num_keys_decoded; } else if (name.equals("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")) { @@ -1420,11 +1419,11 @@ AddressableBits GDBRemoteCommunicationClient::GetAddressableBits() { if (m_qHostInfo_is_valid == eLazyBoolCalculate) GetHostInfo(); - // m_low_mem_addressing_bits and m_high_mem_addressing_bits - // will be 0 if we did not receive values; AddressableBits - // treats 0 as "unspecified". - addressable_bits.SetAddressableBits(m_low_mem_addressing_bits, - m_high_mem_addressing_bits); + if (m_low_mem_addressing_bits == m_high_mem_addressing_bits) + addressable_bits.SetAddressableBits(m_low_mem_addressing_bits); + else + addressable_bits.SetAddressableBits(m_low_mem_addressing_bits, + m_high_mem_addressing_bits); return addressable_bits; } |