summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-13 02:50:21 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-13 02:50:21 +0000
commit3b43173c64a15d291a30fced4d87762c32869fa5 (patch)
tree85361e663b6fc8d75de147a11a170469fec496b5
parent8ee960c55c1854b4900bf8ad8b689ccb1a265543 (diff)
add "print_flags" gdb command.
* .gdbinit (print_flags): added to show raw FLAGS info for objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--.gdbinit31
1 files changed, 31 insertions, 0 deletions
diff --git a/.gdbinit b/.gdbinit
index 79a1b5d..6d192c8 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -1307,3 +1307,34 @@ define dump_node
((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