diff options
author | Jason Molenda <jason@molenda.com> | 2023-05-04 13:13:30 -0700 |
---|---|---|
committer | Jason Molenda <jason@molenda.com> | 2023-05-04 13:14:10 -0700 |
commit | 4fac08ff1dcd02c89c677365b10921399caf79df (patch) | |
tree | 47f38efb5a0b195a11be0ae61298971172b97cb7 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 09ceb4729f1ca8781718d41b7876b68820baadba (diff) | |
download | llvm-4fac08ff1dcd02c89c677365b10921399caf79df.zip llvm-4fac08ff1dcd02c89c677365b10921399caf79df.tar.gz llvm-4fac08ff1dcd02c89c677365b10921399caf79df.tar.bz2 |
Recognize `addressing_bits` kv in stop reply packet
If a remote stub provides the addressing_bits kv pair in
the stop reply packet, update the Process address masks with
that value as it possibly changes during the process runtime.
This is an unusual situation, most likely a JTAG remote stub
and some very early startup code that is setting up the page
tables. Nearly all debug sessions will have a single address
mask that cannot change during the lifetime of a Process.
Differential Revision: https://reviews.llvm.org/D149803
rdar://61900565
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 06f5796..7047ae6 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -2257,6 +2257,13 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) { StreamString ostr; ostr.Printf("%" PRIu64 " %" PRIu64, pid_tid->first, pid_tid->second); description = std::string(ostr.GetString()); + } 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); + } } else if (key.size() == 2 && ::isxdigit(key[0]) && ::isxdigit(key[1])) { uint32_t reg = UINT32_MAX; if (!key.getAsInteger(16, reg)) |