This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[fortran,patch] Fix PR 33739, emitting calls to debug_hooks->end_source_file


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

Attachment: pr33739.ChangeLog
Description: Binary data

Attachment: pr33739.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]