From 785438a3d7c60917c323fcd3b43d8ce37192f770 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 26 Mar 2015 06:50:57 +0000 Subject: .gdbinit: T_IMEMO * .gdbinit (rp_imemo): print the content support of each T_IMEMO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- .gdbinit | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to '.gdbinit') diff --git a/.gdbinit b/.gdbinit index 4d44527447..5864bb15ce 100644 --- a/.gdbinit +++ b/.gdbinit @@ -249,7 +249,7 @@ define rp printf "%sT_IMEMO%s(", $color_type, $color_end output (enum imemo_type)(($flags>>RUBY_FL_USHIFT)&imemo_mask) printf "): " - print *((VALUE (*)[4])($arg0)) + rp_imemo $arg0 else if ($flags & RUBY_T_MASK) == RUBY_T_NODE printf "%sT_NODE%s(", $color_type, $color_end @@ -467,6 +467,40 @@ document rp_class Print the content of a Class/Module. end +define rp_imemo + set $flags = (((struct RBasic *)($arg0))->flags >> RUBY_FL_USHIFT) & imemo_mask + if $flags == imemo_cref + printf "(rb_cref_t *) %p\n", (void*)$arg0 + print *(rb_cref_t *)$arg0 + else + if $flags == imemo_svar + printf "(struct vm_svar *) %p\n", (void*)$arg0 + print *(struct vm_svar *)$arg0 + else + if $flags == imemo_throw_data + printf "(struct vm_throw_data *) %p\n", (void*)$arg0 + print *(struct vm_throw_data *)$arg0 + else + if $flags == imemo_ifunc + printf "(struct vm_ifunc *) %p\n", (void*)$arg0 + print *(struct vm_ifunc *)$arg0 + else + if $flags == imemo_memo + printf "(struct MEMO *) %p\n", (void*)$arg0 + print *(struct MEMO *)$arg0 + else + printf "(struct RIMemo *) %p\n", (void*)$arg0 + print *(struct RIMemo *)$arg0 + end + end + end + end + end +end +document rp_imemo + Print the content of a memo +end + define nd_type print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT) end -- cgit v1.2.3