[Lldb-commits] [PATCH] Advertise 32 bit support for PlatformRemoteGDBServer on 64 bit systems.

Chaoren Lin chaorenl at google.com
Sat Feb 28 01:36:59 PST 2015


Add some error checking.


http://reviews.llvm.org/D7970

Files:
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp

Index: source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
===================================================================
--- source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -230,12 +230,15 @@
 {
     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;
 }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7970.20929.patch
Type: text/x-patch
Size: 836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150228/3ea307ac/attachment.bin>


More information about the lldb-commits mailing list