aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-09-22 15:03:24 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-09-22 15:03:24 +0000
commita3b2d4e56c6086a6af1aae2ef3a540171609e153 (patch)
tree2389a4ad99837b8fe86ec6a45f7d52d1eb8796e8 /gcc/fortran/parse.c
parent9fa6cfec03275391d93cf67e1691f11c053f1220 (diff)
downloadgcc-a3b2d4e56c6086a6af1aae2ef3a540171609e153.zip
gcc-a3b2d4e56c6086a6af1aae2ef3a540171609e153.tar.gz
gcc-a3b2d4e56c6086a6af1aae2ef3a540171609e153.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->start_source_file and debug_hooks->end_source_file when entering and exiting included files. (gfc_define_undef_line): New function. (load_file): Ignore #define and #undef preprocessor lines while reading source files. * parse.c (next_statement): Handle #define and #undef preprocessor lines. (gfc_parse_file): Call debug_hooks->start_source_file and debug_hooks->end_source_file for the main source file if requested by the debug format. * gfortran.h (gfc_define_undef_line): Add prototype. From-SVN: r128671
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index a6672f4..9fd4375 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)
@@ -3219,6 +3223,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;
@@ -3329,6 +3338,9 @@ loop:
goto loop;
done:
+ if (debug_hooks->start_end_main_source_file)
+ (*debug_hooks->end_source_file) (0);
+
return SUCCESS;
duplicate_main: