1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rp_class rb_ancestors

* .gdbinit (rp_class): Print the content of a Class/Module.

* .gdbinit (rb_ancestors): Print ancestors.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-07-02 08:07:01 +00:00
parent edb1fc4eb2
commit 5f8dfdd9c7

View file

@ -106,21 +106,15 @@ define rp
else
if ($flags & RUBY_T_MASK) == RUBY_T_CLASS
printf "T_CLASS%s: ", ($flags & RUBY_FL_SINGLETON) ? "*" : ""
print (struct RClass *)($arg0)
print *(struct RClass *)($arg0)
print *((struct RClass *)($arg0))->ptr
rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_ICLASS
printf "T_ICLASS: "
print (struct RClass *)($arg0)
print *(struct RClass *)($arg0)
print *((struct RClass *)($arg0))->ptr
rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_MODULE
printf "T_MODULE: "
print (struct RClass *)($arg0)
print *(struct RClass *)($arg0)
print *((struct RClass *)($arg0))->ptr
rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_FLOAT
printf "T_FLOAT: %.16g ", (((struct RFloat*)($arg0))->float_value)
@ -343,6 +337,19 @@ document rp
Print a Ruby's VALUE.
end
define rp_class
printf "(struct RClass *) %p", (void*)$arg0
if ((struct RClass *)($arg0))->ptr.origin != $arg0
printf " -> %p", ((struct RClass *)($arg0))->ptr.origin
end
printf "\n"
print *(struct RClass *)($arg0)
print *((struct RClass *)($arg0))->ptr
end
document rp_class
Print the content of a Class/Module.
end
define nd_type
print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
end
@ -695,6 +702,17 @@ define rb_classname
print *(struct RClass*)($arg0)
end
define rb_ancestors
set $rb_ancestors_module = $arg0
while $rb_ancestors_module
rp $rb_ancestors_module
set $rb_ancestors_module = ((struct RClass *)($rb_ancestors_module))->ptr.super
end
end
document rb_ancestors
Print ancestors.
end
define rb_backtrace
call rb_backtrace()
end