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
This commit is contained in:
parent
c483ae6572
commit
5651313b85
5
thread.c
5
thread.c
@ -203,8 +203,9 @@ void rb_thread_debug(const char *fmt, ...);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
# ifdef NON_SCALAR_THREAD_ID
|
# ifdef NON_SCALAR_THREAD_ID
|
||||||
static const char *
|
#define fill_thread_id_string ruby_fill_thread_id_string
|
||||||
fill_thread_id_string(rb_nativethread_id_t thid, rb_thread_id_string_t buf)
|
const char *
|
||||||
|
ruby_fill_thread_id_string(rb_nativethread_id_t thid, rb_thread_id_string_t buf)
|
||||||
{
|
{
|
||||||
extern const char ruby_digitmap[];
|
extern const char ruby_digitmap[];
|
||||||
size_t i;
|
size_t i;
|
||||||
|
10
vm_dump.c
10
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
|
void
|
||||||
rb_vmdebug_stack_dump_all_threads(void)
|
rb_vmdebug_stack_dump_all_threads(void)
|
||||||
{
|
{
|
||||||
@ -1054,7 +1058,13 @@ rb_vmdebug_stack_dump_all_threads(void)
|
|||||||
rb_thread_t *th = NULL;
|
rb_thread_t *th = NULL;
|
||||||
|
|
||||||
list_for_each(&vm->living_threads, th, vmlt_node) {
|
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);
|
fprintf(stderr, "th: %p, native_id: %p\n", th, (void *)th->thread_id);
|
||||||
|
#endif
|
||||||
rb_vmdebug_stack_dump_raw(th, th->cfp);
|
rb_vmdebug_stack_dump_raw(th, th->cfp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user