]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/gdbinit.in
[arm] Fix testsuite nit when compiling for thumb2
[thirdparty/gcc.git] / gcc / gdbinit.in
CommitLineData
fbd26352 1# Copyright (C) 2001-2019 Free Software Foundation, Inc.
7dfbd804 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
8541a54a 19define pp
20call debug ($)
21end
22
23document pp
24Print a representation of the GCC data structure that is $.
25Works only when an inferior is executing.
26end
27
071cd279 28define pr
29set debug_rtx ($)
30end
31
32document pr
33Print the full structure of the rtx that is $.
34Works only when an inferior is executing.
35end
36
37define prl
38set debug_rtx_list ($, debug_rtx_count)
39end
40
41document prl
42Print the full structure of all rtx insns beginning at $.
43Works only when an inferior is executing.
44Uses 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 $.
47
48There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print
49it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42)
50end
51
52define pt
53set debug_tree ($)
54end
55
56document pt
57Print the full structure of the tree that is $.
58Works only when an inferior is executing.
59end
60
00ae6be7 61define pct
62set debug_c_tree ($)
63end
64
65document pct
66Print the tree that is $ in C syntax.
67Works only when an inferior is executing.
68end
69
255b6be7 70define pgg
71set debug_gimple_stmt ($)
72end
73
74document pgg
75Print the Gimple statement that is $ in C syntax.
76Works only when an inferior is executing.
77end
78
88cba5b1 79define pgq
80set debug_gimple_seq ($)
81end
82
83document pgq
84Print the Gimple sequence that is $ in C syntax.
85Works only when an inferior is executing.
86end
87
4ee9c684 88define pgs
89set debug_generic_stmt ($)
90end
91
92document pgs
93Print the statement that is $ in C syntax.
94Works only when an inferior is executing.
95end
96
97define pge
98set debug_generic_expr ($)
99end
100
101document pge
102Print the expression that is $ in C syntax.
103Works only when an inferior is executing.
104end
105
69c149d1 106define pmz
107set mpz_out_str(stderr, 10, $)
108end
109
110document pmz
111Print the mpz value that is $
112Works only when an inferior is executing.
113end
114
071cd279 115define ptc
fde0870e 116output (enum tree_code) $.base.code
071cd279 117echo \n
118end
119
120document ptc
121Print the tree-code of the tree node that is $.
122end
123
124define pdn
36eec8e7 125output $.decl_minimal.name->identifier.id.str
071cd279 126echo \n
127end
128
129document pdn
130Print the name of the decl-node that is $.
131end
132
133define ptn
36eec8e7 134output $.type.name->decl_minimal.name->identifier.id.str
071cd279 135echo \n
136end
137
138document ptn
139Print the name of the type-node that is $.
140end
141
8ee76a8d 142define pdd
143set debug_dwarf_die ($)
144end
145
146document pdd
147Print the dw_die_ref that is in $.
148end
149
071cd279 150define prc
151output (enum rtx_code) $.code
152echo \ (
153output $.mode
154echo )\n
155end
156
157document prc
158Print the rtx-code and machine mode of the rtx that is $.
159end
160
161define pi
48bdfbc8 162print $.u.fld[0].rt_rtx@7
071cd279 163end
164
165document pi
166Print the fields of an instruction that is $.
167end
168
169define pbs
170set print_binding_stack ()
171end
172
173document pbs
174In cc1plus, print the current binding stack, frame by frame, up to and
175including the global binding level.
176end
177
aaa59797 178define pbm
179set bitmap_print (stderr, $, "", "\n")
180end
181
182document pbm
183Dump the bitmap that is in $ as a comma-separated list of numbers.
184end
185
b174be60 186define pel
187output expand_location ($)
188echo \n
189end
190
191document pel
192Print expanded location of $.
193end
194
645cec52 195define pcfun
196output debug_function (cfun ? cfun->decl : current_function_decl, 0)
197echo \n
198end
199
200document pcfun
201Print current function.
202end
203
fde0870e 204define trt
205print ($.typed.type)
206end
207
208document trt
209Print TREE_TYPE of the tree node that is $
210end
211
7a59a4e4 212define break-on-diagnostic
213break diagnostic_show_locus
214end
215
216document break-on-diagnostic
217Put a breakpoint on diagnostic_show_locus, called whenever a diagnostic
218is emitted (as opposed to those warnings that are suppressed by
219command-line options).
220end
221
33b02ab7 222define reload-gdbhooks
223python import imp; imp.reload(gdbhooks)
224end
225
226document reload-gdbhooks
227Load the gdbhooks.py module again in order to pick up any changes made to it.
228end
229
230alias rh = reload-gdbhooks
231
2b15d2ba 232# Define some macros helpful to gdb when it is expanding macros.
233macro define __FILE__ "gdb"
234macro define __LINE__ 1
910d871e 235macro define __FUNCTION__ "gdb"
832f4182 236macro define __null 0
12a7d3be 237macro define input_line expand_location(input_location).line
238macro define input_filename expand_location(input_location).file
2b15d2ba 239
af7bbac6 240# Remember previous pagination status and turn it off, so that
241# the messages for skip commands don't require pagination.
242python __gcc_prev_pagination=gdb.parameter("pagination")
243set pagination off
244
2b15d2ba 245# Gracefully handle aborts in functions used from gdb.
246set unwindonsignal on
247
97fce000 248# Put breakpoints at exit and fancy_abort in case abort is mapped
249# to either fprintf/exit or fancy_abort.
97fce000 250b fancy_abort
251
0fb7aaf2 252# Put a breakpoint on internal_error to help with debugging ICEs.
253b internal_error
254
979f9661 255set complaints 0
3bdfaae6 256# Don't let abort actually run, as it will make
257# stdio stop working and therefore the `pr' command above as well.
258# Put this last because gcc does not reference it any more unless
259# USE_SYSTEM_ABORT is defined, so gdb may complain and bail out.
d62e1a3b 260b exit
3bdfaae6 261b abort
2b15d2ba 262
5bbb7526 263# Disable strict type checking. This allows developers to (for example)
264# make inferior calls without casting absolute address to a suitable
265# pointer type.
266set check type off
267
2b15d2ba 268# Skip all inline functions in tree.h.
269# These are used in accessor macros.
270# Note that this is added at the end because older gdb versions
271# do not understand the 'skip' command.
3e76fcb4 272# See https://sourceware.org/gdb/current/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html
b41251d4 273skip file tree.h
3e76fcb4 274
cc1e50b1 275# Also skip inline functions in is-a.h.
276skip file is-a.h
277
fc3cb33e 278# And line-map.h.
279skip file line-map.h
280
970969cd 281# And timevar.h.
282skip file timevar.h
283
3e76fcb4 284# Likewise, skip various inline functions in rtl.h.
285skip rtx_expr_list::next
286skip rtx_expr_list::element
287skip rtx_insn_list::next
288skip rtx_insn_list::insn
289skip rtx_sequence::len
290skip rtx_sequence::element
291skip rtx_sequence::insn
292skip INSN_UID
293skip PREV_INSN
294skip SET_PREV_INSN
295skip NEXT_INSN
296skip SET_NEXT_INSN
297skip BLOCK_FOR_INSN
298skip PATTERN
299skip INSN_LOCATION
300skip INSN_HAS_LOCATION
301skip JUMP_LABEL_AS_INSN
af7bbac6 302
303# Restore pagination to the previous state.
304python if __gcc_prev_pagination: gdb.execute("set pagination on")