summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp17
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp10
2 files changed, 24 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index c2b58fd1377..5e4ed7648f9 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2442,6 +2442,11 @@ GDBRemoteCommunicationClient::GetCurrentProcessInfo ()
if (sub != 0)
++num_keys_decoded;
}
+ else if (name.compare("triple") == 0)
+ {
+ triple = value;
+ ++num_keys_decoded;
+ }
else if (name.compare("ostype") == 0)
{
os_name.swap (value);
@@ -2479,7 +2484,17 @@ GDBRemoteCommunicationClient::GetCurrentProcessInfo ()
m_curr_pid_is_valid = eLazyBoolYes;
m_curr_pid = pid;
}
- if (cpu != LLDB_INVALID_CPUTYPE && !os_name.empty() && !vendor_name.empty())
+
+ // Set the ArchSpec from the triple if we have it.
+ if (!triple.empty ())
+ {
+ m_process_arch.SetTriple (triple.c_str ());
+ if (pointer_byte_size)
+ {
+ assert (pointer_byte_size == m_process_arch.GetAddressByteSize());
+ }
+ }
+ else if (cpu != LLDB_INVALID_CPUTYPE && !os_name.empty() && !vendor_name.empty())
{
m_process_arch.SetArchitecture (eArchTypeMachO, cpu, sub);
if (pointer_byte_size)
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index bdece3dae1e..4d38a07302c 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -1328,6 +1328,9 @@ CreateProcessInfoResponse_DebugServerStyle (const ProcessInstanceInfo &proc_info
const ArchSpec &proc_arch = proc_info.GetArchitecture();
if (proc_arch.IsValid())
{
+ const llvm::Triple &proc_triple = proc_arch.GetTriple();
+#if defined(__APPLE__)
+ // We'll send cputype/cpusubtype.
const uint32_t cpu_type = proc_arch.GetMachOCPUType();
if (cpu_type != 0)
response.Printf ("cputype:%" PRIx32 ";", cpu_type);
@@ -1335,12 +1338,15 @@ CreateProcessInfoResponse_DebugServerStyle (const ProcessInstanceInfo &proc_info
const uint32_t cpu_subtype = proc_arch.GetMachOCPUSubType();
if (cpu_subtype != 0)
response.Printf ("cpusubtype:%" PRIx32 ";", cpu_subtype);
+
- const llvm::Triple &proc_triple = proc_arch.GetTriple();
const std::string vendor = proc_triple.getVendorName ();
if (!vendor.empty ())
response.Printf ("vendor:%s;", vendor.c_str ());
-
+#else
+ // We'll send the triple.
+ response.Printf ("triple:%s;", proc_triple.getTriple().c_str ());
+#endif
std::string ostype = proc_triple.getOSName ();
// Adjust so ostype reports ios for Apple/ARM and Apple/ARM64.
if (proc_triple.getVendor () == llvm::Triple::Apple)
OpenPOWER on IntegriCloud