This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Make test-cp-name-parser usable


On Wed, 03 Aug 2011 22:56:36 +0200, Tom Tromey wrote:
> >>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
> Daniel> What does the translation - is it as simple as #undef free or
> Daniel> (free) (ptr)?
> 
> A sed script in the .y.c rule in gdb/Makefile.

	     -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
	     -e 's/\([ \t;,(]\)free$$/\1xfree/g' \

If it is a concern patched it differently.

I will check it in if no comments appear.


Thanks,
Jan


gdb/
2011-08-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* cp-name-parser.y (xfree): Wrap the name free by CONCAT2.
	(main): Uncomment "Demangling error\n".

--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -2042,7 +2042,7 @@ void
 xfree (void *ptr)
 {
   if (ptr != NULL)
-    free (ptr);
+    CONCAT2 (fr,ee) (ptr);
 }
 
 int
@@ -2071,7 +2071,7 @@ main (int argc, char **argv)
 	str2 = cplus_demangle (buf, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE);
 	if (str2 == NULL)
 	  {
-	    /* printf ("Demangling error\n"); */
+	    printf ("Demangling error\n");
 	    if (c)
 	      printf ("%s%c%s\n", buf, c, extra_chars);
 	    else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]