g++: LD is not demangling

Andrew Macleod amacleod@cygnus.com
Mon Nov 16 07:52:00 GMT 1998


I applied a patch on friday morning that should fix this problem.
The affected file was cplus-dem.c. ( I posted the patch earlier
last week, but here it is again)

Presumably this should go into 1.1.1

Andrew

---------------------------------------

This patch should solve the problem with the underscores in the
class name.  Now we look for the final __ instead of the second one
when looking for the signature:
  __opt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0__1C

now demangles to

C::operator basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> >(void)

Index: cplus-dem.c
===================================================================
RCS file: /cvs/cvsfiles/devo/libiberty/cplus-dem.c,v
retrieving revision 1.92
diff -c -p -r1.92 cplus-dem.c
*** cplus-dem.c	1998/10/09 21:08:37	1.92
--- cplus-dem.c	1998/11/11 19:35:33
*************** demangle_prefix (work, mangled, declp)
*** 1926,1932 ****
  	    }
  	  else
  	    {
! 	      demangle_function_name (work, mangled, declp, scan);
  	    }
  	}
      }
--- 1926,1940 ----
  	    }
  	  else
  	    {
!               const char *tmp;
!               /* Look for the LAST occurrence of __, allowing names to have
!                  the '__' sequence embedded in them.*/
!               while ((tmp = mystrstr (scan+2, "__")) != NULL)
!                 scan = tmp;
!               if (*(scan + 2) == '\0')
!                 success = 0;
!               else
!                 demangle_function_name (work, mangled, declp, scan);
  	    }
  	}
      }




More information about the Gcc-bugs mailing list