From 6bd1aa278a00bffe742725721024d534a98f2b70 Mon Sep 17 00:00:00 2001 From: Oleksiy Vyalov Date: Tue, 14 Jul 2015 18:59:32 +0000 Subject: Use target.exec-search-paths setting when resolving executable path for remote target. http://reviews.llvm.org/D11163 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@242183 91177308-0d34-0410-b5e6-96231b3b80d8 --- source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp | 4 +++- source/Plugins/Platform/Linux/PlatformLinux.cpp | 2 +- source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index d9829a58d..8724fc039 100644 --- a/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -667,7 +667,9 @@ DynamicLoaderPOSIXDYLD::ResolveExecutableModule (lldb::ModuleSP &module_sp) if (module_sp && module_sp->MatchesModuleSpec (module_spec)) return; - auto error = platform_sp->ResolveExecutable (module_spec, module_sp, nullptr); + const auto executable_search_paths (Target::GetDefaultExecutableSearchPaths()); + auto error = platform_sp->ResolveExecutable ( + module_spec, module_sp, !executable_search_paths.IsEmpty() ? &executable_search_paths : nullptr); if (error.Fail ()) { StreamString stream; diff --git a/source/Plugins/Platform/Linux/PlatformLinux.cpp b/source/Plugins/Platform/Linux/PlatformLinux.cpp index 33fa89c63..d6b348f45 100644 --- a/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ b/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -276,7 +276,7 @@ PlatformLinux::ResolveExecutable (const ModuleSpec &ms, { if (m_remote_platform_sp) { - error = GetCachedExecutable (resolved_module_spec, exe_module_sp, nullptr, *m_remote_platform_sp); + error = GetCachedExecutable (resolved_module_spec, exe_module_sp, module_search_paths_ptr, *m_remote_platform_sp); } else { diff --git a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index c58a1dab2..b0e75d4f3 100644 --- a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -141,13 +141,14 @@ PlatformRemoteGDBServer::ResolveExecutable (const ModuleSpec &module_spec, // Resolve any executable within an apk on Android? //Host::ResolveExecutableInBundle (resolved_module_spec.GetFileSpec()); - if (resolved_module_spec.GetFileSpec().Exists()) + if (resolved_module_spec.GetFileSpec().Exists() || + module_spec.GetUUID().IsValid()) { if (resolved_module_spec.GetArchitecture().IsValid() || resolved_module_spec.GetUUID().IsValid()) { error = ModuleList::GetSharedModule (resolved_module_spec, exe_module_sp, - NULL, + module_search_paths_ptr, NULL, NULL); @@ -163,7 +164,7 @@ PlatformRemoteGDBServer::ResolveExecutable (const ModuleSpec &module_spec, { error = ModuleList::GetSharedModule (resolved_module_spec, exe_module_sp, - NULL, + module_search_paths_ptr, NULL, NULL); // Did we find an executable using one of the -- cgit v1.2.3