diff options
author | Tom Tromey <tromey@redhat.com> | 2011-06-29 15:32:40 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-06-29 15:32:40 +0000 |
commit | 3b2b8feaf4aaa62c7d55ad845c3ff34165a3af22 (patch) | |
tree | 05f9c11e7c9408d89574648e7b0b2a9c0aec63a7 /gdb/dwarf2read.c | |
parent | 168e6d44026869c1cd8dd66d7ef7cdeecdcff77d (diff) | |
download | gdb-3b2b8feaf4aaa62c7d55ad845c3ff34165a3af22.zip gdb-3b2b8feaf4aaa62c7d55ad845c3ff34165a3af22.tar.gz gdb-3b2b8feaf4aaa62c7d55ad845c3ff34165a3af22.tar.bz2 |
gdb
PR fortran/10036:
* valprint.h (generic_emit_char, generic_printstr): Declare.
* valprint.c (wchar_printable, append_string_as_wide)
(print_wchar): Move from c-lang.c.
(generic_emit_char): New function; mostly taken from c_emit_char.
(generic_printstr): New function; mostly taken from c_printstr.
* f-valprint.c (f_val_print) <TYPE_CODE_ARRAY>: Handle strings
represented as arrays.
<TYPE_CODE_CHAR>: Treat as TYPE_CODE_INT; recognize as character
type.
* f-typeprint.c (f_type_print_base) <TYPE_CODE_CHAR>: Treat
identically to TYPE_CODE_INT.
* f-lang.c (f_get_encoding): New function.
(f_emit_char): Use generic_emit_char.
(f_printchar): Replace comment.
(f_printstr): Use generic_printstr.
* dwarf2read.c (read_base_type) <DW_ATE_unsigned>: Handle Fortran
"character" types specially.
<DW_ATE_signed_char, DW_ATE_unsigned_char>: Make TYPE_CODE_CHAR
for Fortran.
* c-lang.c (wchar_printable, append_string_as_wide, print_wchar):
Move to valprint.c
(c_emit_char): Call generic_emit_char.
(c_printstr): Call generic_printstr.
gdb/testsuite
* gdb.fortran/charset.exp: New file.
* gdb.fortran/charset.f90: New file.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index cfe0514..bc958bb 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8335,15 +8335,21 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) break; case DW_ATE_unsigned: type_flags |= TYPE_FLAG_UNSIGNED; + if (cu->language == language_fortran + && name + && strncmp (name, "character(", sizeof ("character(") - 1) == 0) + code = TYPE_CODE_CHAR; break; case DW_ATE_signed_char: if (cu->language == language_ada || cu->language == language_m2 - || cu->language == language_pascal) + || cu->language == language_pascal + || cu->language == language_fortran) code = TYPE_CODE_CHAR; break; case DW_ATE_unsigned_char: if (cu->language == language_ada || cu->language == language_m2 - || cu->language == language_pascal) + || cu->language == language_pascal + || cu->language == language_fortran) code = TYPE_CODE_CHAR; type_flags |= TYPE_FLAG_UNSIGNED; break; |