This is the mail archive of the
mailing list for the GCC project.
Re: Major debugging breakage
- From: law at redhat dot com
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Cc: gcc at gcc dot gnu dot org, geoffk at redhat dot com
- Date: Thu, 03 Jan 2002 14:03:11 -0700
- Subject: Re: Major debugging breakage
- Reply-to: law at redhat dot com
> Something has been hosed with line numbers for a long time; Geoff
> seemed to think he knew what it was.
Yea, it was broken before gcc-3.0, so it's been awhile. I've cc'd Geoff
directly in the hopes that he'll chime in.
> I do know that what CPP tells
> the front end is definitely correct; so something, from
> cb_file_change() in c-lex.c down to the guts of GCC, is not using
> "lineno" correctly or getting mucked up for some reason. Sadly, my
> knowledge of such parts of GCC is not good enough to suggest anything
Every time we parse a token we update LINENO to be equal to SRC_LINENO
(c_lex.c). LINENO is used to initialize the line numbers in NOTEs
that are used by the debug symbol routines. The comments in cb_line_change
seem to indicate that SRC_LINENO is meant to be used for diagnostic
line numbers. Maybe that is the root of our problem -- mixing the two
SRC_LINENO is updated at the start of every non-empty line via cb_line_change.
> I can try and trace your example through GCC, but I have much less
> time for GCC than I used to (baby...).
I understand. I'll understand even more in a few months.
> There are still a couple of
> outstanding CPP things that need to be done (Cygwin mmap and the
> driver external CPP thing that I've not got round to) which I'd rather
> do first, seeing as how this line number thing has been around for
> ages, and others with better understanding than me have not been able
> to find it when they gave it a (quick?) go.
The Cygwin mmap issues are pretty serious too, so attacking that problem
makes a lot of sense. I'd like to see the debug problems solved before
the driver external CPP thingie, but that's just my preference.