* 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
This commit is contained in:
parent
155149109a
commit
8d1689508d
@ -1,3 +1,7 @@
|
|||||||
|
Wed Dec 24 22:36:06 2008 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* error.c, vm_dump.c: change message by rb_bug().
|
||||||
|
|
||||||
Wed Dec 24 21:57:39 2008 Koichi Sasada <ko1@atdot.net>
|
Wed Dec 24 21:57:39 2008 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* compile.c (iseq_peephole_optimize): fix typo.
|
* compile.c (iseq_peephole_optimize): fix typo.
|
||||||
|
7
error.c
7
error.c
@ -207,10 +207,17 @@ report_bug(const char *file, int line, const char *fmt, va_list args)
|
|||||||
|
|
||||||
if (fwrite(buf, 1, len, out) == len ||
|
if (fwrite(buf, 1, len, out) == len ||
|
||||||
fwrite(buf, 1, len, (out = stdout)) == len) {
|
fwrite(buf, 1, len, (out = stdout)) == len) {
|
||||||
|
|
||||||
fputs("[BUG] ", out);
|
fputs("[BUG] ", out);
|
||||||
vfprintf(out, fmt, args);
|
vfprintf(out, fmt, args);
|
||||||
fprintf(out, "\n%s\n\n", ruby_description);
|
fprintf(out, "\n%s\n\n", ruby_description);
|
||||||
|
|
||||||
rb_vm_bugreport();
|
rb_vm_bugreport();
|
||||||
|
|
||||||
|
fprintf(out,
|
||||||
|
"[NOTE]\n"
|
||||||
|
"You may encounter a bug of Ruby interpreter. Bug reports are welcome.\n"
|
||||||
|
"For details: http://www.ruby-lang.org/bugreport.html\n\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
24
vm_dump.c
24
vm_dump.c
@ -580,9 +580,16 @@ rb_vm_bugreport(void)
|
|||||||
SDR();
|
SDR();
|
||||||
|
|
||||||
bt = rb_make_backtrace();
|
bt = rb_make_backtrace();
|
||||||
if (TYPE(bt) == T_ARRAY)
|
|
||||||
|
if (bt) {
|
||||||
|
fprintf(stderr, "-- Ruby level backtrace information"
|
||||||
|
"-----------------------------------------\n");
|
||||||
|
|
||||||
for (i = 0; i < RARRAY_LEN(bt); i++) {
|
for (i = 0; i < RARRAY_LEN(bt); i++) {
|
||||||
dp(RARRAY_PTR(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];
|
static void *trace[MAX_NATIVE_TRACE];
|
||||||
int n = backtrace(trace, MAX_NATIVE_TRACE);
|
int n = backtrace(trace, MAX_NATIVE_TRACE);
|
||||||
|
char **syms = backtrace_symbols(trace, n);
|
||||||
int i;
|
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++) {
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user