gdb tips

-v -save-temps

Cut and paste program name to gdb command line. Cut and paste args to gdb "set args".

Print functions

debug_rtx_list,
debug_rtx_list,
debug_tree

cfun

This structure holds information about the current function, in particular the name. Use it when setting conditional breakpoints. eg.

(gdb) condition 4 strcmp (cfun->name, "fix_alignment") == 0

A slightly more complex example.

(gdb) condition 5 strcmp (cfun->name, "fix_alignment") == 0 && insn->code == INSN && insn->fld[0].rtint == 22

cont