diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-10-04 15:04:09 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-10-04 15:04:09 +0000 |
commit | 9e8a67206955a2aa97f77991358c009992b30a95 (patch) | |
tree | 84713ee9ee2363bfb664ffc3692e457e1493f1ed /gcc/fortran/parse.c | |
parent | 7dc83ebc4a15beeba41e01a0e1a9d3981bc6182c (diff) | |
download | gcc-9e8a67206955a2aa97f77991358c009992b30a95.zip gcc-9e8a67206955a2aa97f77991358c009992b30a95.tar.gz gcc-9e8a67206955a2aa97f77991358c009992b30a95.tar.bz2 |
re PR fortran/33502 (gfortran with .F suffix and -g3 option chokes on preprocessor syntax)
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.
From-SVN: r129011
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r-- | gcc/fortran/parse.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 86e486c..14acb86 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "gfortran.h" #include "match.h" #include "parse.h" +#include "debug.h" /* Current statement label. Zero means no statement label. Because new_st can get wiped during statement matching, we have to keep it separate. */ @@ -673,6 +674,9 @@ next_statement (void) break; } + if (gfc_define_undef_line ()) + continue; + st = (gfc_current_form == FORM_FIXED) ? next_fixed () : next_free (); if (st != ST_NONE) @@ -3270,6 +3274,11 @@ gfc_parse_file (void) gfc_statement st; locus prog_locus; + /* If the debugger wants the name of the main source file, + we give it. */ + if (debug_hooks->start_end_main_source_file) + (*debug_hooks->start_source_file) (0, gfc_source_file); + top.state = COMP_NONE; top.sym = NULL; top.previous = NULL; @@ -3380,6 +3389,9 @@ loop: goto loop; done: + if (debug_hooks->start_end_main_source_file) + (*debug_hooks->end_source_file) (0); + return SUCCESS; duplicate_main: |