summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-26 03:28:50 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-26 03:28:50 +0000
commit086301ac73c34bc2231f98b67d56b50c65480cc1 (patch)
tree33963ae1dfbf3cf87c8f5873272cfa45db492bea /vm_dump.c
parentf8f3585416d93af69f2d0dce595ea933c3d43694 (diff)
* addr2line.c: added to show source filename and line number of
functions in backtrace. [ruby-dev:42625] a patch from shinichiro.h <shinichiro.hamaji AT gmail.com> * addr2line.h: ditto. * common.mk: add addr2line.$(OBJEXT). * configure.in: check dl_iterate_phdr. * vm_dump.c (rb_vm_bugreport): use rb_dump_backtrace_with_lines in addr2line.c when the binary is ELF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 452e307..8adb3f4 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -10,6 +10,7 @@
#include "ruby/ruby.h"
+#include "addr2line.h"
#include "vm_core.h"
#define MAX_POSBUF 128
@@ -788,9 +789,13 @@ rb_vm_bugreport(void)
int i;
if (syms) {
+#ifdef __ELF__
+ rb_dump_backtrace_with_lines(n, trace, syms);
+#else
for (i=0; i<n; i++) {
fprintf(stderr, "%s\n", syms[i]);
}
+#endif
free(syms);
}
#elif defined(_WIN32)