Skip to content

Commit

Permalink
src: port GetLoadedLibraries for freebsd
Browse files Browse the repository at this point in the history
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 25, 2018
1 parent f213a05 commit e0e1b6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/debug_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e0e1b6d

Please sign in to comment.