aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-01-16 16:16:59 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-03-06 18:11:31 +0000
commit9dad4a58a1bddeb1cc2ec8b3782d7463b03b7b4b (patch)
treea58d6c8c8aa45f0354de9372683c1256774709d4
parentc8f9160408315deceee5e8776f0b1c4d9cba4398 (diff)
downloadgdb-9dad4a58a1bddeb1cc2ec8b3782d7463b03b7b4b.zip
gdb-9dad4a58a1bddeb1cc2ec8b3782d7463b03b7b4b.tar.gz
gdb-9dad4a58a1bddeb1cc2ec8b3782d7463b03b7b4b.tar.bz2
gdb/fortran: Add new function to evaluate Fortran expressions
This is an initial restructure, it adds a new function in which Fortran specific expressions can be evaluated. No Fortran specific expressions are added with this commit though, so for now, the new function just forwards all expressions to the default expression handler, as such, there should be no user visible changes after this commit. However, the new function will be useful in later commits. gdb/ChangeLog: * f-lang.c (evaluate_subexp_f): New function. (exp_descriptor_f): New global. (f_language_defn): Use exp_descriptor_f instead of exp_descriptor_standard.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/f-lang.c22
2 files changed, 28 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 61c5663..a632de6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
+ * f-lang.c (evaluate_subexp_f): New function.
+ (exp_descriptor_f): New global.
+ (f_language_defn): Use exp_descriptor_f instead of
+ exp_descriptor_standard.
+
+2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
+
* f-exp.y (struct token): Add comments.
(dot_ops): Remove uppercase versions and the end marker.
(f77_keywords): Likewise.
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 6eb9b23..5beb46c 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -239,6 +239,15 @@ f_collect_symbol_completion_matches (completion_tracker &tracker,
text, word, ":", code);
}
+/* Special expression evaluation cases for Fortran. */
+struct value *
+evaluate_subexp_f (struct type *expect_type, struct expression *exp,
+ int *pos, enum noside noside)
+{
+ /* Currently no special handling is required. */
+ return evaluate_subexp_standard (expect_type, exp, pos, noside);
+}
+
static const char *f_extensions[] =
{
".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP",
@@ -246,6 +255,17 @@ static const char *f_extensions[] =
NULL
};
+/* Expression processing for Fortran. */
+static const struct exp_descriptor exp_descriptor_f =
+{
+ print_subexp_standard,
+ operator_length_standard,
+ operator_check_standard,
+ op_name_standard,
+ dump_subexp_body_standard,
+ evaluate_subexp_f
+};
+
extern const struct language_defn f_language_defn =
{
"fortran",
@@ -256,7 +276,7 @@ extern const struct language_defn f_language_defn =
array_column_major,
macro_expansion_no,
f_extensions,
- &exp_descriptor_standard,
+ &exp_descriptor_f,
f_parse, /* parser */
null_post_parser,
f_printchar, /* Print character constant */