This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
We still have wrong file names in debug output (#line)
- To: Daniel Berlin <dan at cgsoftware dot com>,Mark Mitchell <mark at codesourcery dot com>
- Subject: We still have wrong file names in debug output (#line)
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Fri, 8 Jun 2001 20:42:30 +0100
- Cc: gcc-bugs at gcc dot gnu dot org
To see this
1) run gdb on "cc1" from a recent build of 3.0.
2) Put a breakpoint on start_function
3) do "set args test.c" where test.c is a file containing
int main ()
{
return 0;
}
4) Run, and when the breakpoint is hit, do "up".
You'll see something like:-
(gdb) up
#1 0x804a0b7 in yyparse_1 () at /usr/share/bison/bison.simple:316
The line number is correct, but the filename should be "c-parse.y",
as you can see from your copy of c-parse.y.
This is caused by a #line directive. What should #line do for debug
output? cb_file_change in c-lex.c does debug_start_source_file and
a debug_end_source_file for entering and leaving headers, but nothing
for a #line that changes the filename.
cb_file_change in c-lex.c needs to be changed as follows, but how?
if (fc->reason == FC_ENTER)
{
[....]
}
else if (fc->reason == FC_LEAVE)
{
[....]
}
+ else
+ debug_handle_#line_somehow ();
Neil.