ruby-changes:51438
From: ko1 <ko1@a...>
Date: Wed, 13 Jun 2018 11:50:25 +0900 (JST)
Subject: [ruby-changes:51438] ko1:r63644 (trunk): add "print_flags" gdb command.
ko1 2018-06-13 11:50:21 +0900 (Wed, 13 Jun 2018) New Revision: 63644 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63644 Log: add "print_flags" gdb command. * .gdbinit (print_flags): added to show raw FLAGS info for objects. Modified files: trunk/.gdbinit Index: .gdbinit =================================================================== --- .gdbinit (revision 63643) +++ .gdbinit (revision 63644) @@ -1307,3 +1307,34 @@ define dump_node https://github.com/ruby/ruby/blob/trunk/.gdbinit#L1307 ((struct RString*)$str)->as.heap.ptr : \ ((struct RString*)$str)->as.ary) end + +define print_flags + printf "RUBY_FL_WB_PROTECTED: %s\n", RBASIC($arg0)->flags & RUBY_FL_WB_PROTECTED ? "1" : "0" + printf "RUBY_FL_PROMOTED0 : %s\n", RBASIC($arg0)->flags & RUBY_FL_PROMOTED0 ? "1" : "0" + printf "RUBY_FL_PROMOTED1 : %s\n", RBASIC($arg0)->flags & RUBY_FL_PROMOTED1 ? "1" : "0" + printf "RUBY_FL_FINALIZE : %s\n", RBASIC($arg0)->flags & RUBY_FL_FINALIZE ? "1" : "0" + printf "RUBY_FL_TAINT : %s\n", RBASIC($arg0)->flags & RUBY_FL_TAINT ? "1" : "0" + printf "RUBY_FL_UNTRUSTED : %s\n", RBASIC($arg0)->flags & RUBY_FL_UNTRUSTED ? "1" : "0" + printf "RUBY_FL_EXIVAR : %s\n", RBASIC($arg0)->flags & RUBY_FL_EXIVAR ? "1" : "0" + printf "RUBY_FL_FREEZE : %s\n", RBASIC($arg0)->flags & RUBY_FL_FREEZE ? "1" : "0" + + printf "RUBY_FL_USER0 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER0 ? "1" : "0" + printf "RUBY_FL_USER1 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER1 ? "1" : "0" + printf "RUBY_FL_USER2 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER2 ? "1" : "0" + printf "RUBY_FL_USER3 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER3 ? "1" : "0" + printf "RUBY_FL_USER4 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER4 ? "1" : "0" + printf "RUBY_FL_USER5 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER5 ? "1" : "0" + printf "RUBY_FL_USER6 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER6 ? "1" : "0" + printf "RUBY_FL_USER7 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER7 ? "1" : "0" + printf "RUBY_FL_USER8 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER8 ? "1" : "0" + printf "RUBY_FL_USER9 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER9 ? "1" : "0" + printf "RUBY_FL_USER10 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER10 ? "1" : "0" + printf "RUBY_FL_USER11 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER11 ? "1" : "0" + printf "RUBY_FL_USER12 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER12 ? "1" : "0" + printf "RUBY_FL_USER13 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER13 ? "1" : "0" + printf "RUBY_FL_USER14 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER14 ? "1" : "0" + printf "RUBY_FL_USER15 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER15 ? "1" : "0" + printf "RUBY_FL_USER16 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER16 ? "1" : "0" + printf "RUBY_FL_USER17 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER17 ? "1" : "0" + printf "RUBY_FL_USER18 : %s\n", RBASIC($arg0)->flags & RUBY_FL_USER18 ? "1" : "0" +end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/