gdb/fortran: Add support for the ABS intrinsic function
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 18 Jan 2019 14:44:48 +0000 (14:44 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 6 Mar 2019 18:11:31 +0000 (18:11 +0000)
commit0841c79a3dc1cfa382164a6bb2c1ee41af3ab0a9
tree91f447c2bbfe0f87c46e7a42205ca8d63ca86ec8
parent4a270568d93263e4970099456b4efb58466134a6
gdb/fortran: Add support for the ABS intrinsic function

Adds support for the abs intrinsic function, this requires adding a
new pattern to the Fortran parser.  Currently only float and integer
argument types are supported to ABS, complex is still not supported,
this can be added later if needed.

gdb/ChangeLog:

* f-exp.y: New token, UNOP_INTRINSIC.
(exp): New pattern using UNOP_INTRINSIC token.
(f77_keywords): Add 'abs' keyword.
* f-lang.c: Add 'target-float.h' and 'math.h' includes.
(value_from_host_double): New function.
(evaluate_subexp_f): Support UNOP_ABS.

gdb/testsuite/ChangeLog:

* gdb.fortran/intrinsics.exp: Extend to cover ABS.
gdb/ChangeLog
gdb/f-exp.y
gdb/f-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/intrinsics.exp