This is the mail archive of the
insight@sourceware.cygnus.com
mailing list for the Insight project.
Re: RFA: strdup -> xstrdup
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: RFA: strdup -> xstrdup
- From: James Ingham <jingham at cygnus dot com>
- Date: Mon, 22 Nov 1999 10:10:08 -0800 (PST)
- CC: "Insight (GDB GUI)" <insight at sourceware dot cygnus dot com>
- References: <383905B3.EEFB536F@cygnus.com>
Andrew,
Thanks for working through this kind of cleanup! Tedious and unsexy,
but very valuable. Check 'em in if you haven't already.
Jim
> Hello,
>
> The attached replaces strdup() calls with liberty's slightly more robust
> xstrdup().
>
> Ok?
> AndrewThu Nov 18 18:19:59 1999 Andrew Cagney <cagney@b1.cygnus.com>
>
> * gdbtk.c (tk_command), gdbtk-hooks.c (gdbtk_readline),
> gdbtk-variable.c (variable_type): Replace strdup with xstrdup.
>
> Index: gdbtk-hooks.c
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/gdbtk-hooks.c,v
> retrieving revision 2.31
> diff -p -r2.31 gdbtk-hooks.c
> *** gdbtk-hooks.c 1999/10/17 04:23:08 2.31
> --- gdbtk-hooks.c 1999/11/22 07:39:29
> *************** gdbtk_readline (prompt)
> *** 470,476 ****
>
> if (result == TCL_OK)
> {
> ! return (strdup (gdbtk_interp->result));
> }
> else
> {
> --- 470,476 ----
>
> if (result == TCL_OK)
> {
> ! return (xstrdup (gdbtk_interp->result));
> }
> else
> {
> Index: gdbtk-variable.c
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/gdbtk-variable.c,v
> retrieving revision 2.15
> diff -p -r2.15 gdbtk-variable.c
> *** gdbtk-variable.c 1999/10/05 10:47:59 2.15
> --- gdbtk-variable.c 1999/11/22 07:39:35
> *************** variable_type (interp, objc, objv, var)
> *** 1227,1233 ****
> result = call_gdb_type_print (val);
> if (result == TCL_OK)
> {
> ! string = strdup (Tcl_GetStringFromObj (get_call_output (), NULL));
> first = string;
>
> /* gdb will print things out like "struct {...}" for anonymous structs.
> --- 1227,1233 ----
> result = call_gdb_type_print (val);
> if (result == TCL_OK)
> {
> ! string = xstrdup (Tcl_GetStringFromObj (get_call_output (), NULL));
> first = string;
>
> /* gdb will print things out like "struct {...}" for anonymous structs.
> Index: gdbtk.c
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/gdbtk.c,v
> retrieving revision 2.145
> diff -p -r2.145 gdbtk.c
> *** gdbtk.c 1999/09/23 22:46:57 2.145
> --- gdbtk.c 1999/11/22 07:39:37
> *************** tk_command (cmd, from_tty)
> *** 639,645 ****
>
> retval = Tcl_Eval (gdbtk_interp, cmd);
>
> ! result = strdup (gdbtk_interp->result);
>
> old_chain = make_cleanup (free, result);
>
> --- 639,645 ----
>
> retval = Tcl_Eval (gdbtk_interp, cmd);
>
> ! result = xstrdup (gdbtk_interp->result);
>
> old_chain = make_cleanup (free, result);
>