aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-18 20:30:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-06 20:11:55 +0000
commit5f757f3ff9144b609b3c433dfd370cc6bdc191ad (patch)
tree1b4e980b866cd26a00af34c0a653eb640bd09caf /contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent3e1c8a35f741a5d114d0ba670b15191355711fe9 (diff)
parent312c0ed19cc5276a17bacf2120097bec4515b0f1 (diff)
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index c6503129685a..ad72b3d121e6 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1265,7 +1265,14 @@ 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)) {
+ ++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 +1414,19 @@ GDBRemoteCommunicationClient::GetHostArchitecture() {
return m_host_arch;
}
-uint32_t GDBRemoteCommunicationClient::GetAddressingBits() {
+AddressableBits GDBRemoteCommunicationClient::GetAddressableBits() {
+ AddressableBits addressable_bits;
if (m_qHostInfo_is_valid == eLazyBoolCalculate)
GetHostInfo();
- return m_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;
}
+
seconds GDBRemoteCommunicationClient::GetHostDefaultPacketTimeout() {
if (m_qHostInfo_is_valid == eLazyBoolCalculate)
GetHostInfo();
@@ -2634,10 +2649,12 @@ size_t GDBRemoteCommunicationClient::QueryGDBServer(
return 0;
for (size_t i = 0, count = array->GetSize(); i < count; ++i) {
- StructuredData::Dictionary *element = nullptr;
- if (!array->GetItemAtIndexAsDictionary(i, element))
+ std::optional<StructuredData::Dictionary *> maybe_element =
+ array->GetItemAtIndexAsDictionary(i);
+ if (!maybe_element)
continue;
+ StructuredData::Dictionary *element = *maybe_element;
uint16_t port = 0;
if (StructuredData::ObjectSP port_osp =
element->GetValueForKey(llvm::StringRef("port")))
@@ -4025,7 +4042,7 @@ void GDBRemoteCommunicationClient::ServeSymbolLookups(
return;
} else {
llvm::StringRef response_str(response.GetStringRef());
- if (response_str.startswith("qSymbol:")) {
+ if (response_str.starts_with("qSymbol:")) {
response.SetFilePos(strlen("qSymbol:"));
std::string symbol_name;
if (response.GetHexByteString(symbol_name)) {