This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Still a problem with debug output, with functions with #line in the middle, on mainline
On Wed, Jan 30, 2002 at 04:31:47PM -0500, Daniel Berlin wrote:
>
> It never sees a file change for the first file.
You're right, but your patch is not sufficient to fix the bug. With
it added, I still get
main:
.LFB1:
.file 2 "bar.c"
.loc 2 1 0
pushl %ebp
That .file/.loc pair is being emitted based on the value of
input_filename at the *end* of the function. (Note it gets the line
number right.) What's actually needed is an addition to Jason
Merrill's patch to handle a file change in the middle of the function.
This works for me. It's rather similar to what was proposed back in
http://gcc.gnu.org/ml/gcc/2001-12/msg00166.html...
zw
===================================================================
Index: c-decl.c
--- c-decl.c 2002/01/29 17:19:55 1.291
+++ c-decl.c 2002/01/30 22:24:31
@@ -7009,6 +7009,7 @@ c_expand_body (fndecl, nested_p, can_def
/* Initialize the RTL code for the function. */
current_function_decl = fndecl;
+ input_filename = DECL_SOURCE_FILE (fndecl);
init_function_start (fndecl, input_filename, DECL_SOURCE_LINE (fndecl));
/* This function is being processed in whole-function mode. */