ruby-changes:41473
From: nobu <ko1@a...>
Date: Fri, 15 Jan 2016 22:16:22 +0900 (JST)
Subject: [ruby-changes:41473] nobu:r53547 (trunk): .gdbinit: dump_node [ci skip]
nobu 2016-01-15 22:16:53 +0900 (Fri, 15 Jan 2016) New Revision: 53547 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53547 Log: .gdbinit: dump_node [ci skip] * .gdbinit (dump_node): dump NODE list in gdb. Modified files: trunk/.gdbinit Index: .gdbinit =================================================================== --- .gdbinit (revision 53546) +++ .gdbinit (revision 53547) @@ -964,3 +964,11 @@ define rbi https://github.com/ruby/ruby/blob/trunk/.gdbinit#L964 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/