ruby-changes:39336
From: naruse <ko1@a...>
Date: Wed, 29 Jul 2015 10:39:58 +0900 (JST)
Subject: [ruby-changes:39336] naruse:r51417 (trunk): refix r51329 and show thread information
naruse 2015-07-29 10:39:17 +0900 (Wed, 29 Jul 2015) New Revision: 51417 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51417 Log: refix r51329 and show thread information Modified files: trunk/.gdbinit Index: .gdbinit =================================================================== --- .gdbinit (revision 51416) +++ .gdbinit (revision 51417) @@ -910,23 +910,16 @@ end https://github.com/ruby/ruby/blob/trunk/.gdbinit#L910 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 https://github.com/ruby/ruby/blob/trunk/.gdbinit#L928 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 "* #<Thread:%p rb_thread_t:%p native_thread:%p>\n", \ + $ps_thread, $ps_thread_th, $ps_thread_th->thread_id end # Details: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/