Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libunwind to find the boundary of sysimg functions on linux #14882

Merged
merged 1 commit into from
Feb 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@

#include "julia.h"
#include "julia_internal.h"
#ifdef _OS_LINUX_
# define UNW_LOCAL_ONLY
# include <libunwind.h>
#endif

#include <string>
#include <sstream>
Expand Down Expand Up @@ -881,11 +885,19 @@ static void jl_getDylibFunctionInfo(char **name, char **filename, size_t *line,
#endif
lookup_pointer(context, name, line, filename, inlinedat_line, inlinedat_file, pointer+slide,
fbase == jl_sysimage_base, fromC);
if (jl_sysimage_base == fbase && sysimg_fvars && saddr) {
for (size_t i = 0; i < sysimg_fvars_n; i++) {
if (saddr == sysimg_fvars[i]) {
*outer_linfo = sysimg_fvars_linfo[i];
break;
if (jl_sysimage_base == fbase && sysimg_fvars) {
#ifdef _OS_LINUX_
unw_proc_info_t pip;
if (!saddr && unw_get_proc_info_by_ip(unw_local_addr_space,
pointer, &pip, NULL) == 0)
saddr = (void*)pip.start_ip;
#endif
if (saddr) {
for (size_t i = 0; i < sysimg_fvars_n; i++) {
if (saddr == sysimg_fvars[i]) {
*outer_linfo = sysimg_fvars_linfo[i];
break;
}
}
}
}
Expand Down