This is an archive of the discontinued LLVM Phabricator instance.

Add the ability to load a dylib specified by a library name and a set of search paths
Needs ReviewPublic

Authored by jingham on Jun 27 2018, 6:23 PM.

Details

Reviewers
jasonmolenda
Summary

At a high level this change adds:

SBProcess::LoadImageUsingPaths(library_name, vector_of_paths, found_path, error)

The point of adding this API is that the change also reworks the PlatformPosix dlopen helper function so that we can write the vector of paths down into the target, and then have the helper function iterate over the paths till it finds the one containing the library and loads it, or exhausts the paths and fails.

It might seem odd to want a higher performance version of "dlopen along a series of paths" but it turns out that in Swift's usage of lldb, this operation is not uncommon, and for large projects having ~100 libraries we need to load along a list of ~100 paths, which gets very slow if you do it one by one. So doing this quickly is a big deal.

Diff Detail

Repository
rL LLVM

Event Timeline

jingham created this revision.Jun 27 2018, 6:23 PM