diff options
| author | Felipe de Azevedo Piovezan <fpiovezan@apple.com> | 2025-10-15 07:34:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-15 07:34:06 -0700 |
| commit | ccf6e0250b5757197788f0fadb896a8912419329 (patch) | |
| tree | db6a5057df4b7d5a0761afa41d2d1f127f560706 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
| parent | aa435772780ec17fda440f58d00d3d8703d7bfda (diff) | |
| download | llvm-ccf6e0250b5757197788f0fadb896a8912419329.zip llvm-ccf6e0250b5757197788f0fadb896a8912419329.tar.gz llvm-ccf6e0250b5757197788f0fadb896a8912419329.tar.bz2 | |
[lldb] Parse qSupported MultiMemRead tag in GDB Remote Client (#163249)
This is in preparation for the new MultiMemRead packet discussed in the
RFC [1].
An alternative to using `qSupported` would be having clients send an
empty `MultiMemRead` packet. However, this is problematic because the
already-existing packet `M` is a prefix of `MultiMemRead`; an empty
reply would be ambiguous in this case. It is also risky that the stub
might interpret the `MultiMemRead` as a valid `M` packet.
Another advantage of `qSupported` is that this packet is already
exchanged, so parsing a new field is simpler than having to exchange one
extra packet.
[1]:
https://discourse.llvm.org/t/rfc-a-new-vectorized-memory-read-packet/88441
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 7d2bd45..11f164c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -211,6 +211,12 @@ bool GDBRemoteCommunicationClient::GetReverseStepSupported() { return m_supports_reverse_step == eLazyBoolYes; } +bool GDBRemoteCommunicationClient::GetMultiMemReadSupported() { + if (m_supports_multi_mem_read == eLazyBoolCalculate) + GetRemoteQSupported(); + return m_supports_multi_mem_read == eLazyBoolYes; +} + bool GDBRemoteCommunicationClient::QueryNoAckModeSupported() { if (m_supports_not_sending_acks == eLazyBoolCalculate) { m_send_acks = true; @@ -339,6 +345,7 @@ void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) { m_supported_async_json_packets_is_valid = false; m_supported_async_json_packets_sp.reset(); m_supports_jModulesInfo = true; + m_supports_multi_mem_read = eLazyBoolCalculate; } // These flags should be reset when we first connect to a GDB server and when @@ -365,6 +372,7 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() { m_x_packet_state.reset(); m_supports_reverse_continue = eLazyBoolNo; m_supports_reverse_step = eLazyBoolNo; + m_supports_multi_mem_read = eLazyBoolNo; m_max_packet_size = UINT64_MAX; // It's supposed to always be there, but if // not, we assume no limit @@ -424,6 +432,8 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() { m_supports_reverse_continue = eLazyBoolYes; else if (x == "ReverseStep+") m_supports_reverse_step = eLazyBoolYes; + else if (x == "MultiMemRead+") + m_supports_multi_mem_read = eLazyBoolYes; // Look for a list of compressions in the features list e.g. // qXfer:features:read+;PacketSize=20000;qEcho+;SupportedCompressions=zlib- // deflate,lzma |
