diff options
author | Jason Molenda <jmolenda@apple.com> | 2023-08-16 16:10:30 -0700 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2023-08-16 16:12:18 -0700 |
commit | 6f4a0c762fe2c0077865e0e30e3dfd67cd6287d1 (patch) | |
tree | 11bd09a1043b97512e868073e7bf275fb42b5a2a /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 6664e80ace0845d34eecebe0d5da0b576cde39ef (diff) | |
download | llvm-6f4a0c762fe2c0077865e0e30e3dfd67cd6287d1.zip llvm-6f4a0c762fe2c0077865e0e30e3dfd67cd6287d1.tar.gz llvm-6f4a0c762fe2c0077865e0e30e3dfd67cd6287d1.tar.bz2 |
hi/low addr space bits can be sent in stop-rely packet
Add support for the `low_mem_addressing_bits` and
`high_mem_addressing_bits` keys in the stop reply packet,
in addition to the existing `addressing_bits`. Same
behavior as in the qHostInfo packet.
Clean up AddressableBits so we don't need to check if
any values have been set in the object before using it
to potentially update the Process address masks.
Differential Revision: https://reviews.llvm.org/D158041
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 2c35957..7eb29ee 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -899,10 +899,8 @@ void ProcessGDBRemote::DidLaunchOrAttach(ArchSpec &process_arch) { process_arch.GetTriple().getTriple()); } - AddressableBits addressable_bits; - if (m_gdb_comm.GetAddressableBits(addressable_bits)) { - addressable_bits.SetProcessMasks(*this); - } + AddressableBits addressable_bits = m_gdb_comm.GetAddressableBits(); + addressable_bits.SetProcessMasks(*this); if (process_arch.IsValid()) { const ArchSpec &target_arch = GetTarget().GetArchitecture(); @@ -2124,6 +2122,7 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) { QueueKind queue_kind = eQueueKindUnknown; uint64_t queue_serial_number = 0; ExpeditedRegisterMap expedited_register_map; + AddressableBits addressable_bits; while (stop_packet.GetNameColonValue(key, value)) { if (key.compare("metype") == 0) { // exception type in big endian hex @@ -2271,9 +2270,17 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) { } else if (key.compare("addressing_bits") == 0) { uint64_t addressing_bits; if (!value.getAsInteger(0, addressing_bits)) { - addr_t address_mask = ~((1ULL << addressing_bits) - 1); - SetCodeAddressMask(address_mask); - SetDataAddressMask(address_mask); + addressable_bits.SetAddressableBits(addressing_bits); + } + } else if (key.compare("low_mem_addressing_bits") == 0) { + uint64_t addressing_bits; + if (!value.getAsInteger(0, addressing_bits)) { + addressable_bits.SetLowmemAddressableBits(addressing_bits); + } + } else if (key.compare("high_mem_addressing_bits") == 0) { + uint64_t addressing_bits; + if (!value.getAsInteger(0, addressing_bits)) { + addressable_bits.SetHighmemAddressableBits(addressing_bits); } } else if (key.size() == 2 && ::isxdigit(key[0]) && ::isxdigit(key[1])) { uint32_t reg = UINT32_MAX; @@ -2302,6 +2309,8 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) { } } + addressable_bits.SetProcessMasks(*this); + ThreadSP thread_sp = SetThreadStopInfo( tid, expedited_register_map, signo, thread_name, reason, description, exc_type, exc_data, thread_dispatch_qaddr, queue_vars_valid, |