aboutsummaryrefslogtreecommitdiffstats
path: root/vm_dump.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-21 00:53:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-21 00:53:26 +0000
commitcabbef30105c5287217fbce88bca88dab2bbb74a (patch)
tree725f3fdfebebf6216fe11f09d42332d3cfa54d82 /vm_dump.c
parentbd3793fb9910b5a4695112963ca94199884f1db6 (diff)
downloadruby-cabbef30105c5287217fbce88bca88dab2bbb74a.tar.gz
vm_dump.c: non-scalar thread_id
* vm_dump.c (rb_vmdebug_stack_dump_all_threads): fix for non-scalar thread_id platforms. c.f. [Bug #9884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 5c56d61652..9d1139ec92 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -1047,6 +1047,10 @@ rb_vm_bugreport(const void *ctx)
}
}
+#ifdef NON_SCALAR_THREAD_ID
+const char *ruby_fill_thread_id_string(rb_nativethread_id_t thid, rb_thread_id_string_t buf);
+#endif
+
void
rb_vmdebug_stack_dump_all_threads(void)
{
@@ -1054,7 +1058,13 @@ rb_vmdebug_stack_dump_all_threads(void)
rb_thread_t *th = NULL;
list_for_each(&vm->living_threads, th, vmlt_node) {
+#ifdef NON_SCALAR_THREAD_ID
+ rb_thread_id_string_t buf;
+ ruby_fill_thread_id_string(th->thread_id, buf);
+ fprintf(stderr, "th: %p, native_id: %s\n", th, buf);
+#else
fprintf(stderr, "th: %p, native_id: %p\n", th, (void *)th->thread_id);
+#endif
rb_vmdebug_stack_dump_raw(th, th->cfp);
}
}