From 72272159d8e4c63225c7be1d35e4daf8dcc80e6c Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 29 Jul 2015 01:39:17 +0000 Subject: [PATCH] refix r51329 and show thread information git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- .gdbinit | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.gdbinit b/.gdbinit index 27d2d9fc4c..46bc9bc5dd 100644 --- a/.gdbinit +++ b/.gdbinit @@ -910,23 +910,16 @@ end define rb_ps_vm print $ps_vm = (rb_vm_t*)$arg0 - set $ps_threads = (st_table*)$ps_vm->living_threads - if $ps_threads->entries_packed - set $ps_threads_i = 0 - while $ps_threads_i < $ps_threads->num_entries - set $ps_threads_key = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].key - set $ps_threads_val = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].val - rb_ps_thread $ps_threads_key $ps_threads_val - set $ps_threads_i = $ps_threads_i + 1 - end - else - set $ps_threads_ptr = (st_table_entry*)$ps_threads->as.big.private_list_head[0] - while $ps_threads_ptr - set $ps_threads_key = (st_data_t)$ps_threads_ptr->key - set $ps_threads_val = (st_data_t)$ps_threads_ptr->record - rb_ps_thread $ps_threads_key $ps_threads_val - set $ps_threads_ptr = (st_table_entry*)$ps_threads_ptr->olist.next + set $ps_thread_ln = $ps_vm->living_threads.n.next + set $ps_thread_ln_last = $ps_vm->living_threads.n.prev + while 1 + set $ps_thread_th = (rb_thread_t *)$ps_thread_ln + set $ps_thread = (VALUE)($ps_thread_th->self) + rb_ps_thread $ps_thread + if $ps_thread_ln == $ps_thread_ln_last + loop_break end + set $ps_thread_ln = $ps_thread_ln->next end end document rb_ps_vm @@ -935,8 +928,9 @@ end define rb_ps_thread set $ps_thread = (struct RTypedData*)$arg0 - set $ps_thread_id = $arg1 - print $ps_thread_th = (rb_thread_t*)$ps_thread->data + set $ps_thread_th = (rb_thread_t*)$ps_thread->data + printf "* #\n", \ + $ps_thread, $ps_thread_th, $ps_thread_th->thread_id end # Details: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB