ruby-changes:44665
From: nobu <ko1@a...>
Date: Sat, 12 Nov 2016 15:12:13 +0900 (JST)
Subject: [ruby-changes:44665] nobu:r56738 (trunk): .gdbinit: improve rp [ci skip]
nobu 2016-11-12 15:12:09 +0900 (Sat, 12 Nov 2016) New Revision: 56738 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56738 Log: .gdbinit: improve rp [ci skip] * .gdbinit (rp): improve T_OBJECT dump. show the contents of the instance variables table. Modified files: trunk/.gdbinit Index: .gdbinit =================================================================== --- .gdbinit (revision 56737) +++ .gdbinit (revision 56738) @@ -63,7 +63,13 @@ define rp https://github.com/ruby/ruby/blob/trunk/.gdbinit#L63 else if ($flags & RUBY_T_MASK) == RUBY_T_OBJECT printf "%sT_OBJECT%s: ", $color_type, $color_end - print (struct RObject *)($arg0) + print ((struct RObject *)($arg0))->basic + if ($flags & ROBJECT_EMBED) + print/x *((VALUE*)((struct RObject*)($arg0))->as.ary) @ (ROBJECT_EMBED_LEN_MAX+0) + else + print (((struct RObject *)($arg0))->as.heap) + print/x *(((struct RObject*)($arg0))->as.heap.ivptr) @ (((struct RObject*)($arg0))->as.heap.numiv) + end else if ($flags & RUBY_T_MASK) == RUBY_T_CLASS printf "%sT_CLASS%s%s: ", $color_type, ($flags & RUBY_FL_SINGLETON) ? "*" : "", $color_end @@ -467,7 +473,7 @@ define rp_class https://github.com/ruby/ruby/blob/trunk/.gdbinit#L473 end printf "\n" rb_classname $arg0 - print *(struct RClass *)($arg0) + print/x *(struct RClass *)($arg0) print *((struct RClass *)($arg0))->ptr end document rp_class -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/