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/GDBRemoteCommunicationClient.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/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 17 |
1 files changed, 16 insertions, 1 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) |