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: nodejs#24825

PR-URL: nodejs#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 refack committed Jan 10, 2019
1 parent eec6433 commit 1e14649
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/debug_utils.cc
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 1e14649

Please sign in to comment.