1define pr
2set debug_rtx ($)
3end
4
5document pr
6Print the full structure of the rtx that is $.
7Works only when an inferior is executing.
8end
9
10define prl
11set debug_rtx_list ($, debug_rtx_count)
12end
13
14document prl
15Print the full structure of all rtx insns beginning at $.
16Works only when an inferior is executing.
17Uses variable debug_rtx_count to control number of insns printed:
18  debug_rtx_count > 0: print from $ on.
19  debug_rtx_count < 0: print a window around $.
20
21There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print
22it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42)
23end
24
25define pt
26set debug_tree ($)
27end
28
29document pt
30Print the full structure of the tree that is $.
31Works only when an inferior is executing.
32end
33
34define pct
35set debug_c_tree ($)
36end
37
38document pct
39Print the tree that is $ in C syntax.
40Works only when an inferior is executing.
41end
42
43define pgs
44set debug_generic_stmt ($)
45end
46
47document pgs
48Print the statement that is $ in C syntax.
49Works only when an inferior is executing.
50end
51
52define pge
53set debug_generic_expr ($)
54end
55
56document pge
57Print the expression that is $ in C syntax.
58Works only when an inferior is executing.
59end
60
61define ptc
62output (enum tree_code) $.common.code
63echo \n
64end
65
66document ptc
67Print the tree-code of the tree node that is $.
68end
69
70define pdn
71output $.decl_minimal.name->identifier.id.str
72echo \n
73end
74
75document pdn
76Print the name of the decl-node that is $.
77end
78
79define ptn
80output $.type.name->decl_minimal.name->identifier.id.str
81echo \n
82end
83
84document ptn
85Print the name of the type-node that is $.
86end
87
88define prc
89output (enum rtx_code) $.code
90echo \ (
91output $.mode
92echo )\n
93end
94
95document prc
96Print the rtx-code and machine mode of the rtx that is $.
97end
98
99define pi
100print $.u.fld[0].rt_rtx@7
101end
102
103document pi
104Print the fields of an instruction that is $.
105end
106
107define pbs
108set print_binding_stack ()
109end
110
111document pbs
112In cc1plus, print the current binding stack, frame by frame, up to and
113including the global binding level.
114end
115
116define pbb
117set dump_bb ($, stderr, 0)
118end
119
120document pbb
121Dump the basic block that is in $, including rtx.
122end
123
124define pbm
125set bitmap_print (stderr, $, "", "\n")
126end
127
128document pbm
129Dump the bitmap that is in $ as a comma-separated list of numbers.
130end
131
132# Put breakpoints at exit and fancy_abort in case abort is mapped
133# to either fprintf/exit or fancy_abort.
134b fancy_abort
135
136# Put a breakpoint on internal_error to help with debugging ICEs.
137b internal_error
138
139# Make gdb complain about symbol reading errors.  This is so that gcc
140# developers can see and fix bugs in gcc debug output.
141set complaints 20
142
143# Don't let abort actually run, as it will make
144# stdio stop working and therefore the `pr' command above as well.
145# Put this last because gcc does not reference it any more unless
146# USE_SYSTEM_ABORT is defined, so gdb may complain and bail out.
147b exit
148b abort
149