summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-26 06:50:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-26 06:50:57 +0000
commit785438a3d7c60917c323fcd3b43d8ce37192f770 (patch)
tree4f255096e40c052724dcfd0772e9945a0bd260af /.gdbinit
parent3f8d0777449049406fac927ae275ccbd46400eab (diff)
.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
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit36
1 files changed, 35 insertions, 1 deletions
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