diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2014-08-26 18:21:02 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2014-08-26 18:21:02 +0000 |
commit | c540dd0daff3b3d9a393822f416f35315b45932a (patch) | |
tree | 6098415d3e593a4dba1a4247e333b08eded94405 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | |
parent | 840438bb0676e4175c4e48e0de083700c8ae04c5 (diff) | |
download | bcm5719-llvm-c540dd0daff3b3d9a393822f416f35315b45932a.tar.gz bcm5719-llvm-c540dd0daff3b3d9a393822f416f35315b45932a.zip |
Fix llgs to send triple for non-Apple platforms and lldb to interpret correctly.
This change addresses this bug:
http://llvm.org/bugs/show_bug.cgi?id=20755
This change:
* Modifies llgs to send triple instead of cputype and cpusubtype when not on Apple platforms in qProcessInfo.
* Modifies lldb's GDBRemoteCommunicationClient to handle the triple returned from qProcessInfo if given.
When given, it will prefer to use triple over cputype and cpusubtype.
* Adds gdb-remote protocol tests to verify that cputype and cpusubtype are specified on darwin, and that triple is specified on Linux.
llvm-svn: 216470
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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) |