diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-02-26 11:14:24 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-03-09 09:51:23 +0000 |
commit | eef32f59988bb0e4514d5395093c9e6d8d073ebb (patch) | |
tree | df32c5ce71179b0e9d405c10b6c0704443ee1cb1 /gdb/f-exp.y | |
parent | 7ba155b37073a3512c85f1d7f12dbaed9a6db3e2 (diff) | |
download | binutils-gdb-eef32f59988bb0e4514d5395093c9e6d8d073ebb.tar.gz |
gdb/fotran: add support for the 'shape' keyword
Add support for the SHAPE keyword to GDB's Fortran expression parser.
gdb/ChangeLog:
* f-exp.h (eval_op_f_array_shape): Declare.
(fortran_array_shape_operation): New type.
* f-exp.y (exp): Handle UNOP_FORTRAN_SHAPE after parsing
UNOP_INTRINSIC.
(f77_keywords): Add "shape" keyword.
* f-lang.c (fortran_array_shape): New function.
(eval_op_f_array_shape): New function.
* std-operator.def (UNOP_FORTRAN_SHAPE): New operator.
gdb/testsuite/ChangeLog:
* gdb.fortran/shape.exp: New file.
* gdb.fortran/shape.f90: New file.
Diffstat (limited to 'gdb/f-exp.y')
-rw-r--r-- | gdb/f-exp.y | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/f-exp.y b/gdb/f-exp.y index e652bd96d74..dcc28b8e600 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -330,6 +330,9 @@ exp : UNOP_INTRINSIC '(' exp ')' case UNOP_FORTRAN_RANK: pstate->wrap<fortran_rank_operation> (); break; + case UNOP_FORTRAN_SHAPE: + pstate->wrap<fortran_array_shape_operation> (); + break; default: gdb_assert_not_reached ("unhandled intrinsic"); } @@ -1151,6 +1154,7 @@ static const struct token f77_keywords[] = { "associated", UNOP_OR_BINOP_INTRINSIC, FORTRAN_ASSOCIATED, false }, { "rank", UNOP_INTRINSIC, UNOP_FORTRAN_RANK, false }, { "size", UNOP_OR_BINOP_INTRINSIC, FORTRAN_ARRAY_SIZE, false }, + { "shape", UNOP_INTRINSIC, UNOP_FORTRAN_SHAPE, false }, }; /* Implementation of a dynamically expandable buffer for processing input |