[Lldb-commits] [PATCH] Fix problem where 32-bit statically built lldb-platform cannot find lldb-gdbserver.

Chaoren Lin chaorenl at google.com
Mon Feb 9 14:16:07 PST 2015


Hi ovyalov,

Adding x86 to supported architectures on x86_64.

Failsafe directory for shared objects and support executables.

http://reviews.llvm.org/D7519

Files:
  include/lldb/Host/linux/HostInfoLinux.h
  source/Host/linux/HostInfoLinux.cpp
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp

Index: include/lldb/Host/linux/HostInfoLinux.h
===================================================================
--- include/lldb/Host/linux/HostInfoLinux.h
+++ include/lldb/Host/linux/HostInfoLinux.h
@@ -40,6 +40,7 @@
     static FileSpec GetProgramFileSpec();
 
   protected:
+    static bool ComputeSharedLibraryDirectory(FileSpec &file_spec);
     static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
     static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
     static void ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch_64);
Index: source/Host/linux/HostInfoLinux.cpp
===================================================================
--- source/Host/linux/HostInfoLinux.cpp
+++ source/Host/linux/HostInfoLinux.cpp
@@ -223,6 +223,15 @@
 }
 
 bool
+HostInfoLinux::ComputeSharedLibraryDirectory(FileSpec &file_spec)
+{
+    HostInfoPosix::ComputeSharedLibraryDirectory(file_spec);
+    if (!file_spec.GetDirectory())
+        file_spec.GetDirectory() = GetProgramFileSpec().GetDirectory();
+    return (bool)file_spec.GetDirectory();
+}
+
+bool
 HostInfoLinux::ComputeSystemPluginsDirectory(FileSpec &file_spec)
 {
     FileSpec temp_file("/usr/lib/lldb", true);
Index: source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
===================================================================
--- source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -214,13 +214,18 @@
 {
     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;
     }
+    else if (idx == 1 &&
+            remote_arch.GetTriple().isOSLinux() &&
+            remote_arch.GetTriple().isArch64Bit())
+    {
+        arch.SetTriple("i686-linux-gnu");
+        return true;
+    }
     return false;
 }
 
Index: source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
===================================================================
--- source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
+++ source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
@@ -113,6 +113,8 @@
     {
         case llvm::Triple::x86:            
             return g_register_infos_i386;
+        case llvm::Triple::x86_64:
+            return g_register_infos_i386;
         default:
             assert(false && "Unhandled target architecture.");
             return NULL;

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7519.19615.patch
Type: text/x-patch
Size: 2584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150209/74ca2d2d/attachment.bin>


More information about the lldb-commits mailing list