This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Debugging a port
- From: Peter Barada <peter at the-baradas dot com>
- To: rjshaw at netspace dot net dot au
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 7 Dec 2004 11:24:33 -0500 (EST)
- Subject: Re: Debugging a port
- References: <41B5D3C0.5040508@netspace.net.au>
>I'm trying to locate a bug in code generated by the avr port of gcc.
>
>I've looked thru all the files in gcc-3.4.3/gcc/config/avr and
>have read the gcc internals manual and a few others off the web.
What's the offending code? Do you have a *simple* testcase?
>Dumps at various compilation phases can be done with the -d switch,
>but i was wondering if a more interactive approach could be used
>with gdb. Where is a good place to put gdb breakpoints in the gcc
>source? What other useful methods of debugging in gcc are there?
Where you place a breakpoint depends on what part of gcc is causing
the bad code. First you need to identify at what pass the bad code
gets generated. Start with the assembler output from a minimal
testcase that is generated with '-dp -fverbose-asm' and find the
offending code (and its RTL). Then after running the compiler with
'-da' to create all the dump files, start from the highest numbered
dump and look at each one toward the lowest dump to find where the bad
code/rtl is generated. Then you can start looking at the particular
pass that generates the first occurance of the offending code to
decide where to put a breakpoint.
--
Peter Barada
peter@the-baradas.com