dykstra@CS.UIUC.EDU (David Dykstra) (08/17/89)
I have a problem with the COFF line number information output by gcc. I've narrowed down to a portion of the compiler source in version 1.35.96. I'm compiling on a Multimax and the target is i386v. My problem is that gcc will not output the '.ln' line-number info when I use the -g option. The problem (at least part of it) is in final.c, function output_source_line(). Nothing gets output because 'filename' never equals 'main_input_filename'. I'm using cfront (AT&T's C++). The first thing that cfront outputs is a #line 1 "sourcename.c" where sourcename.c is the orignal name, not the name that gcc sees as it's filename. There's a comment in toplev.c where it calls check_newline() that says it's trying to read the correct file name from the first #line statement. check_newline() (in c-parse.y) does read something but for some reason it's getting the real filename, not the line from the #line statement. I haven't figured out why. It then sets main_input_filename to the real filename. In any event, I disagree with the check in final.c altogether. AT&T's cc compiler on my 80386-based PC output's line number information for anything in that file, even if the source is from something that is #included. I think the line && !strcmp (filename, main_input_filename) in output_source_line() should just be removed. - Dave Dykstra dykstra@cs.uiuc.edu