aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:30 -0700
commiteb4c927182a8c935960e8c70a2c2d3ab2c49e21f (patch)
tree559bbbc177cabb279f79de32a17d493f3990b008 /gdb/f-lang.c
parent58a76c72648ce1e70bbba8320547a5c4353c48a3 (diff)
downloadgdb-eb4c927182a8c935960e8c70a2c2d3ab2c49e21f.zip
gdb-eb4c927182a8c935960e8c70a2c2d3ab2c49e21f.tar.gz
gdb-eb4c927182a8c935960e8c70a2c2d3ab2c49e21f.tar.bz2
Implement Fortran associated operations
This implements the Fortran 1- and 2-argument "associated" operations. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * f-lang.c (eval_op_f_associated): New functions. * f-exp.h (fortran_associated_1arg, fortran_associated_2arg): New typedefs.
Diffstat (limited to 'gdb/f-lang.c')
-rw-r--r--gdb/f-lang.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index dcd7c48..1a49b6b 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -995,6 +995,26 @@ fortran_associated (struct gdbarch *gdbarch, const language_defn *lang,
return value_from_longest (result_type, is_associated ? 1 : 0);
}
+struct value *
+eval_op_f_associated (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside,
+ enum exp_opcode opcode,
+ struct value *arg1)
+{
+ return fortran_associated (exp->gdbarch, exp->language_defn, arg1);
+}
+
+struct value *
+eval_op_f_associated (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside,
+ enum exp_opcode opcode,
+ struct value *arg1,
+ struct value *arg2)
+{
+ return fortran_associated (exp->gdbarch, exp->language_defn, arg1, arg2);
+}
/* A helper function for UNOP_ABS. */