* [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
* RE: [RFA] ARI fix: Remove 3 uses of xasprintf
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'
0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2007-10-15 15:14 UTC (permalink / raw)
To: 'Pierre Muller', gdb-patches, 'Daniel Jacobowitz',
'Ulrich Weigand'
It seems that both functions are still
used in gdbtk directory.
Is this directory still used?
I tried
'make insight.exe' (cygwin system).
which compiled fine, but
./insight resulted in "Interpreter `insight' unrecognized"
Pierre
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Pierre Muller
> Sent: Monday, October 15, 2007 4:14 PM
> To: gdb-patches@sourceware.org; 'Daniel Jacobowitz'; 'Ulrich Weigand'
> 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
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] ARI fix: Remove 3 uses of xasprintf
2007-10-15 15:14 ` Pierre Muller
@ 2007-10-15 15:38 ` 'Daniel Jacobowitz'
2007-10-15 17:34 ` Pierre Muller
0 siblings, 1 reply; 5+ messages in thread
From: 'Daniel Jacobowitz' @ 2007-10-15 15:38 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches, 'Ulrich Weigand'
On Mon, Oct 15, 2007 at 05:06:05PM +0200, Pierre Muller wrote:
> It seems that both functions are still
> used in gdbtk directory.
>
> Is this directory still used?
>
> I tried
> 'make insight.exe' (cygwin system).
> which compiled fine, but
> ./insight resulted in "Interpreter `insight' unrecognized"
You have to build a bit more than that to get Insight; it needs top
level TCL / Tk, for instance. Yes, the gdbtk directory is still used.
You could ask the insight developers to update, or just leave the
definitions.
> > 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.
OK.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [RFA] ARI fix: Remove 3 uses of xasprintf
2007-10-15 15:38 ` 'Daniel Jacobowitz'
@ 2007-10-15 17:34 ` Pierre Muller
2007-10-24 20:10 ` 'Daniel Jacobowitz'
0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2007-10-15 17:34 UTC (permalink / raw)
To: 'Daniel Jacobowitz'; +Cc: gdb-patches, 'Ulrich Weigand'
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of 'Daniel Jacobowitz'
> Sent: Monday, October 15, 2007 5:14 PM
> To: Pierre Muller
> Cc: gdb-patches@sourceware.org; 'Ulrich Weigand'
> Subject: Re: [RFA] ARI fix: Remove 3 uses of xasprintf
>
> On Mon, Oct 15, 2007 at 05:06:05PM +0200, Pierre Muller wrote:
> > It seems that both functions are still
> > used in gdbtk directory.
> >
> > Is this directory still used?
> >
> > I tried
> > 'make insight.exe' (cygwin system).
> > which compiled fine, but
> > ./insight resulted in "Interpreter `insight' unrecognized"
>
> You have to build a bit more than that to get Insight; it needs top
> level TCL / Tk, for instance. Yes, the gdbtk directory is still used.
> You could ask the insight developers to update, or just leave the
> definitions.
Then I would simply leave it inside defs.h and utils.c
and ask you to apply this little patch to gdb_ari.sh
Pseudo ChangeLog:
2007-10-15 Pierre Muller <muller@ics.u-strasbg.fr>
* gdb_ari.sh (xasprintf): Add known entries in defs.h and utils.c.
Switch to regression category.
(xvasprintf): Idem.
$ cvs diff -up gdb_ari.sh
Index: gdb_ari.sh
===================================================================
RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v
retrieving revision 1.75
diff -u -p -r1.75 gdb_ari.sh
--- gdb_ari.sh 10 Oct 2007 11:56:14 -0000 1.75
+++ gdb_ari.sh 15 Oct 2007 15:36:09 -0000
@@ -1300,7 +1300,9 @@ Do not use vasprintf(), instead use xstr
BEGIN { doc["xasprintf"] = "\
Do not use xasprintf(), instead use xstrprintf"
- category["xasprintf"] = ari_code
+ fix("xasprintf", "gdb/defs.h", 1)
+ fix("xasprintf", "gdb/utils.c", 1)
+ category["xasprintf"] = ari_regression
}
/(^|[^_[:alnum:]])xasprintf[[:space:]]*\(/ {
fail("xasprintf")
@@ -1308,7 +1310,9 @@ Do not use xasprintf(), instead use xstr
BEGIN { doc["xvasprintf"] = "\
Do not use xvasprintf(), instead use xstrvprintf"
- category["xvasprintf"] = ari_code
+ fix("xvasprintf", "gdb/defs.h", 1)
+ fix("xvasprintf", "gdb/utils.c", 1)
+ category["xvasprintf"] = ari_regression
}
/(^|[^_[:alnum:]])xvasprintf[[:space:]]*\(/ {
fail("xvasprintf")
> > > 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.
>
> OK.
Thanks, committed,
after correcting sysfile-mem.c to symfile-mem.c which is the correct source
name...
Pierre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] ARI fix: Remove 3 uses of xasprintf
2007-10-15 17:34 ` Pierre Muller
@ 2007-10-24 20:10 ` 'Daniel Jacobowitz'
0 siblings, 0 replies; 5+ messages in thread
From: 'Daniel Jacobowitz' @ 2007-10-24 20:10 UTC (permalink / raw)
To: gdb-patches
On Mon, Oct 15, 2007 at 05:37:39PM +0200, Pierre Muller wrote:
> Then I would simply leave it inside defs.h and utils.c
> and ask you to apply this little patch to gdb_ari.sh
>
> Pseudo ChangeLog:
>
> 2007-10-15 Pierre Muller <muller@ics.u-strasbg.fr>
> * gdb_ari.sh (xasprintf): Add known entries in defs.h and utils.c.
> Switch to regression category.
> (xvasprintf): Idem.
Done now.
--
Daniel Jacobowitz
CodeSourcery
^ 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