From 870549b8ac62352c9385e8be99a718dc373cae27 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Tue, 18 Dec 2018 05:01:36 -0500 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/24825 PR-URL: https://github.com/nodejs/node/pull/25106 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau --- src/debug_utils.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debug_utils.cc b/src/debug_utils.cc index 4f086106b66ca7..d9db2d52e0db85 100644 --- a/src/debug_utils.cc +++ b/src/debug_utils.cc @@ -30,9 +30,9 @@ #endif // __POSIX__ -#if defined(__linux__) || defined(__sun) +#if defined(__linux__) || defined(__sun) || defined(__FreeBSD__) #include -#endif // (__linux__) || defined(__sun) +#endif // (__linux__) || defined(__sun) || defined(__FreeBSD__) #ifdef __APPLE__ #include // _dyld_get_image_name() @@ -322,7 +322,7 @@ void CheckedUvLoopClose(uv_loop_t* loop) { std::vector NativeSymbolDebuggingContext::GetLoadedLibraries() { std::vector 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*>(data);