* 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
This commit is contained in:
naruse 2014-03-25 16:58:45 +00:00
Родитель cd2afc30fd
Коммит c1b81d3578
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Wed Mar 26 01:55:45 2014 NARUSE, Yui <naruse@ruby-lang.org>
* 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.
Wed Mar 26 01:34:50 2014 NARUSE, Yui <naruse@ruby-lang.org> Wed Mar 26 01:34:50 2014 NARUSE, Yui <naruse@ruby-lang.org>
* addr2line.c (fill_lines): skip if path is NULL. * addr2line.c (fill_lines): skip if path is NULL.

Просмотреть файл

@ -623,8 +623,9 @@ rb_dump_backtrace_with_lines(int num_traces, void **traces, char **syms)
intptr_t main_fbase; intptr_t main_fbase;
char *main_path; char *main_path;
{ {
extern int main(int argc, char **argv); /* a function in the main executalbe */
Dl_info info; Dl_info info;
dladdr(rb_dump_backtrace_with_lines, &info); dladdr(main, &info);
main_fbase = (intptr_t)info.dli_fbase; main_fbase = (intptr_t)info.dli_fbase;
} }
{ {