1# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2# 2008, 2010 Free Software Foundation, Inc. 3# 4# This file is part of GCC. 5# 6# GCC is free software; you can redistribute it and/or modify 7# it under the terms of the GNU General Public License as published by 8# the Free Software Foundation; either version 3, or (at your option) 9# any later version. 10# 11# GCC is distributed in the hope that it will be useful, 12# but WITHOUT ANY WARRANTY; without even the implied warranty of 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14# GNU General Public License for more details. 15# 16# You should have received a copy of the GNU General Public License 17# along with GCC; see the file COPYING3. If not see 18# <http://www.gnu.org/licenses/>. 19 20define pr 21set debug_rtx ($) 22end 23 24document pr 25Print the full structure of the rtx that is $. 26Works only when an inferior is executing. 27end 28 29define prl 30set debug_rtx_list ($, debug_rtx_count) 31end 32 33document prl 34Print the full structure of all rtx insns beginning at $. 35Works only when an inferior is executing. 36Uses variable debug_rtx_count to control number of insns printed: 37 debug_rtx_count > 0: print from $ on. 38 debug_rtx_count < 0: print a window around $. 39 40There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print 41it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42) 42end 43 44define pt 45set debug_tree ($) 46end 47 48document pt 49Print the full structure of the tree that is $. 50Works only when an inferior is executing. 51end 52 53define pct 54set debug_c_tree ($) 55end 56 57document pct 58Print the tree that is $ in C syntax. 59Works only when an inferior is executing. 60end 61 62define pgg 63set debug_gimple_stmt ($) 64end 65 66document pgg 67Print the Gimple statement that is $ in C syntax. 68Works only when an inferior is executing. 69end 70 71define pgq 72set debug_gimple_seq ($) 73end 74 75document pgq 76Print the Gimple sequence that is $ in C syntax. 77Works only when an inferior is executing. 78end 79 80define pgs 81set debug_generic_stmt ($) 82end 83 84document pgs 85Print the statement that is $ in C syntax. 86Works only when an inferior is executing. 87end 88 89define pge 90set debug_generic_expr ($) 91end 92 93document pge 94Print the expression that is $ in C syntax. 95Works only when an inferior is executing. 96end 97 98define ptc 99output (enum tree_code) $.common.code 100echo \n 101end 102 103document ptc 104Print the tree-code of the tree node that is $. 105end 106 107define pdn 108output $.decl_minimal.name->identifier.id.str 109echo \n 110end 111 112document pdn 113Print the name of the decl-node that is $. 114end 115 116define ptn 117output $.type.name->decl_minimal.name->identifier.id.str 118echo \n 119end 120 121document ptn 122Print the name of the type-node that is $. 123end 124 125define pvt 126set debug_vec_tree ($) 127end 128 129document pvt 130Print the VEC(tree) that is in $. 131end 132 133define pdd 134set debug_dwarf_die ($) 135end 136 137document pdd 138Print the dw_die_ref that is in $. 139end 140 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 153print $.u.fld[0].rt_rtx@7 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 169define pbb 170set dump_bb ($, stderr, 0) 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 185# Put breakpoints at exit and fancy_abort in case abort is mapped 186# to either fprintf/exit or fancy_abort. 187b fancy_abort 188 189# Put a breakpoint on internal_error to help with debugging ICEs. 190b internal_error 191 192set complaints 0 193# Don't let abort actually run, as it will make 194# stdio stop working and therefore the `pr' command above as well. 195# Put this last because gcc does not reference it any more unless 196# USE_SYSTEM_ABORT is defined, so gdb may complain and bail out. 197b exit 198b abort 199