Skip to content

Commit 54e42f0

Browse files
gireeshpunathilMylesBorins
authored andcommitted
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>
1 parent fd0361b commit 54e42f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/debug_utils.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030

3131
#endif // __POSIX__
3232

33-
#if defined(__linux__) || defined(__sun)
33+
#if defined(__linux__) || defined(__sun) || defined(__FreeBSD__)
3434
#include <link.h>
35-
#endif // (__linux__) || defined(__sun)
35+
#endif // (__linux__) || defined(__sun) || defined(__FreeBSD__)
3636

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

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

0 commit comments

Comments
 (0)