Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: ahaas@neosoft.com
To: gdb-patches@cygnus.com
Subject: [PATCH] Demangling patch #2
Date: Thu, 01 Apr 1999 00:00:00 -0000	[thread overview]
Message-ID: <19990315143151.A26089@localhost.neosoft.com> (raw)

Hi.

After a bit of poking around, I was able to find and fix the remaining
error in the demangling tests. The test that failed was trying to
demangle

add__XTPfTFPd_f_FcT1

into

add<float *,float (double *)>(char, char)

The problem was the 'forgetting_types' field in the work structure was
never decremented, causing problems when remember_types() was called.

I'm resending the entire patch to 'cplus-dem.c' which cured the
demangling problems. The first part of it was sent earlier today (Mar 15),
the little bit on the end cures the bug above.

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 13:59:59 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);
 	    }
@@ -3893,6 +3896,7 @@
   if (work->previous_argument)
     string_delete (work->previous_argument);
   work->previous_argument = saved_previous_argument;
+  --work->forgetting_types;
   work->nrepeats = saved_nrepeats;
 
   return result;


WARNING: multiple messages have this Message-ID
From: ahaas@neosoft.com
To: gdb-patches@cygnus.com
Subject: [PATCH] Demangling patch #2
Date: Mon, 15 Mar 1999 13:23:00 -0000	[thread overview]
Message-ID: <19990315143151.A26089@localhost.neosoft.com> (raw)
Message-ID: <19990315132300.hBQawZ7I1RoqkBFONMOo8MAeWrraHDKyev8Q_aWZe8c@z> (raw)

Hi.

After a bit of poking around, I was able to find and fix the remaining
error in the demangling tests. The test that failed was trying to
demangle

add__XTPfTFPd_f_FcT1

into

add<float *,float (double *)>(char, char)

The problem was the 'forgetting_types' field in the work structure was
never decremented, causing problems when remember_types() was called.

I'm resending the entire patch to 'cplus-dem.c' which cured the
demangling problems. The first part of it was sent earlier today (Mar 15),
the little bit on the end cures the bug above.

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 13:59:59 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);
 	    }
@@ -3893,6 +3896,7 @@
   if (work->previous_argument)
     string_delete (work->previous_argument);
   work->previous_argument = saved_previous_argument;
+  --work->forgetting_types;
   work->nrepeats = saved_nrepeats;
 
   return result;


             reply	other threads:[~1999-04-01  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-01  0:00 ahaas [this message]
1999-03-15 13:23 ` ahaas
1999-03-15 19:11 ` Stan Shebs
1999-04-01  0:00   ` Stan Shebs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990315143151.A26089@localhost.neosoft.com \
    --to=ahaas@neosoft.com \
    --cc=gdb-patches@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox