* read.c (read_a_source_file): Conditionally allow matched "
[deliverable/binutils-gdb.git] / binutils / stabs.c
index d4833dbed8664e6acf212250da18723f9f5c4336..a47b3bd4cadd4c34bf729edc0156192062a9d56f 100644 (file)
 #include "aout/stab_gnu.h"
 
 #ifndef DIR_SEPARATOR
+#ifdef _WIN32
+#define DIR_SEPARATOR '\\'
+#else
 #define DIR_SEPARATOR '/'
 #endif
+#endif
 
 /* The number of predefined XCOFF types.  */
 
@@ -1810,7 +1814,7 @@ parse_stab_range_type (dhandle, info, typename, pp, typenums)
          else if (n3 == 0xffffffff)
            return debug_make_int_type (dhandle, 4, true);
 #ifdef BFD64
-         else if (n3 == (((bfd_vma) 0xffffffff) << 32) | 0xffffffff)
+         else if (n3 == ((((bfd_vma) 0xffffffff) << 32) | 0xffffffff))
            return debug_make_int_type (dhandle, 8, true);
 #endif
        }
@@ -1827,7 +1831,7 @@ parse_stab_range_type (dhandle, info, typename, pp, typenums)
          else if (n3 == 0x7fffffff)
            return debug_make_int_type (dhandle, 4, false);
 #ifdef BFD64
-         else if (n3 == (((bfd_vma) 0x7fffffff) << 32) | 0xffffffff)
+         else if (n3 == ((((bfd_vma) 0x7fffffff) << 32) | 0xffffffff))
            return debug_make_int_type (dhandle, 8, false);
 #endif
        }
@@ -4460,6 +4464,7 @@ stab_demangle_template (minfo, pp, pname)
   if (pname != NULL)
     {
       char *s1, *s2, *s3, *s4;
+      char *from, *to;
 
       s1 = savestring (orig, *pp - orig);
 
@@ -4481,7 +4486,15 @@ stab_demangle_template (minfo, pp, pname)
          return false;
        }
 
-      *pname = savestring (s3, s4 - s3);
+      /* Eliminating all spaces, except those between > characters,
+         makes it more likely that the demangled name will match the
+         name which g++ used as the structure name.  */
+      for (from = to = s3; from != s4; ++from)
+       if (*from != ' '
+           || (from[1] == '>' && from > s3 && from[-1] == '>'))
+         *to++ = *from;
+
+      *pname = savestring (s3, to - s3);
 
       free (s3);
     }
This page took 0.023985 seconds and 4 git commands to generate.