This is an archive of the discontinued LLVM Phabricator instance.

Fix TestLoadUnload.test_load_unload for android API > 21
ClosedPublic

Authored by tberghammer on Sep 3 2015, 9:18 AM.

Details

Summary

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

Diff Detail

Event Timeline

tberghammer updated this revision to Diff 33949.Sep 3 2015, 9:18 AM
tberghammer retitled this revision from to Fix TestLoadUnload.test_load_unload for android API > 21.
tberghammer updated this object.
tberghammer added a reviewer: ovyalov.
tberghammer added a subscriber: lldb-commits.
ovyalov accepted this revision.Sep 3 2015, 10:43 AM
ovyalov edited edge metadata.

LGTM

source/Core/Module.cpp
1712

It might expose some tricky problems when host and target have the same library with the same path but different content.. - please make sure that there is no regressions.

source/Target/Platform.cpp
278

What do you think about putting module_sp->SetPlatformFileSpec(spec.GetFileSpec()) into ModuleList::GetSharedModule ?

This revision is now accepted and ready to land.Sep 3 2015, 10:43 AM
tberghammer added inline comments.Sep 4 2015, 3:18 AM
source/Core/Module.cpp
1712

I run the test suit and seen no regression.

If we have a library with the same path on the host and on the target and we don't have UUID then we are already having issues differentiating between them. In the case you described we treat them as matching modules even before my change.

source/Target/Platform.cpp
278

I would like to limit the scope of this change to the case when remote debugging is used. It can be confusing if we set platform file spec even when no remote platform is involved

This revision was automatically updated to reflect the committed changes.