[Lldb-commits] [lldb] r232883 - Fix ComputeSupportExeDirectory for Linux (merge with Android).
Chaoren Lin
chaorenl at google.com
Fri Mar 20 20:59:30 PDT 2015
Author: chaoren
Date: Fri Mar 20 22:59:29 2015
New Revision: 232883
URL: http://llvm.org/viewvc/llvm-project?rev=232883&view=rev
Log:
Fix ComputeSupportExeDirectory for Linux (merge with Android).
Summary:
ComputeSupportExeDirectory relied on ComputeSharedLibraryDirectory which was
not always reliable. Using procfs seems to be the best way to deal with it on
Linux (since it's already done on Android, might as well merge it).
Reviewers: ovyalov
Reviewed By: ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D8511
Modified:
lldb/trunk/include/lldb/Host/android/HostInfoAndroid.h
lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h
lldb/trunk/source/Host/android/HostInfoAndroid.cpp
lldb/trunk/source/Host/linux/HostInfoLinux.cpp
Modified: lldb/trunk/include/lldb/Host/android/HostInfoAndroid.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/android/HostInfoAndroid.h?rev=232883&r1=232882&r2=232883&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/android/HostInfoAndroid.h (original)
+++ lldb/trunk/include/lldb/Host/android/HostInfoAndroid.h Fri Mar 20 22:59:29 2015
@@ -25,7 +25,6 @@ class HostInfoAndroid : public HostInfoL
protected:
static void ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch_64);
- static bool ComputeSupportExeDirectory(FileSpec &file_spec);
};
} // end of namespace lldb_private
Modified: lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h?rev=232883&r1=232882&r2=232883&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h (original)
+++ lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h Fri Mar 20 22:59:29 2015
@@ -40,7 +40,7 @@ class HostInfoLinux : public HostInfoPos
static FileSpec GetProgramFileSpec();
protected:
- static bool ComputeSharedLibraryDirectory(FileSpec &file_spec);
+ static bool ComputeSupportExeDirectory(FileSpec &file_spec);
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
static void ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch_64);
Modified: lldb/trunk/source/Host/android/HostInfoAndroid.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/android/HostInfoAndroid.cpp?rev=232883&r1=232882&r2=232883&view=diff
==============================================================================
--- lldb/trunk/source/Host/android/HostInfoAndroid.cpp (original)
+++ lldb/trunk/source/Host/android/HostInfoAndroid.cpp Fri Mar 20 22:59:29 2015
@@ -30,13 +30,6 @@ HostInfoAndroid::ComputeHostArchitecture
}
}
-bool
-HostInfoAndroid::ComputeSupportExeDirectory(FileSpec &file_spec)
-{
- file_spec.GetDirectory() = HostInfoLinux::GetProgramFileSpec().GetDirectory();
- return (bool)file_spec.GetDirectory();
-}
-
FileSpec
HostInfoAndroid::GetDefaultShell()
{
Modified: lldb/trunk/source/Host/linux/HostInfoLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/HostInfoLinux.cpp?rev=232883&r1=232882&r2=232883&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/HostInfoLinux.cpp (original)
+++ lldb/trunk/source/Host/linux/HostInfoLinux.cpp Fri Mar 20 22:59:29 2015
@@ -222,12 +222,10 @@ HostInfoLinux::GetProgramFileSpec()
}
bool
-HostInfoLinux::ComputeSharedLibraryDirectory(FileSpec &file_spec)
+HostInfoLinux::ComputeSupportExeDirectory(FileSpec &file_spec)
{
- if (HostInfoPosix::ComputeSharedLibraryDirectory(file_spec))
- return true;
file_spec.GetDirectory() = GetProgramFileSpec().GetDirectory();
- return (bool)file_spec.GetDirectory();
+ return static_cast<bool>(file_spec.GetDirectory());
}
bool
More information about the lldb-commits
mailing list