gdb/fortran: better types for components of complex numbers
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sat, 16 Feb 2019 22:45:41 +0000 (22:45 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 30 Apr 2019 09:10:31 +0000 (10:10 +0100)
commit1db455a76c39e2be6a8a9613b7a19439f24722d0
tree80df9448123cfcc3c159f5e209c2ba94ddd805cc
parentb6d03bb2b65ac5c919f1d08674bbaa2a9bfb2d0c
gdb/fortran: better types for components of complex numbers

Currently when using $_creal and $_cimag to access the components of a
complex number the types of these components will have C type names
'float', 'double', etc.  This is because the components of a complex
number are not given type names in DWARF, so GDB has to pick some
suitable names, and currently we always use the C names.

This commit changes the type names used based on the language, so for
Fortran we will now use the Fortran float types, and so will get the
Fortran float type names 'real', 'real*8', etc.

gdb/ChangeLog:

* dwarf2read.c (dwarf2_init_complex_target_type): Use different
types for Fortran.

gdb/testsuite/ChangeLog:

* gdb.fortran/complex.exp: Expand.
* gdb.fortran/complex.f: Renamed to...
* gdb.fortran/complex.f90: ...this, and extended to add more
complex values.
gdb/ChangeLog
gdb/dwarf2read.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/complex.exp
gdb/testsuite/gdb.fortran/complex.f [deleted file]
gdb/testsuite/gdb.fortran/complex.f90 [new file with mode: 0644]