summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-24 13:39:16 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-24 13:39:16 +0000
commit8d1689508d8b9b45decd4dd0507d46ba12dfce2e (patch)
treebbde4d45221afc4cc4e3203e805cb688a4c79269 /vm_dump.c
parent155149109a9c6d6ae79bf40398cb51e8883dad26 (diff)
* error.c, vm_dump.c: change message by rb_bug().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/vm_dump.c b/vm_dump.c
index d922b5b..2098f12 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -580,9 +580,16 @@ rb_vm_bugreport(void)
SDR();
bt = rb_make_backtrace();
- if (TYPE(bt) == T_ARRAY)
- for (i = 0; i < RARRAY_LEN(bt); i++) {
- dp(RARRAY_PTR(bt)[i]);
+
+ if (bt) {
+ fprintf(stderr, "-- Ruby level backtrace information"
+ "-----------------------------------------\n");
+
+ for (i = 0; i < RARRAY_LEN(bt); i++) {
+ VALUE str = RARRAY_PTR(bt)[i];
+ fprintf(stderr, "%s\n", RSTRING_PTR(str));
+ }
+ fprintf(stderr, "\n");
}
}
@@ -592,13 +599,20 @@ rb_vm_bugreport(void)
{
static void *trace[MAX_NATIVE_TRACE];
int n = backtrace(trace, MAX_NATIVE_TRACE);
+ char **syms = backtrace_symbols(trace, n);
int i;
- fprintf(stderr, "-- backtrace of native function call (Use addr2line) --\n");
+ fprintf(stderr, "-- C level backtrace information "
+ "-------------------------------------------\n");
for (i=0; i<n; i++) {
- fprintf(stderr, "%p\n", trace[i]);
+ char *info = syms ? syms[i] : "";
+ fprintf(stderr, "%p %s\n", trace[i], info);
+ }
+ fprintf(stderr, "\n");
+
+ if (syms) {
+ free(syms);
}
- fprintf(stderr, "-------------------------------------------------------\n");
}
#endif
}