aboutsummaryrefslogtreecommitdiffstats
path: root/vm_dump.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-20 04:50:53 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-20 04:50:53 +0000
commit0b6a6d245fe62b7cdedc48aab48bcf6f83f53529 (patch)
treed7af74011fc5fa4686cfbe45443448f38e805d3a /vm_dump.c
parentaa7d253eeb460cd611b410b83c5457453873534d (diff)
downloadruby-0b6a6d245fe62b7cdedc48aab48bcf6f83f53529.tar.gz
add a debug function.
* vm_dump.c (rb_vmdebug_stack_dump_all_threads): dump stack dump for all living threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 40d3b20959..4bc47898cf 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -1046,3 +1046,15 @@ rb_vm_bugreport(const void *ctx)
#endif /* __FreeBSD__ */
}
}
+
+void
+rb_vmdebug_stack_dump_all_threads(void)
+{
+ rb_vm_t *vm = GET_THREAD()->vm;
+ rb_thread_t *th = NULL;
+
+ list_for_each(&vm->living_threads, th, vmlt_node) {
+ fprintf(stderr, "th: %p, native_id: %lx\n", th, (unsigned long)th->thread_id);
+ rb_vmdebug_stack_dump_raw(th, th->cfp);
+ }
+}