From 874a8709bf8077e0347180eba67c73b0661ba9fd Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Fri, 14 Nov 1997 16:07:17 +0000 Subject: [PATCH] dwarfout.c (byte_size_attribute): Add local var upper_bound and add case to handle STRING_TYPE. * dwarfout.c (byte_size_attribute): Add local var upper_bound and add case to handle STRING_TYPE. * dwarfout.c (output_string_type_die): Fix code to generate correct string length attribute for fixed length strings. Still needs support for varying length strings. From-SVN: r16498 --- gcc/ChangeLog | 8 ++++++++ gcc/dwarfout.c | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5a948803ed1..150e720fb58 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Fri Nov 14 09:09:20 1997 Fred Fish (fnf@cygnus.com) + + * dwarfout.c (byte_size_attribute): Add local var upper_bound + and add case to handle STRING_TYPE. + * dwarfout.c (output_string_type_die): Fix code to generate + correct string length attribute for fixed length strings. + Still needs support for varying length strings. + Fri Nov 14 08:46:56 1997 Jeffrey A Law (law@cygnus.com) * toplev.c (get_run_time): Do something sensible for cygwin32. diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index 2e108dc0410..21f78b5661f 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -2653,6 +2653,17 @@ byte_size_attribute (tree_node) / BITS_PER_UNIT; break; + /* This goes with the hack for case ARRAY_TYPE in output_type() since + the Chill front end represents strings using ARRAY_TYPE. */ + case ARRAY_TYPE: + { + /* The lower bound is zero, so the length is the upper bound + 1. */ + register tree upper_bound; + upper_bound = TYPE_MAX_VALUE (TYPE_DOMAIN (tree_node)); + size = (unsigned) TREE_INT_CST_LOW (upper_bound) + 1; + break; + } + default: abort (); } @@ -3705,11 +3716,10 @@ output_string_type_die (arg) ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_string_type); sibling_attribute (); + equate_type_number_to_die_number (type); member_attribute (TYPE_CONTEXT (type)); - - /* Fudge the string length attribute for now. */ - - string_length_attribute (TYPE_MAX_VALUE (TYPE_DOMAIN (type))); + /* this is a fixed length string */ + byte_size_attribute (type); } static void -- 2.30.2