This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Patch for handling of DW_AT_byte_size in DW_TAG_string_type and a some FORTRAN support - committed
- From: Petr Sorfa <petrs at caldera dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 11 Jan 2002 12:06:47 -0500
- Subject: Patch for handling of DW_AT_byte_size in DW_TAG_string_type and a some FORTRAN support - committed
- Organization: Caldera
- Reply-to: petrs at caldera dot com
Hi,
Committed patch which I submitted in November:
This patch contains:
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.
Also added myself to the MAINTAINERS file.
Petr
*** ChangeLog 2002/01/11 10:46:14 1.2007
--- ChangeLog 2002/01/11 16:53:41
***************
*** 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
->
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.43
diff -c -r1.43 dwarf2read.c
*** dwarf2read.c 2002/01/11 09:32:50 1.43
--- dwarf2read.c 2002/01/11 16:53:42
***************
*** 2786,2797 ****
}
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);
die->type = type;
}
--- 2786,2815 ----
}
else
{
! /* 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);
! 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,3802 ****
--- 3815,3821 ----
break;
case DW_LANG_Fortran77:
case DW_LANG_Fortran90:
+ case DW_LANG_Fortran95:
cu_language = language_fortran;
break;
case DW_LANG_Mips_Assembler:
--
--------------------------------------------------------
Petr Sorfa Senior Software Engineer
Caldera
430 Mountain Ave. http://www.caldera.com
Murray Hill 07974
NJ, USA
--------------------------------------------------------
Disclaimer: All my comments are my own and nobody else's
----------------------------------------------------------