This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] ARI fix: Remove 3 uses of xasprintf
- From: "Pierre Muller" <muller at ics dot u-strasbg dot fr>
- To: <gdb-patches at sourceware dot org>, "'Daniel Jacobowitz'" <drow at false dot org>, "'Ulrich Weigand'" <uweigand at de dot ibm dot com>
- Date: Mon, 15 Oct 2007 16:13:31 +0200
- Subject: [RFA] ARI fix: Remove 3 uses of xasprintf
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