From: Jim Wilson Date: Thu, 18 Jun 1998 18:19:08 +0000 (+0000) Subject: Fix cygwin32 hosted dwarf2 target problem with line number info. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=243e7835fb7d2015eee565f70b17c2fdb238cdab;p=gcc.git Fix cygwin32 hosted dwarf2 target problem with line number info. * dwarf2out.c (size_of_string): Do count backslashes. From-SVN: r20562 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a170d27ac49..3263bc0b1e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Thu Jun 18 18:16:01 1998 Jim Wilson + + * dwarf2out.c (size_of_string): Do count backslashes. + Thu Jun 18 11:43:54 1998 Nick Clifton * config/arm/thumb.h (GO_IF_LEGITIMATE_ADDRESS): Disallow REG+REG diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 6d6a502c4e4..39ad8a663d8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -4451,29 +4451,18 @@ build_abbrev_table (die) build_abbrev_table (c); } -/* Return the size of a string, including the null byte. */ +/* Return the size of a string, including the null byte. + + This used to treat backslashes as escapes, and hence they were not included + in the count. However, that conflicts with what ASM_OUTPUT_ASCII does, + which treats a backslash as a backslash, escaping it if necessary, and hence + we must include them in the count. */ static unsigned long size_of_string (str) register char *str; { - register unsigned long size = 0; - register unsigned long slen = strlen (str); - register unsigned long i; - register unsigned c; - - for (i = 0; i < slen; ++i) - { - c = str[i]; - if (c == '\\') - ++i; - - size += 1; - } - - /* Null terminator. */ - size += 1; - return size; + return strlen (str) + 1; } /* Return the size of a location descriptor. */