gdb/fortran: add support for RANK keyword
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 25 Feb 2021 11:41:57 +0000 (11:41 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 9 Mar 2021 09:45:18 +0000 (09:45 +0000)
commite14816a8ba5ecf8d7c0125a08afe87fb7d1a6bba
tree718883b66af773f86fc1ef753db65f8e33456f1c
parent742732c7f0a989eaba7c1acac3ca5eeaa274df0e
gdb/fortran: add support for RANK keyword

gfortran supports the RANK keyword, see:

  https://gcc.gnu.org/onlinedocs/gfortran/RANK.html#RANK

this commit adds support for this keyword to GDB's Fortran expression
parser.

gdb/ChangeLog:

* f-exp.h (eval_op_f_rank): Declare.
(expr::fortran_rank_operation): New typedef.
* f-exp.y (exp): Handle UNOP_FORTRAN_RANK after parsing an
UNOP_INTRINSIC.
(f77_keywords): Add "rank" keyword.
* f-lang.c (eval_op_f_rank): New function.
* std-operator.def (UNOP_FORTRAN_RANK): New operator.

gdb/testsuite/ChangeLog:

* gdb.fortran/rank.exp: New file.
* gdb.fortran/rank.f90: New file.
gdb/ChangeLog
gdb/f-exp.h
gdb/f-exp.y
gdb/f-lang.c
gdb/std-operator.def
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/rank.exp [new file with mode: 0644]
gdb/testsuite/gdb.fortran/rank.f90 [new file with mode: 0644]