gdb/fortran: add support for ASSOCIATED builtin
This commit adds support for the ASSOCIATED builtin to the Fortran
expression evaluator. The ASSOCIATED builtin takes one or two
arguments.
When passed a single pointer argument GDB returns a boolean indicating
if the pointer is associated with anything.
When passed two arguments the second argument should either be some a
pointer could point at or a second pointer.
If the second argument is a pointer target, then the result from
associated indicates if the pointer is pointing at this target.
If the second argument is another pointer, then the result from
associated indicates if the two pointers are pointing at the same
thing.
gdb/ChangeLog:
* f-exp.y (f77_keywords): Add 'associated'.
* f-lang.c (fortran_associated): New function.
(evaluate_subexp_f): Handle FORTRAN_ASSOCIATED.
(operator_length_f): Likewise.
(print_unop_or_binop_subexp_f): New function.
(print_subexp_f): Make use of print_unop_or_binop_subexp_f for
FORTRAN_ASSOCIATED, FORTRAN_LBOUND, and FORTRAN_UBOUND.
(dump_subexp_body_f): Handle FORTRAN_ASSOCIATED.
(operator_check_f): Likewise.
* std-operator.def: Add FORTRAN_ASSOCIATED.
gdb/testsuite/ChangeLog:
* gdb.fortran/associated.exp: New file.
* gdb.fortran/associated.f90: New file.