From 249790802db62ff22c79830d4054c449fa3c243b Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 28 Jun 2017 04:49:30 +0000 Subject: introduce rb_thread_ptr() to replace GetThreadPtr(). * vm_core.h (rb_thread_ptr): added to replace GetThreadPtr() macro. * thread.c (in some functions: use "target_th" instead of "th" to make clear that it is not a current thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_dump.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'vm_dump.c') diff --git a/vm_dump.c b/vm_dump.c index 148790da79..dbd9c6bb89 100644 --- a/vm_dump.c +++ b/vm_dump.c @@ -212,9 +212,8 @@ rb_vmdebug_proc_dump_raw(rb_proc_t *proc) void rb_vmdebug_stack_dump_th(VALUE thval) { - rb_thread_t *th; - GetThreadPtr(thval, th); - rb_vmdebug_stack_dump_raw(th, th->ec.cfp); + rb_thread_t *target_th = rb_thread_ptr(thval); + rb_vmdebug_stack_dump_raw(target_th, target_th->ec.cfp); } #if VMDEBUG > 2 @@ -327,9 +326,7 @@ rb_vmdebug_debug_print_register(rb_thread_t *th) void rb_vmdebug_thread_dump_regs(VALUE thval) { - rb_thread_t *th; - GetThreadPtr(thval, th); - rb_vmdebug_debug_print_register(th); + rb_vmdebug_debug_print_register(rb_thread_ptr(thval)); } void @@ -399,10 +396,8 @@ rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp VALUE rb_vmdebug_thread_dump_state(VALUE self) { - rb_thread_t *th; - rb_control_frame_t *cfp; - GetThreadPtr(self, th); - cfp = th->ec.cfp; + rb_thread_t *th = rb_thread_ptr(self); + rb_control_frame_t *cfp = th->ec.cfp; fprintf(stderr, "Thread state dump:\n"); fprintf(stderr, "pc : %p, sp : %p\n", (void *)cfp->pc, (void *)cfp->sp); -- cgit v1.2.3