Permalink
Browse files

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 authored and MylesBorins committed Dec 18, 2018
1 parent fd0361b commit 54e42f04a726639e08e85effe23e59f9276ed029
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/debug_utils.cc
@@ -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);

0 comments on commit 54e42f0

Please sign in to comment.