summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPetr Sorfa <petrs@caldera.com>2002-01-11 16:56:04 +0000
committerPetr Sorfa <petrs@caldera.com>2002-01-11 16:56:04 +0000
commit2bf2479438c7e9e1ecd9f41e17df148aa6509397 (patch)
treeecd1534eaa99c5344fb207d325bb9098e3f55e40 /gdb
parentdd96ac5fbb7fcd8a2ab4180e49284c1f027e5087 (diff)
downloadgdb-2bf2479438c7e9e1ecd9f41e17df148aa6509397.tar.gz
1) Handling of the DW_AT_byte_size attribute when processing a
DW_TAG_string_type (this is acceptable under the current DWARF 2.1/3.0 standard.) 2) In read_tag_string_type(), a fix for FORTRAN that propagates the first string length to all string types. This is important as FORTRAN strings are not delimited as in C/C++. 3) Handling of the DW_LANG_Fortran95.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/dwarf2read.c25
2 files changed, 31 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3d1d2fac069..b8ba9a48827 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2002-01-11 Petr Sorfa <petrs@caldera.com>
+
+ * MAINTAINERS (write-after-approval): Add myself.
+ * dwarf2read.c (read_tag_string_type): Handling of
+ DW_AT_byte_size.
+ (read_tag_string_type): FORTRAN fix to prevent propagation of
+ first string size.
+ (set_cu_language): Handling of DW_LANG_Fortran95
+
2002-01-11 Richard Earnshaw <rearnsha@arm.com>
* armnbsd-nat.c (fetch_inferior_registers): Change inferior_pid ->
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 28317f2e7b8..785acc24ca7 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2786,12 +2786,30 @@ read_tag_string_type (struct die_info *die, struct objfile *objfile)
}
else
{
- length = 1;
+ /* check for the DW_AT_byte_size attribute */
+ attr = dwarf_attr (die, DW_AT_byte_size);
+ if (attr)
+ {
+ length = DW_UNSND (attr);
+ }
+ else
+ {
+ length = 1;
+ }
}
index_type = dwarf2_fundamental_type (objfile, FT_INTEGER);
range_type = create_range_type (NULL, index_type, 1, length);
- char_type = dwarf2_fundamental_type (objfile, FT_CHAR);
- type = create_string_type (char_type, range_type);
+ if (cu_language == language_fortran)
+ {
+ /* Need to create a unique string type for bounds
+ information */
+ type = create_string_type (0, range_type);
+ }
+ else
+ {
+ char_type = dwarf2_fundamental_type (objfile, FT_CHAR);
+ type = create_string_type (char_type, range_type);
+ }
die->type = type;
}
@@ -3797,6 +3815,7 @@ set_cu_language (unsigned int lang)
break;
case DW_LANG_Fortran77:
case DW_LANG_Fortran90:
+ case DW_LANG_Fortran95:
cu_language = language_fortran;
break;
case DW_LANG_Mips_Assembler: