OSDN Git Service

Fix cygwin32 hosted dwarf2 target problem with line number info.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jun 1998 18:19:08 +0000 (18:19 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jun 1998 18:19:08 +0000 (18:19 +0000)
* dwarf2out.c (size_of_string): Do count backslashes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20562 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c

index a170d27..3263bc0 100644 (file)
@@ -1,3 +1,7 @@
+Thu Jun 18 18:16:01 1998  Jim Wilson  <wilson@cygnus.com>
+
+       * dwarf2out.c (size_of_string): Do count backslashes.
+
 Thu Jun 18 11:43:54 1998  Nick Clifton  <nickc@cygnus.com>
 
        * config/arm/thumb.h (GO_IF_LEGITIMATE_ADDRESS): Disallow REG+REG 
index 6d6a502..39ad8a6 100644 (file)
@@ -4451,29 +4451,18 @@ build_abbrev_table (die)
     build_abbrev_table (c);
 }
 \f
-/* 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.  */