2 if (VALUE)$arg0 & RUBY_FIXNUM_FLAG
3 printf "FIXNUM: %ld\n", $arg0 >> 1
5 if ((VALUE)$arg0 & ~(~(VALUE)0<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG
6 printf "SYMBOL(%ld)\n", $arg0 >> RUBY_SPECIAL_SHIFT
8 if $arg0 == RUBY_Qfalse
11 if $arg0 == RUBY_Qtrue
17 if $arg0 == RUBY_Qundef
20 if (VALUE)$arg0 & RUBY_IMMEDIATE_MASK
23 set $flags = ((struct RBasic*)$arg0)->flags
24 if ($flags & RUBY_T_MASK) == RUBY_T_NONE
26 print (struct RBasic *)$arg0
28 if ($flags & RUBY_T_MASK) == RUBY_T_NIL
30 print (struct RBasic *)$arg0
32 if ($flags & RUBY_T_MASK) == RUBY_T_OBJECT
34 print (struct RObject *)$arg0
36 if ($flags & RUBY_T_MASK) == RUBY_T_CLASS
38 print (struct RClass *)$arg0
40 if ($flags & RUBY_T_MASK) == RUBY_T_ICLASS
42 print (struct RClass *)$arg0
44 if ($flags & RUBY_T_MASK) == RUBY_T_MODULE
46 print (struct RClass *)$arg0
48 if ($flags & RUBY_T_MASK) == RUBY_T_FLOAT
49 printf "T_FLOAT: %.16g ", (((struct RFloat*)$arg0)->float_value)
50 print (struct RFloat *)$arg0
52 if ($flags & RUBY_T_MASK) == RUBY_T_STRING
55 output (char *)(($flags & RUBY_FL_USER1) ? \
56 ((struct RString*)$arg0)->as.heap.ptr : \
57 ((struct RString*)$arg0)->as.ary)
59 printf " bytesize:%ld ", ($flags & RUBY_FL_USER1) ? \
60 ((struct RString*)$arg0)->as.heap.len : \
61 (($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
62 if !($flags & RUBY_FL_USER1)
65 if ($flags & RUBY_FL_USER2)
68 if ($flags & RUBY_FL_USER3)
72 printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
73 if ($flags & RUBY_ENC_CODERANGE_MASK) == 0
74 printf "coderange:unknown "
76 if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_7BIT
77 printf "coderange:7bit "
79 if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_VALID
80 printf "coderange:valid "
82 printf "coderange:broken "
86 print (struct RString *)$arg0
88 if ($flags & RUBY_T_MASK) == RUBY_T_REGEXP
91 output ((struct RRegexp*)$arg0)->str
93 printf " len:%ld ", ((struct RRegexp*)$arg0)->len
94 if $flags & RUBY_FL_USER6
97 if $flags & RUBY_FL_USER5
100 if $flags & RUBY_FL_USER4
103 printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
104 print (struct RRegexp *)$arg0
106 if ($flags & RUBY_T_MASK) == RUBY_T_ARRAY
107 printf "T_ARRAY: len=%ld ", ((struct RArray*)$arg0)->len
108 print (struct RArray *)$arg0
109 x/xw ((struct RArray*)$arg0)->ptr
111 if ($flags & RUBY_T_MASK) == RUBY_T_FIXNUM
113 print (struct RBasic *)$arg0
115 if ($flags & RUBY_T_MASK) == RUBY_T_HASH
117 if ((struct RHash *)$arg0)->ntbl
118 printf "len=%ld ", ((struct RHash *)$arg0)->ntbl->num_entries
120 print (struct RHash *)$arg0
122 if ($flags & RUBY_T_MASK) == RUBY_T_STRUCT
123 printf "T_STRUCT: len=%ld ", \
124 (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
125 ($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \
126 ((struct RStruct *)$arg0)->as.heap.len)
127 print (struct RStruct *)$arg0
128 x/xw (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
129 ((struct RStruct *)$arg0)->as.ary : \
130 ((struct RStruct *)$arg0)->as.heap.len)
132 if ($flags & RUBY_T_MASK) == RUBY_T_BIGNUM
133 printf "T_BIGNUM: sign=%d len=%ld ", \
134 (($flags & RUBY_FL_USER1) != 0), \
135 (($flags & RUBY_FL_USER2) ? \
136 ($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \
137 ((struct RBignum*)$arg0)->as.heap.len)
138 if $flags & RUBY_FL_USER2
141 print (struct RBignum *)$arg0
142 x/xw (($flags & RUBY_FL_USER2) ? \
143 ((struct RBignum*)$arg0)->as.ary : \
144 ((struct RBignum*)$arg0)->as.heap.digits)
146 if ($flags & RUBY_T_MASK) == RUBY_T_RATIONAL
147 printf "T_RATIONAL: "
148 print (struct RRational *)$arg0
150 if ($flags & RUBY_T_MASK) == RUBY_T_COMPLEX
152 print (struct RComplex *)$arg0
154 if ($flags & RUBY_T_MASK) == RUBY_T_FILE
156 print (struct RFile *)$arg0
157 output *((struct RFile *)$arg0)->fptr
160 if ($flags & RUBY_T_MASK) == RUBY_T_TRUE
162 print (struct RBasic *)$arg0
164 if ($flags & RUBY_T_MASK) == RUBY_T_FALSE
166 print (struct RBasic *)$arg0
168 if ($flags & RUBY_T_MASK) == RUBY_T_DATA
170 print (struct RData *)$arg0
172 if ($flags & RUBY_T_MASK) == RUBY_T_MATCH
174 print (struct RMatch *)$arg0
176 if ($flags & RUBY_T_MASK) == RUBY_T_SYMBOL
178 print (struct RBasic *)$arg0
180 if ($flags & RUBY_T_MASK) == RUBY_T_UNDEF
182 print (struct RBasic *)$arg0
184 if ($flags & RUBY_T_MASK) == RUBY_T_NODE
186 output (enum node_type)(($flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
191 print (struct RBasic *)$arg0
225 Print a Ruby's VALUE.
229 print (enum node_type)((((NODE*)$arg0)->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
232 Print a Ruby' node type.
236 print ((NODE*)$arg0)->nd_file
239 Print the source file name of a node.
243 print ((unsigned int)((((NODE*)$arg0)->flags>>RUBY_NODE_LSHIFT)&RUBY_NODE_LMASK))
246 Print the source line number of a node.
249 # Print members of ruby node.
511 call rb_id2name($arg0)
515 call classname($arg0)
517 print *(struct RClass*)$arg0