[fortran,patch] Fix PR 33739, emitting calls to debug_hooks->end_source_file
FX Coudert
fxcoudert@gmail.com
Sat Nov 3 23:02:00 GMT 2007
Attached patch fixes PR 33739, a debug-info problem which is only
seen with stabs and the darwin 64-bit linker, but is nonetheless an
issue in the front-end. Each time we enter an included source file,
we emit a call to debug_hooks->start_source_file; we call debug_hooks-
>end_source_file when returning to the original file; my recent
patch to scanner.c made sure of that.
Unfortunately, there is one situation that was not yet addressed.
When the inclusion line is the last line of the outer file, like this:
> $ cat b.F
> print *, 42
> #include "b.inc"
> $ cat b.inc
> end
In that case, the problem is that when we come into gfc_advance_line,
it's too late; and during parsing, it's too early to emit calls to
the debug_hooks functions. But it happens to be simple: I added
functions to keep track of files entered and exited, so be able to
emit exit calls for each remaining file when we reach the end of the
main source file.
Regtested on x86_64-linux with dwarf and stabs, and regtested on
powerpc-apple-darwin8 (stabs) with -m32 and -m64. OK to commit?
FX
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr33739.ChangeLog
Type: application/octet-stream
Size: 196 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071103/08b7a2f4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr33739.diff
Type: application/octet-stream
Size: 2319 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071103/08b7a2f4/attachment-0001.obj>
More information about the Fortran
mailing list