This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Major debugging breakage


law@redhat.com wrote:-

> Line number tracking is currently hosed in a big way in GCC.  This makes
> debugging multi-line statements a real PITA.

[...]

>         .PROC
>         .CALLINFO FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
>         .ENTRY
>         stw %r2,-20(%r30)
>         copy %r3,%r1
>         copy %r30,%r3
>         stwm %r1,64(%r30)
>         stw %r26,-36(%r3)
>         stw %r25,-40(%r3)
>         stw %r24,-44(%r3)
>         stw %r23,-48(%r3)
>         .stabn 68,0,11,L$M5-foo
> 
> Note carefully that we've used line #11 in that .stabn statement.  The
> correct value should be 8.
> 
> Similar problems happen for multi-line "while" conditional, and probably
> lots of other stuff.
> 
> I don't have the foggest idea how the line number tracking code works, but
> I do know it's broken.

Something has been hosed with line numbers for a long time; Geoff
seemed to think he knew what it was.  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
constructive.

I can try and trace your example through GCC, but I have much less
time for GCC than I used to (baby...).  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.

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]