]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/gdbinit.in
print-tree.h (debug_vec_tree): Remove prototype.
[thirdparty/gcc.git] / gcc / gdbinit.in
CommitLineData
cbe34bb5 1# Copyright (C) 2001-2017 Free Software Foundation, Inc.
ad41bd84
JM
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
861bb6c1
JL
19define pr
20set debug_rtx ($)
21end
22
23document pr
24Print the full structure of the rtx that is $.
25Works only when an inferior is executing.
26end
27
28define prl
29set debug_rtx_list ($, debug_rtx_count)
30end
31
32document prl
33Print the full structure of all rtx insns beginning at $.
34Works only when an inferior is executing.
35Uses 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
39There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print
40it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42)
41end
42
43define pt
44set debug_tree ($)
45end
46
47document pt
48Print the full structure of the tree that is $.
49Works only when an inferior is executing.
50end
51
b9d8832d
JM
52define pct
53set debug_c_tree ($)
54end
55
56document pct
57Print the tree that is $ in C syntax.
58Works only when an inferior is executing.
59end
60
f8bf9252
SP
61define pgg
62set debug_gimple_stmt ($)
63end
64
65document pgg
66Print the Gimple statement that is $ in C syntax.
67Works only when an inferior is executing.
68end
69
6e7e763e
JM
70define pgq
71set debug_gimple_seq ($)
72end
73
74document pgq
75Print the Gimple sequence that is $ in C syntax.
76Works only when an inferior is executing.
77end
78
6de9cd9a
DN
79define pgs
80set debug_generic_stmt ($)
81end
82
83document pgs
84Print the statement that is $ in C syntax.
85Works only when an inferior is executing.
86end
87
88define pge
89set debug_generic_expr ($)
90end
91
92document pge
93Print the expression that is $ in C syntax.
94Works only when an inferior is executing.
95end
96
605be31e
MS
97define pmz
98set mpz_out_str(stderr, 10, $)
99end
100
101document pmz
102Print the mpz value that is $
103Works only when an inferior is executing.
104end
105
861bb6c1
JL
106define ptc
107output (enum tree_code) $.common.code
108echo \n
109end
110
111document ptc
112Print the tree-code of the tree node that is $.
113end
114
115define pdn
9391bc0d 116output $.decl_minimal.name->identifier.id.str
861bb6c1
JL
117echo \n
118end
119
120document pdn
121Print the name of the decl-node that is $.
122end
123
124define ptn
9391bc0d 125output $.type.name->decl_minimal.name->identifier.id.str
861bb6c1
JL
126echo \n
127end
128
129document ptn
130Print the name of the type-node that is $.
131end
132
b042534c
JM
133define pdd
134set debug_dwarf_die ($)
135end
136
137document pdd
138Print the dw_die_ref that is in $.
139end
140
861bb6c1
JL
141define prc
142output (enum rtx_code) $.code
143echo \ (
144output $.mode
145echo )\n
146end
147
148document prc
149Print the rtx-code and machine mode of the rtx that is $.
150end
151
152define pi
e0d9dfa2 153print $.u.fld[0].rt_rtx@7
861bb6c1
JL
154end
155
156document pi
157Print the fields of an instruction that is $.
158end
159
160define pbs
161set print_binding_stack ()
162end
163
164document pbs
165In cc1plus, print the current binding stack, frame by frame, up to and
166including the global binding level.
167end
168
55a9c4b2 169define pbb
984d07dd 170set debug ($)
55a9c4b2
HPN
171end
172
173document pbb
174Dump the basic block that is in $, including rtx.
175end
176
177define pbm
178set bitmap_print (stderr, $, "", "\n")
179end
180
181document pbm
182Dump the bitmap that is in $ as a comma-separated list of numbers.
183end
184
71e55f04
MP
185define pel
186output expand_location ($)
187echo \n
188end
189
190document pel
191Print expanded location of $.
192end
193
2e1a9cdb
MP
194define pcfun
195output debug_function (cfun ? cfun->decl : current_function_decl, 0)
196echo \n
197end
198
199document pcfun
200Print current function.
201end
202
6e72eb34
DM
203define break-on-diagnostic
204break diagnostic_show_locus
205end
206
207document break-on-diagnostic
208Put a breakpoint on diagnostic_show_locus, called whenever a diagnostic
209is emitted (as opposed to those warnings that are suppressed by
210command-line options).
211end
212
0823efed
DN
213# Define some macros helpful to gdb when it is expanding macros.
214macro define __FILE__ "gdb"
215macro define __LINE__ 1
b57ca59b 216macro define __FUNCTION__ "gdb"
0bfdb81e 217macro define __null 0
2a0da5ad
JM
218macro define input_line expand_location(input_location).line
219macro define input_filename expand_location(input_location).file
0823efed
DN
220
221# Gracefully handle aborts in functions used from gdb.
222set unwindonsignal on
223
22c4957e
MM
224# Put breakpoints at exit and fancy_abort in case abort is mapped
225# to either fprintf/exit or fancy_abort.
22c4957e
MM
226b fancy_abort
227
c9092111
BE
228# Put a breakpoint on internal_error to help with debugging ICEs.
229b internal_error
230
3a7f50dc 231set complaints 0
b14a4f5a
AS
232# Don't let abort actually run, as it will make
233# stdio stop working and therefore the `pr' command above as well.
234# Put this last because gcc does not reference it any more unless
235# USE_SYSTEM_ABORT is defined, so gdb may complain and bail out.
3aed1981 236b exit
b14a4f5a 237b abort
0823efed 238
2a936959
JL
239# Disable strict type checking. This allows developers to (for example)
240# make inferior calls without casting absolute address to a suitable
241# pointer type.
242set check type off
243
0823efed
DN
244# Skip all inline functions in tree.h.
245# These are used in accessor macros.
246# Note that this is added at the end because older gdb versions
247# do not understand the 'skip' command.
08216dfb 248# See https://sourceware.org/gdb/current/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html
865ea646 249skip file tree.h
08216dfb 250
e6e860a2
JM
251# Also skip inline functions in is-a.h.
252skip file is-a.h
253
0d1892d2
JM
254# And line-map.h.
255skip file line-map.h
256
e1d74c91
JM
257# And timevar.h.
258skip file timevar.h
259
08216dfb
DM
260# Likewise, skip various inline functions in rtl.h.
261skip rtx_expr_list::next
262skip rtx_expr_list::element
263skip rtx_insn_list::next
264skip rtx_insn_list::insn
265skip rtx_sequence::len
266skip rtx_sequence::element
267skip rtx_sequence::insn
268skip INSN_UID
269skip PREV_INSN
270skip SET_PREV_INSN
271skip NEXT_INSN
272skip SET_NEXT_INSN
273skip BLOCK_FOR_INSN
274skip PATTERN
275skip INSN_LOCATION
276skip INSN_HAS_LOCATION
277skip JUMP_LABEL_AS_INSN