[Lldb-commits] [lldb] r237128 - Call remote platform GetSupportedArchitectureAtIndex if connected to remote.
Robert Flack
flackr at gmail.com
Tue May 12 06:22:37 PDT 2015
Author: flackr
Date: Tue May 12 08:22:37 2015
New Revision: 237128
URL: http://llvm.org/viewvc/llvm-project?rev=237128&view=rev
Log:
Call remote platform GetSupportedArchitectureAtIndex if connected to remote.
Updated PlatformLinux::GetSupportedArchitectureAtIndex to call the
PlatformRemoteGdbServer::GetSupportedArchitectureAtIndex if connected remotely.
This should return the correct thing for android (to fix those failing tests),
and is also working for mac to linux.
Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestCallStdStringFunction.py
The above still passes when running mac->linux indicating it successfully
identified PlatformLinux as the target platform and converted the mmap options
correctly.
Differential Revision: http://reviews.llvm.org/D9672
Modified:
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=237128&r1=237127&r2=237128&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Tue May 12 08:22:37 2015
@@ -14,7 +14,6 @@
// C Includes
#include <stdio.h>
-#include <vector>
#ifndef LLDB_DISABLE_POSIX
#include <sys/utsname.h>
#endif
@@ -477,14 +476,33 @@ PlatformLinux::FindProcesses (const Proc
bool
PlatformLinux::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
{
- static std::vector<ArchSpec> architectures = {
- ArchSpec("x86_64-unknown-linux-gnu"),
- ArchSpec("i386-unknown-linux-gnu"),
- };
- if (idx >= architectures.size())
- return false;
- arch = architectures[idx];
- return true;
+ if (IsHost())
+ {
+ ArchSpec hostArch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault);
+ if (hostArch.GetTriple().isOSLinux())
+ {
+ if (idx == 0)
+ {
+ arch = hostArch;
+ return arch.IsValid();
+ }
+ else if (idx == 1)
+ {
+ // If the default host architecture is 64-bit, look for a 32-bit variant
+ if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit())
+ {
+ arch = HostInfo::GetArchitecture(HostInfo::eArchKind32);
+ return arch.IsValid();
+ }
+ }
+ }
+ }
+ else
+ {
+ if (m_remote_platform_sp)
+ return m_remote_platform_sp->GetSupportedArchitectureAtIndex(idx, arch);
+ }
+ return false;
}
void
More information about the lldb-commits
mailing list