Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Demangling fixes
@ 1999-04-01  0:00 ahaas
  1999-03-15  9:25 ` ahaas
  0 siblings, 1 reply; 2+ messages in thread
From: ahaas @ 1999-04-01  0:00 UTC (permalink / raw)
  To: gdb-patches

Hi.

The latest gdb snapshot gdb-4.17.86 has numerous failures in the
demangling tests. The enclosed patch fixes all but one demangle test failure
for me.

The problem was in libiberty/cplus-dem.c - the function 'demangle_prefix'
was being to greedy when working on a mangled name like
"__dt__11T5__pt__2_iFv" when demangling in 'arm' or 'hp' style. A simple
'if' block fixes the problem.

Enjoy.

Art Haas
==========================================
--- gdb-4.17.86/libiberty/cplus-dem.c.orig	Wed Feb 10 19:49:17 1999
+++ gdb-4.17.86/libiberty/cplus-dem.c	Mon Mar 15 10:45:43 1999
@@ -2237,13 +2237,16 @@
 	    }
 	  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;
+	      if (!(ARM_DEMANGLING || HP_DEMANGLING))
+		{
+		  const char *tmp;
+		  while ((tmp = mystrstr (scan+2, "__")) != NULL)
+		    scan = tmp;
+		}
+	      if (*(scan + 2) == '\0')
+		success = 0;
               else
                 demangle_function_name (work, mangled, declp, scan);
 	    }


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-04-01  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-01  0:00 [PATCH] Demangling fixes ahaas
1999-03-15  9:25 ` ahaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox