Update change log
[platform/upstream/gcc48.git] / gcc / gdbinit.in
1 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2 #
3 # This file is part of GCC.
4 #
5 # GCC is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
8 # any later version.
9 #
10 # GCC is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with GCC; see the file COPYING3.  If not see
17 # <http://www.gnu.org/licenses/>.
18
19 define pr
20 set debug_rtx ($)
21 end
22
23 document pr
24 Print the full structure of the rtx that is $.
25 Works only when an inferior is executing.
26 end
27
28 define prl
29 set debug_rtx_list ($, debug_rtx_count)
30 end
31
32 document prl
33 Print the full structure of all rtx insns beginning at $.
34 Works only when an inferior is executing.
35 Uses variable debug_rtx_count to control number of insns printed:
36   debug_rtx_count > 0: print from $ on.
37   debug_rtx_count < 0: print a window around $.
38
39 There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print
40 it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42)
41 end
42
43 define pt
44 set debug_tree ($)
45 end
46
47 document pt
48 Print the full structure of the tree that is $.
49 Works only when an inferior is executing.
50 end
51
52 define pct
53 set debug_c_tree ($)
54 end
55
56 document pct
57 Print the tree that is $ in C syntax.
58 Works only when an inferior is executing.
59 end
60
61 define pgg
62 set debug_gimple_stmt ($)
63 end
64
65 document pgg
66 Print the Gimple statement that is $ in C syntax.
67 Works only when an inferior is executing.
68 end
69
70 define pgq
71 set debug_gimple_seq ($)
72 end
73
74 document pgq
75 Print the Gimple sequence that is $ in C syntax.
76 Works only when an inferior is executing.
77 end
78
79 define pgs
80 set debug_generic_stmt ($)
81 end
82
83 document pgs
84 Print the statement that is $ in C syntax.
85 Works only when an inferior is executing.
86 end
87
88 define pge
89 set debug_generic_expr ($)
90 end
91
92 document pge
93 Print the expression that is $ in C syntax.
94 Works only when an inferior is executing.
95 end
96
97 define ptc
98 output (enum tree_code) $.common.code
99 echo \n
100 end
101
102 document ptc
103 Print the tree-code of the tree node that is $.
104 end
105
106 define pdn
107 output $.decl_minimal.name->identifier.id.str
108 echo \n
109 end
110
111 document pdn
112 Print the name of the decl-node that is $.
113 end
114
115 define ptn
116 output $.type.name->decl_minimal.name->identifier.id.str
117 echo \n
118 end
119
120 document ptn
121 Print the name of the type-node that is $.
122 end
123
124 define pvt
125 set debug_vec_tree ($)
126 end
127
128 document pvt
129 Print the VEC(tree) that is in $.
130 end
131
132 define pdd
133 set debug_dwarf_die ($)
134 end
135
136 document pdd
137 Print the dw_die_ref that is in $.
138 end
139
140 define prc
141 output (enum rtx_code) $.code
142 echo \ (
143 output $.mode
144 echo )\n
145 end
146
147 document prc
148 Print the rtx-code and machine mode of the rtx that is $.
149 end
150
151 define pi
152 print $.u.fld[0].rt_rtx@7
153 end
154
155 document pi
156 Print the fields of an instruction that is $.
157 end
158
159 define pbs
160 set print_binding_stack ()
161 end
162
163 document pbs
164 In cc1plus, print the current binding stack, frame by frame, up to and
165 including the global binding level.
166 end
167
168 define pbb
169 set dump_bb ($, stderr, 0)
170 end
171
172 document pbb
173 Dump the basic block that is in $, including rtx.
174 end
175
176 define pbm
177 set bitmap_print (stderr, $, "", "\n")
178 end
179
180 document pbm
181 Dump the bitmap that is in $ as a comma-separated list of numbers.
182 end
183
184 # Define some macros helpful to gdb when it is expanding macros.
185 macro define __FILE__ "gdb"
186 macro define __LINE__ 1
187
188 # Gracefully handle aborts in functions used from gdb.
189 set unwindonsignal on
190
191 # Put breakpoints at exit and fancy_abort in case abort is mapped
192 # to either fprintf/exit or fancy_abort.
193 b fancy_abort
194
195 # Put a breakpoint on internal_error to help with debugging ICEs.
196 b internal_error
197
198 set complaints 0
199 # Don't let abort actually run, as it will make
200 # stdio stop working and therefore the `pr' command above as well.
201 # Put this last because gcc does not reference it any more unless
202 # USE_SYSTEM_ABORT is defined, so gdb may complain and bail out.
203 b exit
204 b abort
205
206 # Skip all inline functions in tree.h.
207 # These are used in accessor macros.
208 # Note that this is added at the end because older gdb versions
209 # do not understand the 'skip' command.
210 skip file tree.h