[前][次][番号順一覧][スレッド一覧]

ruby-changes:33332

From: naruse <ko1@a...>
Date: Wed, 26 Mar 2014 01:58:58 +0900 (JST)
Subject: [ruby-changes:33332] naruse:r45410 (trunk): * addr2line.c (rb_dump_backtrace_with_lines): a function to get must

naruse	2014-03-26 01:58:45 +0900 (Wed, 26 Mar 2014)

  New Revision: 45410

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45410

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/addr2line.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45409)
+++ ChangeLog	(revision 45410)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Mar 26 01:55:45 2014  NARUSE, Yui  <naruse@r...>
+
+	* 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@r...>
 
 	* addr2line.c (fill_lines): skip if path is NULL.
Index: addr2line.c
===================================================================
--- addr2line.c	(revision 45409)
+++ addr2line.c	(revision 45410)
@@ -623,8 +623,9 @@ rb_dump_backtrace_with_lines(int num_tra https://github.com/ruby/ruby/blob/trunk/addr2line.c#L623
     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;
     }
     {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]