[PATCH] D48696: Add the ability to load a dylib specified by a library name and a set of search paths

Jim Ingham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 18:23:36 PDT 2018


jingham created this revision.
jingham added a reviewer: jasonmolenda.
Herald added subscribers: llvm-commits, emaste.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D48696

Files:
  include/lldb/API/SBProcess.h
  include/lldb/Target/Platform.h
  packages/Python/lldbsuite/test/functionalities/load_using_paths/.categories
  packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
  packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py
  packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/Makefile
  packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/d.cpp
  packages/Python/lldbsuite/test/functionalities/load_using_paths/main.cpp
  scripts/interface/SBProcess.i
  source/API/SBProcess.cpp
  source/Expression/FunctionCaller.cpp
  source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
  source/Plugins/Platform/POSIX/PlatformPOSIX.h
  source/Target/Platform.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48696.153233.patch
Type: text/x-patch
Size: 28445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180628/8e496e60/attachment.bin>


More information about the llvm-commits mailing list