mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
.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
This commit is contained in:
parent
fd7b490fc3
commit
2fd11c760c
1 changed files with 8 additions and 0 deletions
8
.gdbinit
8
.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
|
||||
|
|
Loading…
Reference in a new issue