Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: port GetLoadedLibraries for freebsd #25106

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
src: port GetLoadedLibraries for freebsd
the dl_iterate_phdr and its associated data structure in Linux
are fully available in freebsd as well, so opening it up for
freebsd means just opening up the platform specific identifiers.

Refs: #24825

PR-URL: #25106
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
gireeshpunathil committed Dec 20, 2018
commit 6f8ccef74ec514292ebf8ee65602d8c109b0aa2b
6 changes: 3 additions & 3 deletions src/debug_utils.cc
Original file line number Diff line number Diff line change
@@ -30,9 +30,9 @@

#endif // __POSIX__

#if defined(__linux__) || defined(__sun)
#if defined(__linux__) || defined(__sun) || defined(__FreeBSD__)
#include <link.h>
#endif // (__linux__) || defined(__sun)
#endif // (__linux__) || defined(__sun) || defined(__FreeBSD__)

#ifdef __APPLE__
#include <mach-o/dyld.h> // _dyld_get_image_name()
@@ -322,7 +322,7 @@ void CheckedUvLoopClose(uv_loop_t* loop) {

std::vector<std::string> NativeSymbolDebuggingContext::GetLoadedLibraries() {
std::vector<std::string> list;
#ifdef __linux__
#if defined(__linux__) || defined(__FreeBSD__)
dl_iterate_phdr(
[](struct dl_phdr_info* info, size_t size, void* data) {
auto list = static_cast<std::vector<std::string>*>(data);