[Lldb-commits] [lldb] r246852 - Fix TestLoadUnload.test_load_unload for android API > 21

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 4 05:42:42 PDT 2015


Author: tberghammer
Date: Fri Sep  4 07:42:41 2015
New Revision: 246852

URL: http://llvm.org/viewvc/llvm-project?rev=246852&view=rev
Log:
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

Modified:
    lldb/trunk/source/Core/Module.cpp
    lldb/trunk/source/Target/Platform.cpp

Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=246852&r1=246851&r2=246852&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Fri Sep  4 07:42:41 2015
@@ -1708,7 +1708,8 @@ Module::MatchesModuleSpec (const ModuleS
     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;
     }
 

Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=246852&r1=246851&r2=246852&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Fri Sep  4 07:42:41 2015
@@ -272,8 +272,11 @@ Platform::GetSharedModule (const ModuleS
                                   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);
 }




More information about the lldb-commits mailing list