Skip to content

Commit

Permalink
Use libunwind to find local symbol address on FreeBSD
Browse files Browse the repository at this point in the history
Similar to Linux.
The LLVM fallback is currently not working on FreeBSD for some reason.

Fix: #20798
  • Loading branch information
iblislin authored and yuyichao committed Jun 26, 2017
1 parent 7164442 commit e0eb9c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ static void get_function_name_and_base(const object::ObjectFile *object, bool in
bool needs_name = name && (!*name || untrusted_dladdr);
// Try platform specific methods first since they are usually faster
if (needs_saddr) {
#if defined(_OS_LINUX_) && !defined(JL_DISABLE_LIBUNWIND)
#if (defined(_OS_LINUX_) || defined(_OS_FREEBSD_)) && !defined(JL_DISABLE_LIBUNWIND)
unw_proc_info_t pip;
if (unw_get_proc_info_by_ip(unw_local_addr_space, pointer, &pip, NULL) == 0) {
*saddr = (void*)pip.start_ip;
Expand Down
7 changes: 1 addition & 6 deletions test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,7 @@ end
for precomp in ("yes", "no")
bt = readstring(pipeline(ignorestatus(`$(Base.julia_cmd()) --startup-file=no --precompiled=$precomp
-E 'include("____nonexistent_file")'`), stderr=catcmd))
if (is_bsd() && !is_apple()) && precomp == "yes"
# FIXME: #20798 (FreeBSD)
@test_broken contains(bt, "include_from_node1(::Module, ::String) at $(joinpath(".", "loading.jl"))")
else
@test contains(bt, "include_from_node1(::Module, ::String) at $(joinpath(".", "loading.jl"))")
end
@test contains(bt, "include_from_node1(::Module, ::String) at $(joinpath(".", "loading.jl"))")
lno = match(r"at \.[\/\\]loading\.jl:(\d+)", bt)
@test length(lno.captures) == 1
@test parse(Int, lno.captures[1]) > 0
Expand Down

0 comments on commit e0eb9c3

Please sign in to comment.