------- Comment #8 from dominiq at lps dot ens dot fr 2007-10-25 16:59 -------
I have reverted revision 129011:
+2007-10-04 Francois-Xavier Coudert <[EMAIL PROTECTED]>
+
+ PR fortran/33502
+ * scanner.c (gfc_advance_line): Call debug_hooks->end_source_file
+ and debug_hooks->start_source_file when appropriate, and set
+ dbg_emitted.
+ (gfc_define_undef_line): New function.
+ (load_file): Don't error out on #define and #undef lines.
+ * parse.c (next_statement): Call gfc_define_undef_line.
+ (gfc_parse_file): Call debug_hooks->start_source_file and
+ debug_hooks->end_source_file for the main source file if
+ required.
+ * gfortran.h (gfc_linebuf): Add dbg_emitted field.
+ (gfc_define_undef_line): New prototype.
+
and the failures disappeared. I do not understand the logic of
+ if (gfc_current_locus.lb->next
+ && gfc_current_locus.lb->next->file != gfc_current_locus.lb->file)
+ {
+ if (gfc_current_locus.lb->next->file
+ && !gfc_current_locus.lb->next->dbg_emitted
+ && gfc_current_locus.lb->file->up ==
gfc_current_locus.lb->next->file)
+ {
+ /* We exit from an included file. */
+ (*debug_hooks->end_source_file)
+ (gfc_linebuf_linenum (gfc_current_locus.lb->next));
+ gfc_current_locus.lb->next->dbg_emitted = true;
+ }
+ else if (gfc_current_locus.lb->next->file != gfc_current_locus.lb->file
+ && !gfc_current_locus.lb->next->dbg_emitted)
+ {
+ /* We enter into a new file. */
+ (*debug_hooks->start_source_file)
+ (gfc_linebuf_linenum (gfc_current_locus.lb),
+ gfc_current_locus.lb->next->file->filename);
+ gfc_current_locus.lb->next->dbg_emitted = true;
+ }
+ }
+
If I understand it, if gfc_current_locus.lb->next->dbg_emitted is false, it is
set to true for both entering a new file and leaving an included file. With the
current scheme I don't see how the latter case can be reached.
--
dominiq at lps dot ens dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33739