PR rtl-optimization/88470
[official-gcc.git] / gcc / gdbinit.in
bloba2d03e402447c4c2d82fc54a6cbb2a0de3f0279b
1 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 # This file is part of GCC.
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.
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.
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/>.
19 define pp
20 call debug ($)
21 end
23 document pp
24 Print a representation of the GCC data structure that is $.
25 Works only when an inferior is executing.
26 end
28 define pr
29 set debug_rtx ($)
30 end
32 document pr
33 Print the full structure of the rtx that is $.
34 Works only when an inferior is executing.
35 end
37 define prl
38 set debug_rtx_list ($, debug_rtx_count)
39 end
41 document prl
42 Print the full structure of all rtx insns beginning at $.
43 Works only when an inferior is executing.
44 Uses variable debug_rtx_count to control number of insns printed:
45   debug_rtx_count > 0: print from $ on.
46   debug_rtx_count < 0: print a window around $.
48 There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print
49 it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42)
50 end
52 define pt
53 set debug_tree ($)
54 end
56 document pt
57 Print the full structure of the tree that is $.
58 Works only when an inferior is executing.
59 end
61 define pct
62 set debug_c_tree ($)
63 end
65 document pct
66 Print the tree that is $ in C syntax.
67 Works only when an inferior is executing.
68 end
70 define pgg
71 set debug_gimple_stmt ($)
72 end
74 document pgg
75 Print the Gimple statement that is $ in C syntax.
76 Works only when an inferior is executing.
77 end
79 define pgq
80 set debug_gimple_seq ($)
81 end
83 document pgq
84 Print the Gimple sequence that is $ in C syntax.
85 Works only when an inferior is executing.
86 end
88 define pgs
89 set debug_generic_stmt ($)
90 end
92 document pgs
93 Print the statement that is $ in C syntax.
94 Works only when an inferior is executing.
95 end
97 define pge
98 set debug_generic_expr ($)
99 end
101 document pge
102 Print the expression that is $ in C syntax.
103 Works only when an inferior is executing.
106 define pmz
107 set mpz_out_str(stderr, 10, $)
110 document pmz
111 Print the mpz value that is $
112 Works only when an inferior is executing.
115 define ptc
116 output (enum tree_code) $.common.code
117 echo \n
120 document ptc
121 Print the tree-code of the tree node that is $.
124 define pdn
125 output $.decl_minimal.name->identifier.id.str
126 echo \n
129 document pdn
130 Print the name of the decl-node that is $.
133 define ptn
134 output $.type.name->decl_minimal.name->identifier.id.str
135 echo \n
138 document ptn
139 Print the name of the type-node that is $.
142 define pdd
143 set debug_dwarf_die ($)
146 document pdd
147 Print the dw_die_ref that is in $.
150 define prc
151 output (enum rtx_code) $.code
152 echo \ (
153 output $.mode
154 echo )\n
157 document prc
158 Print the rtx-code and machine mode of the rtx that is $.
161 define pi
162 print $.u.fld[0].rt_rtx@7
165 document pi
166 Print the fields of an instruction that is $.
169 define pbs
170 set print_binding_stack ()
173 document pbs
174 In cc1plus, print the current binding stack, frame by frame, up to and
175 including the global binding level.
178 define pbm
179 set bitmap_print (stderr, $, "", "\n")
182 document pbm
183 Dump the bitmap that is in $ as a comma-separated list of numbers.
186 define pel
187 output expand_location ($)
188 echo \n
191 document pel
192 Print expanded location of $.
195 define pcfun
196 output debug_function (cfun ? cfun->decl : current_function_decl, 0)
197 echo \n
200 document pcfun
201 Print current function.
204 define break-on-diagnostic
205 break diagnostic_show_locus
208 document break-on-diagnostic
209 Put a breakpoint on diagnostic_show_locus, called whenever a diagnostic
210 is emitted (as opposed to those warnings that are suppressed by
211 command-line options).
214 # Define some macros helpful to gdb when it is expanding macros.
215 macro define __FILE__ "gdb"
216 macro define __LINE__ 1
217 macro define __FUNCTION__ "gdb"
218 macro define __null 0
219 macro define input_line expand_location(input_location).line
220 macro define input_filename expand_location(input_location).file
222 # Gracefully handle aborts in functions used from gdb.
223 set unwindonsignal on
225 # Put breakpoints at exit and fancy_abort in case abort is mapped
226 # to either fprintf/exit or fancy_abort.
227 b fancy_abort
229 # Put a breakpoint on internal_error to help with debugging ICEs.
230 b internal_error
232 set complaints 0
233 # Don't let abort actually run, as it will make
234 # stdio stop working and therefore the `pr' command above as well.
235 # Put this last because gcc does not reference it any more unless
236 # USE_SYSTEM_ABORT is defined, so gdb may complain and bail out.
237 b exit
238 b abort
240 # Disable strict type checking.  This allows developers to (for example)
241 # make inferior calls without casting absolute address to a suitable
242 # pointer type.
243 set check type off
245 # Skip all inline functions in tree.h.
246 # These are used in accessor macros.
247 # Note that this is added at the end because older gdb versions
248 # do not understand the 'skip' command.
249 # See https://sourceware.org/gdb/current/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html
250 skip file tree.h
252 # Also skip inline functions in is-a.h.
253 skip file is-a.h
255 # And line-map.h.
256 skip file line-map.h
258 # And timevar.h.
259 skip file timevar.h
261 # Likewise, skip various inline functions in rtl.h.
262 skip rtx_expr_list::next
263 skip rtx_expr_list::element
264 skip rtx_insn_list::next
265 skip rtx_insn_list::insn
266 skip rtx_sequence::len
267 skip rtx_sequence::element
268 skip rtx_sequence::insn
269 skip INSN_UID
270 skip PREV_INSN
271 skip SET_PREV_INSN
272 skip NEXT_INSN
273 skip SET_NEXT_INSN
274 skip BLOCK_FOR_INSN
275 skip PATTERN
276 skip INSN_LOCATION
277 skip INSN_HAS_LOCATION
278 skip JUMP_LABEL_AS_INSN