summaryrefslogtreecommitdiff
path: root/addr2line.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-25 16:58:45 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-25 16:58:45 (GMT)
commitc1b81d35782225a12ac49ff42aeeb5a9982772b1 (patch)
treed6a982a819b5557c7e0d3f7e7b781b3ce36e1f2e /addr2line.c
parentcd2afc30fdf10cd5da6b3814a8d07843ecdbc324 (diff)
* addr2line.c (rb_dump_backtrace_with_lines): a function to get must
be a function in the main executable, whose absolute path is not available by dladdr, and ruby get it by /proc/self/exe on Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'addr2line.c')
-rw-r--r--addr2line.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/addr2line.c b/addr2line.c
index 0123aff..94adf85 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -623,8 +623,9 @@ rb_dump_backtrace_with_lines(int num_traces, void **traces, char **syms)
intptr_t main_fbase;
char *main_path;
{
+ extern int main(int argc, char **argv); /* a function in the main executalbe */
Dl_info info;
- dladdr(rb_dump_backtrace_with_lines, &info);
+ dladdr(main, &info);
main_fbase = (intptr_t)info.dli_fbase;
}
{