+Tue Jan 30 17:09:07 2001 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h (strsave): Delete declaration.
+ * utils.c (strsave): Delete definition.
+ * TODO (strsave): Update
+
+ * mac-xdep.c (tilde_expand): Replace strsave with xstrdup.
+ * sparcl-tdep.c (sparclite_open): Ditto.
+ * mips-tdep.c (mips_set_processor_type_command): Ditto.
+ (_initialize_mips_tdep): Ditto.
+ * solib.c (solib_open): Ditto.
+ * symfile.c (add_filename_language): Ditto.
+ (set_ext_lang_command): Ditto.
+ * source.c (init_source_path): Ditto.
+ (mod_path): Ditto.
+ * sh3-rom.c (sh3_open): Ditto.
+ (sh3e_open): Ditto.
+ * serial.c (serial_open): Ditto.
+ * remote-mips.c (common_open): Ditto.
+ * monitor.c (monitor_open): Ditto.
+ * m32r-rom.c (m32r_upload_command): Ditto.
+ * infcmd.c (path_command): Ditto.
+ * f-exp.y (parse_number): Ditto.
+ * breakpoint.c (create_longjmp_breakpoint): Ditto.
+ (create_thread_event_breakpoint): Ditto.
+ * arc-tdep.c (arc_set_cpu_type_command): Ditto.
+ (_initialize_arc_tdep): Ditto.
+
Tue Jan 30 15:14:26 2001 Andrew Cagney <cagney@skil>
* cli/cli-script.c (define_command): Check for a bad hook value in
--
-Replace strsave() + mstrsave() with libiberty:xstrdup().
-
---
-
Replace savestring() with something from libiberty.
An xstrldup()? but that would have different semantics.
--
-Eliminate mmalloc() from GDB.
+Eliminate mmalloc(), mstrsave() et.al. from GDB.
Also eliminate it from defs.h.
/* ARC target-dependent stuff.
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 2001 Free Software Foundation, Inc.
This file is part of GDB.
printf_unfiltered ("%s\n", arc_cpu_type_table[i].name);
/* Restore the value. */
- tmp_arc_cpu_type = strsave (arc_cpu_type);
+ tmp_arc_cpu_type = xstrdup (arc_cpu_type);
return;
}
{
error ("Unknown cpu type `%s'.", tmp_arc_cpu_type);
/* Restore its value. */
- tmp_arc_cpu_type = strsave (arc_cpu_type);
+ tmp_arc_cpu_type = xstrdup (arc_cpu_type);
}
}
c = add_show_from_set (c, &showlist);
c->function.cfunc = arc_show_cpu_type_command;
- /* We have to use strsave here because the `set' command frees it before
- setting a new value. */
- tmp_arc_cpu_type = strsave (DEFAULT_ARC_CPU_TYPE);
+ /* We have to use xstrdup() here because the `set' command frees it
+ before setting a new value. */
+ tmp_arc_cpu_type = xstrdup (DEFAULT_ARC_CPU_TYPE);
arc_set_cpu_type (tmp_arc_cpu_type);
c = add_set_cmd ("displaypipeline", class_support, var_zinteger,
/* Everything about breakpoints, for GDB.
- Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000
- Free Software Foundation, Inc.
+ Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999,
+ 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
b->enable = disabled;
b->silent = 1;
if (func_name)
- b->addr_string = strsave (func_name);
+ b->addr_string = xstrdup (func_name);
b->number = internal_breakpoint_number--;
}
b->enable = enabled;
/* addr_string has to be used or breakpoint_re_set will delete me. */
sprintf (addr_string, "*0x%s", paddr (b->address));
- b->addr_string = strsave (addr_string);
+ b->addr_string = xstrdup (addr_string);
return b;
}
/* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */
/* Basic, host-specific, and target-specific definitions for GDB.
- Copyright (C) 1986, 1989, 1991-1996, 1998-2000
+ Copyright (C) 1986, 1989, 1991-1996, 1998-2000, 2001
Free Software Foundation, Inc.
This file is part of GDB.
extern char *msavestring (void *, const char *, int);
-extern char *strsave (const char *);
-
extern char *mstrsave (void *, const char *);
/* FIXME; was long, but this causes compile errors in msvc if already
/* YACC parser for Fortran expressions, for GDB.
- Copyright 1986, 1989, 1990, 1991, 1993, 1994
- Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1993, 1994, 2001 Free Software
+ Foundation, Inc.
+
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
/* [dD] is not understood as an exponent by atof, change it to 'e'. */
char *tmp, *tmp2;
- tmp = strsave (p);
+ tmp = xstrdup (p);
for (tmp2 = tmp; *tmp2; ++tmp2)
if (*tmp2 == 'd' || *tmp2 == 'D')
*tmp2 = 'e';
/* Memory-access and commands for "inferior" process, for GDB.
- Copyright 1986, 87, 88, 89, 91, 92, 95, 96, 1998, 1999
+ Copyright 1986, 87, 88, 89, 91, 92, 95, 96, 1998, 1999, 2001
Free Software Foundation, Inc.
This file is part of GDB.
/* Can be null if path is not set */
if (!env)
env = "";
- exec_path = strsave (env);
+ exec_path = xstrdup (env);
mod_path (dirname, &exec_path);
set_in_environ (inferior_environ, path_var_name, exec_path);
xfree (exec_path);
/* Remote debugging interface to m32r and mon2000 ROM monitors for GDB,
the GNU debugger.
- Copyright 1996 Free Software Foundation, Inc.
+ Copyright 1996, 2001 Free Software Foundation, Inc.
Adapted by Michael Snyder of Cygnus Support.
error ("Please use 'set board-address' to set the M32R-EVA board's IP address.");
if (strchr (myIPaddress, '('))
*(strchr (myIPaddress, '(')) = '\0'; /* delete trailing junk */
- board_addr = strsave (myIPaddress);
+ board_addr = xstrdup (myIPaddress);
}
if (server_addr == 0)
{
if (args[0] != '/' && download_path == 0)
{
if (current_directory)
- download_path = strsave (current_directory);
+ download_path = xstrdup (current_directory);
else
error ("Need to know default download path (use 'set download-path')");
}
/* Top level support for Mac interface to GDB, the GNU debugger.
- Copyright 1994 Free Software Foundation, Inc.
+ Copyright 1994, 2001 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Stan Shebs.
This file is part of GDB.
char *
tilde_expand (char *str)
{
- return strsave (str);
+ return xstrdup (str);
}
/* Modified versions of standard I/O. */
/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, Free Software Foundation, Inc.
+ 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
printf_unfiltered ("%s\n", mips_processor_type_table[i].name);
/* Restore the value. */
- tmp_mips_processor_type = strsave (mips_processor_type);
+ tmp_mips_processor_type = xstrdup (mips_processor_type);
return;
}
{
error ("Unknown processor type `%s'.", tmp_mips_processor_type);
/* Restore its value. */
- tmp_mips_processor_type = strsave (mips_processor_type);
+ tmp_mips_processor_type = xstrdup (mips_processor_type);
}
}
c = add_show_from_set (c, &showlist);
c->function.cfunc = mips_show_processor_type_command;
- tmp_mips_processor_type = strsave (DEFAULT_MIPS_TYPE);
- mips_set_processor_type_command (strsave (DEFAULT_MIPS_TYPE), 0);
+ tmp_mips_processor_type = xstrdup (DEFAULT_MIPS_TYPE);
+ mips_set_processor_type_command (xstrdup (DEFAULT_MIPS_TYPE), 0);
#endif
/* We really would like to have both "0" and "unlimited" work, but
if (dev_name)
xfree (dev_name);
- dev_name = strsave (args);
+ dev_name = xstrdup (args);
monitor_desc = SERIAL_OPEN (dev_name);
nomem (0);
make_cleanup_freeargv (argv);
- serial_port_name = strsave (argv[0]);
+ serial_port_name = xstrdup (argv[0]);
if (argv[1]) /* remote TFTP name specified? */
{
remote_name = argv[1];
local_name++; /* skip over the colon */
if (local_name == NULL)
local_name = remote_name; /* local name same as remote name */
- tftp_name = strsave (remote_name);
- tftp_localname = strsave (local_name);
+ tftp_name = xstrdup (remote_name);
+ tftp_localname = xstrdup (local_name);
tftp_in_use = 1;
}
}
/* Reset the expected monitor prompt if it's never been set before. */
if (mips_monitor_prompt == NULL)
- mips_monitor_prompt = strsave (new_monitor_prompt);
+ mips_monitor_prompt = xstrdup (new_monitor_prompt);
mips_monitor = new_monitor;
mips_initialize ();
/* Try to figure out the processor model if possible. */
ptype = mips_read_processor_type ();
if (ptype)
- mips_set_processor_type_command (strsave (ptype), 0);
+ mips_set_processor_type_command (xstrdup (ptype), 0);
/* This is really the job of start_remote however, that makes an assumption
that the target is about to print out a status message of some sort. That
/* Generic serial interface routines
- Copyright 1992, 1993, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1992, 1993, 1996, 1997, 1999, 2000, 2001 Free Software
+ Foundation, Inc.
This file is part of GDB.
return NULL;
}
- scb->name = strsave (name);
+ scb->name = xstrdup (name);
scb->next = scb_base;
scb->refcnt = 1;
scb->debug_p = 0;
/* Remote target glue for the Hitachi SH-3 ROM monitor.
- Copyright 1995, 1996, 2000 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
if (args)
{
- char *cursor = serial_port_name = strsave (args);
+ char *cursor = serial_port_name = xstrdup (args);
while (*cursor && *cursor != ' ')
cursor++;
if (args)
{
- char *cursor = serial_port_name = strsave (args);
+ char *cursor = serial_port_name = xstrdup (args);
while (*cursor && *cursor != ' ')
cursor++;
/* Handle shared libraries for GDB, the GNU Debugger.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 1999, 2000
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GDB.
/* Done. If not found, tough luck. Return found_file and
(optionally) found_pathname. */
if (found_pathname != NULL && temp_pathname != NULL)
- *found_pathname = strsave (temp_pathname);
+ *found_pathname = xstrdup (temp_pathname);
return found_file;
}
/* List lines of source files for GDB, the GNU debugger.
- Copyright 1986-1989, 1991-1999 Free Software Foundation, Inc.
+ Copyright 1986-1989, 1991-1999, 2001 Free Software Foundation, Inc.
This file is part of GDB.
char buf[20];
sprintf (buf, "$cdir%c$cwd", DIRNAME_SEPARATOR);
- source_path = strsave (buf);
+ source_path = xstrdup (buf);
forget_cached_source_info ();
}
if (dirname == 0)
return;
- dirname = strsave (dirname);
+ dirname = xstrdup (dirname);
make_cleanup (xfree, dirname);
do
/* Target dependent code for the Fujitsu SPARClite for GDB, the GNU debugger.
- Copyright 1994, 1995, 1996, 1999 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1996, 1999, 2001 Free Software Foundation, Inc.
This file is part of GDB.
if (remote_target_name)
xfree (remote_target_name);
- remote_target_name = strsave (name);
+ remote_target_name = xstrdup (name);
/* We need a 'serial' or 'udp' keyword to disambiguate host:port, which can
mean either a serial port on a terminal server, or the IP address of a
/* Generic symbol file reading for the GNU debugger, GDB.
- Copyright 1990-1996, 1998, 2000 Free Software Foundation, Inc.
+ Copyright 1990-1996, 1998, 2000, 2001 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
fl_table_size);
}
- filename_language_table[fl_table_next].ext = strsave (ext);
+ filename_language_table[fl_table_next].ext = xstrdup (ext);
filename_language_table[fl_table_next].lang = lang;
fl_table_next++;
}
/* ext_args, language_str (lang)); */
xfree (filename_language_table[i].ext);
- filename_language_table[i].ext = strsave (ext_args);
+ filename_language_table[i].ext = xstrdup (ext_args);
filename_language_table[i].lang = lang;
}
}
/* General utility routines for GDB, the GNU debugger.
- Copyright 1986, 1989, 1990-1992, 1995, 1996, 1998, 2000
+ Copyright 1986, 1989, 1990-1992, 1995, 1996, 1998, 2000, 2001
Free Software Foundation, Inc.
This file is part of GDB.
return p;
}
-/* The "const" is so it compiles under DGUX (which prototypes strsave
- in <string.h>. FIXME: This should be named "xstrsave", shouldn't it?
- Doesn't real strsave return NULL if out of memory? */
-char *
-strsave (const char *ptr)
-{
- return savestring (ptr, strlen (ptr));
-}
-
char *
mstrsave (void *md, const char *ptr)
{