summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-12 06:12:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-12 06:12:09 +0000
commitc937bd4a924f4aa20763f05e58d1b82a6062a7d8 (patch)
tree0e9237cda413cb86364a54aa2573995cc7343fe8 /.gdbinit
parent7e7778f80b7db8eacb653720bbe2ded9b263d42c (diff)
.gdbinit: improve rp [ci skip]
* .gdbinit (rp): improve T_OBJECT dump. show the contents of the instance variables table. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit10
1 files changed, 8 insertions, 2 deletions
diff --git a/.gdbinit b/.gdbinit
index d31ccaa7df..11611e8c24 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -63,7 +63,13 @@ define rp
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
end
printf "\n"
rb_classname $arg0
- print *(struct RClass *)($arg0)
+ print/x *(struct RClass *)($arg0)
print *((struct RClass *)($arg0))->ptr
end
document rp_class