Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] ARI fix: Remove 3 uses of xasprintf
@ 2007-10-15 15:06 Pierre Muller
  2007-10-15 15:14 ` Pierre Muller
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2007-10-15 15:06 UTC (permalink / raw)
  To: gdb-patches, 'Daniel Jacobowitz', 'Ulrich Weigand'

 This removes the 3 remaining uses of 
xasprintf function.

  This still leaves the xasprintf and xvasprintf 
visible on the ARI web page.

  But this is due to the fact that those two functions
were already local to gdb.
  So that there are now two options:

- 1) Remove their definition,
which will of course prevent efficiently the reappearing
of those function, but might create problems for third
party sources using libgdb and gdb specific functions.

- 2) Leave the functions present in defs.h and  utils.c
and correct ARI sources for their presence in those functions.

  An intermediate solution would be to deprecate them
by adding the 'deprecated_' prefix to their definition.

Is this change OK?


Pierre Muller

Changelog entry:

2007-10-15  Pierre Muller  <muller@ics.u-strasbg.fr>

	* cp-abi.c (set_cp_abi_as_auto_default): ARI fix:
	Replace xasprintf by xstrprintf.
	sysfile-mem.c (add_vsyscall_page): Ditto.



$ cvs diff -up cp-abi.c symfile-mem.c
Enter passphrase for RSA key '/home/Pierre/.ssh/identity':
Index: cp-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/cp-abi.c,v
retrieving revision 1.19
diff -u -p -r1.19 cp-abi.c
--- cp-abi.c    23 Sep 2007 16:25:05 -0000      1.19
+++ cp-abi.c    15 Oct 2007 13:58:49 -0000
@@ -193,10 +193,10 @@ set_cp_abi_as_auto_default (const char *
   auto_cp_abi = *abi;

   auto_cp_abi.shortname = "auto";
-  xasprintf (&new_longname, "currently \"%s\"", abi->shortname);
+  new_longname = xstrprintf ("currently \"%s\"", abi->shortname);
   auto_cp_abi.longname = new_longname;

-  xasprintf (&new_doc, "Automatically selected; currently \"%s\"",
+  new_doc = xstrprintf ("Automatically selected; currently \"%s\"",
             abi->shortname);
   auto_cp_abi.doc = new_doc;

Index: symfile-mem.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile-mem.c,v
retrieving revision 1.13
diff -u -p -r1.13 symfile-mem.c
--- symfile-mem.c       23 Aug 2007 18:08:39 -0000      1.13
+++ symfile-mem.c       15 Oct 2007 13:58:49 -0000
@@ -196,7 +196,7 @@ try using the \"file\" command first."))
        }
       args.bfd = bfd;
       args.sysinfo_ehdr = sysinfo_ehdr;
-      xasprintf (&args.name, "system-supplied DSO at 0x%s",
+      args.name = xstrprintf ("system-supplied DSO at 0x%s",
                 paddr_nz (sysinfo_ehdr));
       /* Pass zero for FROM_TTY, because the action of loading the
         vsyscall DSO was not triggered by the user, even if the user





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

end of thread, other threads:[~2007-10-24 20:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-15 15:06 [RFA] ARI fix: Remove 3 uses of xasprintf Pierre Muller
2007-10-15 15:14 ` Pierre Muller
2007-10-15 15:38   ` 'Daniel Jacobowitz'
2007-10-15 17:34     ` Pierre Muller
2007-10-24 20:10       ` 'Daniel Jacobowitz'

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