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 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 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 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 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 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 97define ptc 98output (enum tree_code) $.common.code 99echo \n 100end 101 102document ptc 103Print the tree-code of the tree node that is $. 104end 105 106define pdn 107output $.decl_minimal.name->identifier.id.str 108echo \n 109end 110 111document pdn 112Print the name of the decl-node that is $. 113end 114 115define ptn 116output $.type.name->decl_minimal.name->identifier.id.str 117echo \n 118end 119 120document ptn 121Print the name of the type-node that is $. 122end 123 124define pvt 125set debug_vec_tree ($) 126end 127 128document pvt 129Print the VEC(tree) that is in $. 130end 131 132define pdd 133set debug_dwarf_die ($) 134end 135 136document pdd 137Print the dw_die_ref that is in $. 138end 139 140define prc 141output (enum rtx_code) $.code 142echo \ ( 143output $.mode 144echo )\n 145end 146 147document prc 148Print the rtx-code and machine mode of the rtx that is $. 149end 150 151define pi 152print $.u.fld[0].rt_rtx@7 153end 154 155document pi 156Print the fields of an instruction that is $. 157end 158 159define pbs 160set print_binding_stack () 161end 162 163document pbs 164In cc1plus, print the current binding stack, frame by frame, up to and 165including the global binding level. 166end 167 168define pbb 169set dump_bb ($, stderr, 0) 170end 171 172document pbb 173Dump the basic block that is in $, including rtx. 174end 175 176define pbm 177set bitmap_print (stderr, $, "", "\n") 178end 179 180document pbm 181Dump the bitmap that is in $ as a comma-separated list of numbers. 182end 183 184# Define some macros helpful to gdb when it is expanding macros. 185macro define __FILE__ "gdb" 186macro define __LINE__ 1 187 188# Gracefully handle aborts in functions used from gdb. 189set unwindonsignal on 190 191# Put breakpoints at exit and fancy_abort in case abort is mapped 192# to either fprintf/exit or fancy_abort. 193b fancy_abort 194 195# Put a breakpoint on internal_error to help with debugging ICEs. 196b internal_error 197 198set 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. 203b exit 204b 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. 210skip file tree.h 211