summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-15 13:16:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-15 13:16:53 +0000
commit2fd11c760ca2f903092c461566bd522636ea45cc (patch)
tree0898c5b62377923e3b6a8fd17d6d435e3cfef1b2 /.gdbinit
parentfd7b490fc3dc33c22b7c173617363953fc8453c8 (diff)
.gdbinit: dump_node [ci skip]
* .gdbinit (dump_node): dump NODE list in gdb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit8
1 files changed, 8 insertions, 0 deletions
diff --git a/.gdbinit b/.gdbinit
index 03c2b653cb..bc79f51368 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -964,3 +964,11 @@ define rbi
end
end
end
+
+define dump_node
+ set $str = rb_parser_dump_tree($arg0, 0)
+ set $flags = ((struct RBasic*)($str))->flags
+ printf "%s", (char *)(($flags & RUBY_FL_USER1) ? \
+ ((struct RString*)$str)->as.heap.ptr : \
+ ((struct RString*)$str)->as.ary)
+end