aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <adrian-prantl@users.noreply.github.com>2024-02-27 08:14:46 -0800
committerGitHub <noreply@github.com>2024-02-27 08:14:46 -0800
commit8a87f763a6841832e71bcd24dea45eac8d2dbee1 (patch)
tree1d66218e04fd2935bf2e1dec01e9b1d7dfb29ad7 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent8b56d9ef4d946f772e6b7a8d508f34b586f684a0 (diff)
downloadllvm-8a87f763a6841832e71bcd24dea45eac8d2dbee1.zip
llvm-8a87f763a6841832e71bcd24dea45eac8d2dbee1.tar.gz
llvm-8a87f763a6841832e71bcd24dea45eac8d2dbee1.tar.bz2
Aim debugserver workaround more precisely. (#83099)
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 6f8aa26..1f61169 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -17,6 +17,7 @@
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/HostInfo.h"
+#include "lldb/Host/SafeMachO.h"
#include "lldb/Host/XML.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Target/MemoryRegionInfo.h"
@@ -2147,8 +2148,20 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
if (!value.getAsInteger(16, cpu))
++num_keys_decoded;
} else if (name.equals("cpusubtype")) {
- if (!value.getAsInteger(16, sub))
+ if (!value.getAsInteger(16, sub)) {
++num_keys_decoded;
+ // Workaround for pre-2024 Apple debugserver, which always
+ // returns arm64e on arm64e-capable hardware regardless of
+ // what the process is. This can be deleted at some point
+ // in the future.
+ if (cpu == llvm::MachO::CPU_TYPE_ARM64 &&
+ sub == llvm::MachO::CPU_SUBTYPE_ARM64E) {
+ if (GetGDBServerVersion())
+ if (m_gdb_server_version >= 1000 &&
+ m_gdb_server_version <= 1504)
+ sub = 0;
+ }
+ }
} else if (name.equals("triple")) {
StringExtractor extractor(value);
extractor.GetHexByteString(triple);