Actually,
gcc you called when you do compilation is just a driver for real compiler
cc1, assembler
as and linker
collect2. Use option
-v you can see the exact command sequence. For direct debugging you should run
gdb cc1. Refer to
gdb documentation on how to set break points, print the current call stack, and examine variable values. You can modify variable values and call program functions within the debugger, making it a good test environment for trying your coding ideas.
Gcc has helper functions for examining the gimple tree. See the Q&A on
examining an gimple node.