diff options
author | Jim Wilson <wilson@cygnus.com> | 1998-06-18 18:19:08 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1998-06-18 11:19:08 -0700 |
commit | 243e7835fb7d2015eee565f70b17c2fdb238cdab (patch) | |
tree | 2745ccf64e41392c93344cab75e2b9e32b65aedb /gcc/dwarf2out.c | |
parent | ce56e6ed02d18a4f9f2cf102f10daf64ba96888a (diff) | |
download | gcc-243e7835fb7d2015eee565f70b17c2fdb238cdab.zip gcc-243e7835fb7d2015eee565f70b17c2fdb238cdab.tar.gz gcc-243e7835fb7d2015eee565f70b17c2fdb238cdab.tar.bz2 |
Fix cygwin32 hosted dwarf2 target problem with line number info.
* dwarf2out.c (size_of_string): Do count backslashes.
From-SVN: r20562
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 6d6a502..39ad8a6 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. */ |