1define pr 2set debug_rtx ($) 3end 4 5document pr 6Print the full structure of the rtx that is $. 7Works only when an inferior is executing. 8end 9 10define prl 11set debug_rtx_list ($, debug_rtx_count) 12end 13 14document prl 15Print the full structure of all rtx insns beginning at $. 16Works only when an inferior is executing. 17Uses variable debug_rtx_count to control number of insns printed: 18 debug_rtx_count > 0: print from $ on. 19 debug_rtx_count < 0: print a window around $. 20 21There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print 22it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42) 23end 24 25define pt 26set debug_tree ($) 27end 28 29document pt 30Print the full structure of the tree that is $. 31Works only when an inferior is executing. 32end 33 34define ptc 35output (enum tree_code) $.common.code 36echo \n 37end 38 39document ptc 40Print the tree-code of the tree node that is $. 41end 42 43define pdn 44output $.decl.name->identifier.pointer 45echo \n 46end 47 48document pdn 49Print the name of the decl-node that is $. 50end 51 52define ptn 53output $.type.name->decl.name->identifier.pointer 54echo \n 55end 56 57document ptn 58Print the name of the type-node that is $. 59end 60 61define prc 62output (enum rtx_code) $.code 63echo \ ( 64output $.mode 65echo )\n 66end 67 68document prc 69Print the rtx-code and machine mode of the rtx that is $. 70end 71 72define pi 73print $.fld[0].rtx@7 74end 75 76document pi 77Print the fields of an instruction that is $. 78end 79 80define pbs 81set print_binding_stack () 82end 83 84document pbs 85In cc1plus, print the current binding stack, frame by frame, up to and 86including the global binding level. 87end 88 89# Put breakpoints at exit and fancy_abort in case abort is mapped 90# to either fprintf/exit or fancy_abort. 91b exit 92b fancy_abort 93 94# Make gdb complain about symbol reading errors. This is so that gcc 95# developers can see and fix bugs in gcc debug output. 96set complaints 20 97 98# Don't let abort actually run, as it will make 99# stdio stop working and therefore the `pr' command above as well. 100# Put this last because gcc does not reference it any more unless 101# USE_SYSTEM_ABORT is defined, so gdb may complain and bail out. 102b abort 103