[Lldb-commits] [PATCH] Return a current executable's directory from HostInfoAndroid::ComputeSupportExeDirectory.

Oleksiy Vyalov ovyalov at google.com
Tue Feb 24 17:25:00 PST 2015


Hi tberghammer, vharron,

HostInfoPosix::ComputeSupportExeDirectory doesn't work on Android because it tries to lookup lldb.so (which doesn't exist on Android since lldb-server uses static linking) and then replaces "/lib" path entry with "/bin".
Since on Android we use the same binary as platform and llgs ComputeSupportExeDirectory can return a current executable's directory.

http://reviews.llvm.org/D7876

Files:
  include/lldb/Host/android/HostInfoAndroid.h
  source/Host/android/HostInfoAndroid.cpp

Index: include/lldb/Host/android/HostInfoAndroid.h
===================================================================
--- include/lldb/Host/android/HostInfoAndroid.h
+++ include/lldb/Host/android/HostInfoAndroid.h
@@ -26,6 +26,7 @@
 
   protected:
     static void ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch_64);
+    static bool ComputeSupportExeDirectory(FileSpec &file_spec);
 };
 
 } // end of namespace lldb_private
Index: source/Host/android/HostInfoAndroid.cpp
===================================================================
--- source/Host/android/HostInfoAndroid.cpp
+++ source/Host/android/HostInfoAndroid.cpp
@@ -26,3 +26,10 @@
         arch_64.GetTriple().setEnvironment(llvm::Triple::Android);
     }
 }
+
+bool
+HostInfoAndroid::ComputeSupportExeDirectory(FileSpec &file_spec)
+{
+    file_spec.GetDirectory() = HostInfoLinux::GetProgramFileSpec().GetDirectory();
+    return (bool)file_spec.GetDirectory();
+}

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7876.20648.patch
Type: text/x-patch
Size: 952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150225/c0751b45/attachment.bin>


More information about the lldb-commits mailing list