GDB - Inspecting a live Ruby process
From Sandoz
source : http://weblog.jamisbuck.org/2006/9/22/inspecting-a-live-ruby-process
sudo gdb /usr/local/bin/ruby <pid> ->sudo gdb ruby 2546
then type:
(gdb) set $ary = (int)backtrace(-1)
(gdb) set $count = *($ary+8)
(gdb) set $index = 0
(gdb) while $index < $count
> x/1s *((int)rb_ary_entry($ary, $index)+12)
> set $index = $index + 1
>end
(gdb) call rb_raise(rb_eException, "raising an exception")