summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-02 08:07:01 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-02 08:07:01 (GMT)
commit5f8dfdd9c7e0b5f8666a4fba3fa06b54a17334dc (patch)
tree010efd475196d8a2cff6ad496cd963e6f3c4d313 /.gdbinit
parentedb1fc4eb2f9b0bd69398362ae40100adfd5577e (diff)
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
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit36
1 files changed, 27 insertions, 9 deletions
diff --git a/.gdbinit b/.gdbinit
index 6992e56..956a534 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -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