* vm_dump.c (rb_vm_bugreport): fix to add bug outputs.
- loaded script ($0) - loaded features ($") - process memory map on Linux (/proc/self/maps) * vm_dump.c (rb_vmdebug_stack_dump_raw): fix header message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cb9ffb8d1c
commit
3bd7384c76
@ -1,3 +1,12 @@
|
|||||||
|
Sat Oct 23 10:55:37 2010 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* vm_dump.c (rb_vm_bugreport): fix to add bug outputs.
|
||||||
|
- loaded script ($0)
|
||||||
|
- loaded features ($")
|
||||||
|
- process memory map on Linux (/proc/self/maps)
|
||||||
|
|
||||||
|
* vm_dump.c (rb_vmdebug_stack_dump_raw): fix header message.
|
||||||
|
|
||||||
Fri Oct 22 14:50:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Oct 22 14:50:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
|
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
|
||||||
|
42
vm_dump.c
42
vm_dump.c
@ -170,12 +170,13 @@ rb_vmdebug_stack_dump_raw(rb_thread_t *th, rb_control_frame_t *cfp)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fprintf(stderr, "-- control frame ----------\n");
|
fprintf(stderr, "-- Control frame information "
|
||||||
|
"-----------------------------------------------\n");
|
||||||
while ((void *)cfp < (void *)(th->stack + th->stack_size)) {
|
while ((void *)cfp < (void *)(th->stack + th->stack_size)) {
|
||||||
control_frame_dump(th, cfp);
|
control_frame_dump(th, cfp);
|
||||||
cfp++;
|
cfp++;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "---------------------------\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -761,7 +762,8 @@ dump_thread(void *arg)
|
|||||||
void
|
void
|
||||||
rb_vm_bugreport(void)
|
rb_vm_bugreport(void)
|
||||||
{
|
{
|
||||||
if (GET_THREAD()->vm) {
|
rb_vm_t *vm = GET_VM();
|
||||||
|
if (vm) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
SDR();
|
SDR();
|
||||||
|
|
||||||
@ -797,5 +799,37 @@ rb_vm_bugreport(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
#endif
|
#endif /* HAVE_BACKTRACE */
|
||||||
|
|
||||||
|
fprintf(stderr, "-- Other runtime information "
|
||||||
|
"-----------------------------------------------\n\n");
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
fprintf(stderr, "* Loaded script: %s\n", StringValueCStr(vm->progname));
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
fprintf(stderr, "* Loaded features:\n\n");
|
||||||
|
for (i=0; i<RARRAY_LEN(vm->loaded_features); i++) {
|
||||||
|
fprintf(stderr, " %4d %s\n", i, StringValueCStr(RARRAY_PTR(vm->loaded_features)[i]));
|
||||||
|
}
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
|
#if __linux__
|
||||||
|
{
|
||||||
|
FILE *fp = fopen("/proc/self/maps", "r");
|
||||||
|
if (fp) {
|
||||||
|
fprintf(stderr, "* Process memory map:\n\n");
|
||||||
|
|
||||||
|
while (!feof(fp)) {
|
||||||
|
char buff[0x100];
|
||||||
|
size_t rn = fread(buff, 1, 0x100, fp);
|
||||||
|
fwrite(buff, 1, rn, stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
fprintf(stderr, "\n\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* __linux__ */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user