This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Debugging a port
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Russell Shaw <rjshaw at netspace dot net dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 07 Dec 2004 16:08:49 +0000
- Subject: Re: Debugging a port
- Organization: Codesourcery LLC
- References: <41B5D3C0.5040508@netspace.net.au>
Russell Shaw wrote:
Hi,
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.
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?
What I do for code generation bugs is examine the -d dumps to determine
which phase has done the invalid transform, and what that transform started
with. Then in GDB set a breakpoint in the instruction generator function
to trap when the illformed insn is created. then run the program. When
the break point is hit, set some watch points to catch when the insn is being
manipulated. Then continue. Everytime the watchpoints trigger, work
out whether this is the location of the bad transform
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk