diff options
| author | Ted Woodward <ted.woodward@codeaurora.org> | 2015-05-13 18:52:56 +0000 |
|---|---|---|
| committer | Ted Woodward <ted.woodward@codeaurora.org> | 2015-05-13 18:52:56 +0000 |
| commit | bb1e283cc5c40300bdebbb0fded6be8bb6b434bf (patch) | |
| tree | e0424c568ceaa6ca6f67da40a947e1e19c71db6e /lldb/source/Plugins | |
| parent | 0fa38b8f96c3b0ad54b7c3077dcdc80a0cb0d7a2 (diff) | |
| download | bcm5719-llvm-bb1e283cc5c40300bdebbb0fded6be8bb6b434bf.tar.gz bcm5719-llvm-bb1e283cc5c40300bdebbb0fded6be8bb6b434bf.zip | |
Change Linux Platform to support non-host Linux architectures
Summary:
This was originally http://reviews.llvm.org/D8709 , but I didn't commit it correctly.
Since then GetSupportedArchitectureAtIndex() has been changed. That change, http://reviews.llvm.org/D9511 , breaks non-x86 linux implementations, so this change goes back to the old implementation and adds remote linux support from D8709.
D8709 summary:
The Linux Platform currently will only say the Host architecture is supported. This patch retains that behavior for the Host Platform, but adds a list of architectures for the Remote Platform.
Reviewers: clayborg, flackr
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9683
llvm-svn: 237278
Diffstat (limited to 'lldb/source/Plugins')
| -rw-r--r-- | lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp index ebf4dc606bd..1613510b0ea 100644 --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -501,6 +501,30 @@ PlatformLinux::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) { if (m_remote_platform_sp) return m_remote_platform_sp->GetSupportedArchitectureAtIndex(idx, arch); + + llvm::Triple triple; + // Set the OS to linux + triple.setOS(llvm::Triple::Linux); + // Set the architecture + switch (idx) + { + case 0: triple.setArchName("x86_64"); break; + case 1: triple.setArchName("i386"); break; + case 2: triple.setArchName("arm"); break; + case 3: triple.setArchName("aarch64"); break; + case 4: triple.setArchName("mips64"); break; + case 5: triple.setArchName("hexagon"); break; + case 6: triple.setArchName("mips"); break; + default: return false; + } + // Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the vendor by + // calling triple.SetVendorName("unknown") so that it is a "unspecified unknown". + // This means when someone calls triple.GetVendorName() it will return an empty string + // which indicates that the vendor can be set when two architectures are merged + + // Now set the triple into "arch" and return true + arch.SetTriple(triple); + return true; } return false; } |

