From 980662ee9db3bbbe851e4e458e2ce71f9be649f6 Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Fri, 4 Sep 2015 12:42:41 +0000 Subject: [PATCH] Fix TestLoadUnload.test_load_unload for android API > 21 * Change Module::MatchesModuleSpec to return true in case the file spec in the specified module spec matches with the platform file spec, but not with the local file spec * Change the module_resolver used when resolving a remote shared module to always set the platform file spec to the file spec requested Differential revision: http://reviews.llvm.org/D12601 llvm-svn: 246852 --- lldb/source/Core/Module.cpp | 3 ++- lldb/source/Target/Platform.cpp | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 18ade8500f92..2fbc5e7af164 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -1708,7 +1708,8 @@ Module::MatchesModuleSpec (const ModuleSpec &module_ref) const FileSpec &file_spec = module_ref.GetFileSpec(); if (file_spec) { - if (!FileSpec::Equal (file_spec, m_file, (bool)file_spec.GetDirectory())) + if (!FileSpec::Equal (file_spec, m_file, (bool)file_spec.GetDirectory()) && + !FileSpec::Equal (file_spec, m_platform_file, (bool)file_spec.GetDirectory())) return false; } diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index e47c6f36b43f..4e07a16044c3 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -272,8 +272,11 @@ Platform::GetSharedModule (const ModuleSpec &module_spec, module_sp, [&](const ModuleSpec &spec) { - return ModuleList::GetSharedModule ( + Error error = ModuleList::GetSharedModule ( spec, module_sp, module_search_paths_ptr, old_module_sp_ptr, did_create_ptr, false); + if (error.Success() && module_sp) + module_sp->SetPlatformFileSpec(spec.GetFileSpec()); + return error; }, did_create_ptr); }