Article View: gnu.gcc.help
Article #53460GCC 1.40/mips/#line
From: George V. Reilly
Date: Tue, 19 Nov 1991 05:22
Date: Tue, 19 Nov 1991 05:22
33 lines
1988 bytes
1988 bytes
[I mailed this to bug-gcc@prep.ai.mit.edu a week ago, but never
saw it appear on the gnu.gcc.bug newsgroup]
GCC 1.40 on DECstations doesn't handle generated C files correctly
(it doesn't do the right thing with #line's), and debuggers get
confused, looking at the generated C code, instead of the original
source. GCC 1.40 running on Sparcstations, on the other hand,
works correctly.
The problem is that the .file directive at the beginning of the
asm file emitted by GCC points to the generated C file instead
of the original file specifed in a #line directive.
For example, given /tmp/foo.c, which looks like
#line 1 "/u/gvr/foo.c"
/* code */
the first line of foo.s will be
.file "/tmp/foo.c"
As /tmp/foo.c is generated on the fly and removed after compilation,
this is a problem for debugging.
The following extract from compile_file() in toplev.c indicates that
GCC is trying to do the right thing, but failing:
/* the beginning of the file is a new line; check for # */
/* With luck, we discover the real source file's name from that
and put it in input_filename. */
ungetc (check_newline (), finput);
GCC 1.40 on Sparcstations doesn't issue an initial directive corresponding
to .file, so it doesn't screw up.
________________
George V. Reilly `At the end of my #line' gvr@cs.brown.edu +1 (401) 863-7693
uunet!brunix!gvr gvr@browncs.bitnet Box 1910, Brown U, Prov, RI 02912
Technical Details
Message-ID:
<GVR.91Nov19002256@miles.cs.brown.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!brunix!doorknob!gvrShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,840c6595e072901e,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1991-11-19 02:53:02 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!brunix!doorknob!gvr From: gvr@miles.cs.brown.edu (George V. Reilly) Newsgroups: gnu.gcc.help Subject: GCC 1.40/mips/#line Message-ID: <GVR.91Nov19002256@miles.cs.brown.edu> Date: 19 Nov 91 05:22:56 GMT Sender: news@brunix.UUCP Distribution: gnu Organization: Brown Computer Graphics Group, Providence, Rhode Island, USA Lines: 33