summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-28 04:49:30 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-28 04:49:30 (GMT)
commit249790802db62ff22c79830d4054c449fa3c243b (patch)
treec0ee96bf9da5df9607397c841b2b7953a41d4c04 /vm_dump.c
parente42a16190c0c5bbdbe052b62c3a8b67920b3d08f (diff)
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
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 148790d..dbd9c6b 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);