Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 106 lines (104 sloc) 1.94 kB
2dbde57 @Watson1978 add GDB trick
Watson1978 authored
1 define rp
2 set $types = rb_type($arg0)
3
4 if $types == 0x01
5 # RUBY_T_OBJECT
6 p "T_OBJECT:"
7 p (struct RBasic *)($arg0)
8 else
9 if $types == 0x02
10 # RUBY_T_CLASS
11 p "T_CLASS:"
12 p (struct RBasic *)($arg0)
13 else
14 if $types == 0x03
15 # RUBY_T_MODULE
16 p "T_MODULE:"
17 p (struct RBasic *)($arg0)
18 else
19 if $types == 0x04
20 # RUBY_T_FLOAT
21 p "T_FLOAT:"
22 p coerce_ptr_to_double($arg0)
23 else
24 if $types == 0x05
25 # RUBY_T_STRING
26 p "T_STRING:"
27 p *(struct RString *)($arg0)
28 else
29 if $types == 0x06
30 # RUBY_T_REGEXP
31 p "T_REGEXP:"
32 p *(struct rb_regexp *)($arg0)
33 else
34 if $types == 0x07
35 # RUBY_T_ARRAY
36 p "T_ARRAY:"
37 p *(struct RArray *)($arg0)
38 else
39 if $types == 0x08
40 # RUBY_T_HASH
41 p "T_HASH:"
42 p *(struct RHash *)($arg0)
43 else
44 if $types == 0x09
45 # RUBY_T_STRUCT
46 p "T_STRUCT:"
47 p *(struct RStruct *)($arg0)
48 else
49 if $types == 0x0a
50 # RUBY_T_BIGNUM
51 p "T_BIGNUM:"
52 p *(struct RBignum *)($arg0)
53 else
54 if $types == 0x0b
55 # RUBY_T_FILE
56 p "T_FILE:"
57 p *(struct RFile *)($arg0)
58 p *((struct RFile *)($arg0))->fptr
59 else
60 if $types == 0x0c
61 # RUBY_T_DATA
62 p "T_DATA:"
63 p *(struct RData *)($arg0)
64 else
65 if $types == 0x0d
66 # RUBY_T_MATCH
67 p "T_MATCH:"
68 p *(struct rb_match *)($arg0)
69 else
70 if $types == 0x0e
71 # RUBY_T_COMPLEX
72 p "T_COMPLEX:"
73 p *(struct RComplex *)($arg0)
74 else
75 if $types == 0x0f
76 # RUBY_T_RATIONAL
77 p "T_RATIONAL:"
78 p *(struct RRational *)($arg0)
79 else
80 if $types == 0x11
81 # RUBY_T_NIL
82 p "T_NIL:"
83 p "nil"
84 else
85 if $types == 0x12
86 # RUBY_T_TRUE
87 p "T_TRUE:"
88 p "true"
89 else
90 if $types == 0x14
91 # RUBY_T_SYMBOL
92 p "T_SYMBOL:"
93 p *(struct rb_sym_t *)($arg0)
94 else
95 if $types == 0x15
96 # RUBY_T_FIXNUM
97 p "T_FIXNUM:"
98 p rb_num2int($arg0)
99 end
100 if $types == 0x1b
101 # RUBY_T_UNDEF
102 p "T_UNDEF:"
103 p "undef"
104 end
105
106 end
Something went wrong with that request. Please try again.