[Lldb-commits] [PATCH] D12601: Fix TestLoadUnload.test_load_unload for android API > 21

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 3 09:18:56 PDT 2015


tberghammer created this revision.
tberghammer added a reviewer: ovyalov.
tberghammer added a subscriber: lldb-commits.
Herald added subscribers: danalbert, tberghammer.

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

http://reviews.llvm.org/D12601

Files:
  source/Core/Module.cpp
  source/Target/Platform.cpp

Index: source/Target/Platform.cpp
===================================================================
--- source/Target/Platform.cpp
+++ source/Target/Platform.cpp
@@ -272,8 +272,11 @@
                                   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);
 }
Index: source/Core/Module.cpp
===================================================================
--- source/Core/Module.cpp
+++ source/Core/Module.cpp
@@ -1708,7 +1708,8 @@
     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;
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12601.33949.patch
Type: text/x-patch
Size: 1488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150903/aee287b3/attachment.bin>


More information about the lldb-commits mailing list