diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-01-18 11:24:24 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-03-06 18:11:31 +0000 |
commit | 4a270568d93263e4970099456b4efb58466134a6 (patch) | |
tree | 826ed6321c654560d167c5cf693f1c22bc9ea1da /gdb/f-lang.c | |
parent | 067630bdb553bb889104e3b064e4551531ddcedc (diff) | |
download | gdb-4a270568d93263e4970099456b4efb58466134a6.zip gdb-4a270568d93263e4970099456b4efb58466134a6.tar.gz gdb-4a270568d93263e4970099456b4efb58466134a6.tar.bz2 |
gdb/fortran: Use TYPE_CODE_CHAR for character types
Switch to using TYPE_CODE_CHAR for character types. This appears to
have little impact on the test results as gFortran uses the
DW_TAG_string_type to represent all character variables (as far as I
can see). The only place this has an impact is when the user casts a
variable to a character type, in which case GDB does now use the CHAR
type, and prints the variable as both a value and a character, for
example, before:
(gdb) p ((character) 97)
$1 = 97
and after:
(gdb) p ((character) 97)
$1 = 97 'a'
gdb/ChangeLog:
* f-lang.c (build_fortran_types): Use TYPE_CODE_CHAR for character
types.
gdb/testsuite/ChangeLog:
* gdb.fortran/type-kinds.exp: Update expected results.
Diffstat (limited to 'gdb/f-lang.c')
-rw-r--r-- | gdb/f-lang.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/f-lang.c b/gdb/f-lang.c index f27eb0d..c329d60 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -366,7 +366,7 @@ build_fortran_types (struct gdbarch *gdbarch) = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "VOID"); builtin_f_type->builtin_character - = arch_integer_type (gdbarch, TARGET_CHAR_BIT, 0, "character"); + = arch_type (gdbarch, TYPE_CODE_CHAR, TARGET_CHAR_BIT, "character"); builtin_f_type->builtin_logical_s1 = arch_boolean_type (gdbarch, TARGET_CHAR_BIT, 1, "logical*1"); |