Advertise 32 bit support for PlatformRemoteGDBServer on 64 bit systems.
authorChaoren Lin <chaorenl@google.com>
Sun, 1 Mar 2015 20:48:18 +0000 (20:48 +0000)
committerChaoren Lin <chaorenl@google.com>
Sun, 1 Mar 2015 20:48:18 +0000 (20:48 +0000)
Reviewers: vharron, clayborg, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7970

llvm-svn: 230906

lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp

index 7cb7710..cfb3161 100644 (file)
@@ -230,12 +230,15 @@ PlatformRemoteGDBServer::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec
 {
     ArchSpec remote_arch = m_gdb_client.GetSystemArchitecture();
 
-    // TODO: 64 bit systems should also advertize support for 32 bit arch
-    // unknown CPU, we just support the one arch
     if (idx == 0)
     {
         arch = remote_arch;
-        return true;
+        return arch.IsValid();
+    }
+    else if (idx == 1 && remote_arch.IsValid() && remote_arch.GetTriple().isArch64Bit())
+    {
+        arch.SetTriple(remote_arch.GetTriple().get32BitArchVariant());
+        return arch.IsValid();
     }
     return false;
 }