This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[PATCH] savestring-->gdb_savestring
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH] savestring-->gdb_savestring
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Thu, 6 Jul 2000 13:56:58 -0400 (EDT)
This patch renames all the occurrences of savestring in gdb to
gdb_savestring. I'll commit it tomorrow.
Elena
2000-07-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* breakpoint.c, buildsym.c, ch-lang.c, coffread.c, command.c,
corefile.c, dbxread.c, defs.h, demangle.c, dstread.c, elfread.c,
event-top.c, hppah-nat.c, infcmd.c, infrun.c, infttrace.c,
language.c, mips-tdep.c, remote-adapt.c, remote-eb.c, remote-es.c,
remote-mm.c, remote-nindy.c, remote-udi.c, remote-utils.c,
remote-vx.c, rs6000-nat.c, source.c, stabsread.c, stack.c,
sun386-nat.c, symtab.c, top.c, tracepoint.c, umax-xdep.c, utils.c,
values.c, varobj.c , xcoffread.c: Change savestring() to
gdb_savestring(), to avoid conflicts with readline version of
savestring().
Index: breakpoint.c
===================================================================
RCS file: /cvs/src//src/gdb/breakpoint.c,v
retrieving revision 1.13
diff -c -u -p -r1.13 breakpoint.c
--- breakpoint.c 2000/06/12 21:17:21 1.13
+++ breakpoint.c 2000/07/06 17:42:26
@@ -562,7 +562,7 @@ condition_command (arg, from_tty)
arg = p;
/* I don't know if it matters whether this is the string the user
typed in or the decompiled expression. */
- b->cond_string = savestring (arg, strlen (arg));
+ b->cond_string = gdb_savestring (arg, strlen (arg));
b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
if (*arg)
error ("Junk at end of expression");
@@ -3849,7 +3849,7 @@ set_raw_breakpoint (sal)
if (sal.symtab == NULL)
b->source_file = NULL;
else
- b->source_file = savestring (sal.symtab->filename,
+ b->source_file = gdb_savestring (sal.symtab->filename,
strlen (sal.symtab->filename));
b->section = sal.section;
b->language = current_language->la_language;
@@ -4145,13 +4145,13 @@ solib_load_unload_1 (hookname, tempflag,
b->number = breakpoint_count;
b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
- NULL : savestring (cond_string, strlen (cond_string));
+ NULL : gdb_savestring (cond_string, strlen (cond_string));
b->thread = thread;
if (canonical != (char **) NULL && canonical[0] != NULL)
b->addr_string = canonical[0];
else if (addr_start)
- b->addr_string = savestring (addr_start, addr_end - addr_start);
+ b->addr_string = gdb_savestring (addr_start, addr_end - addr_start);
b->enable = enabled;
b->disposition = tempflag ? del : donttouch;
@@ -4213,7 +4213,7 @@ create_fork_vfork_event_catchpoint (temp
b->number = breakpoint_count;
b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
- NULL : savestring (cond_string, strlen (cond_string));
+ NULL : gdb_savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
b->enable = enabled;
@@ -4260,7 +4260,7 @@ create_exec_event_catchpoint (tempflag,
b->number = breakpoint_count;
b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
- NULL : savestring (cond_string, strlen (cond_string));
+ NULL : gdb_savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
b->enable = enabled;
@@ -4689,7 +4689,7 @@ parse_breakpoint_sals (char **address,
{
/* Add the string if not present. */
if ((*addr_string)[i] == NULL)
- (*addr_string)[i] = savestring (addr_start, (*address) - addr_start);
+ (*addr_string)[i] = gdb_savestring (addr_start, (*address) - addr_start);
}
}
}
@@ -4830,7 +4830,7 @@ break_command_1 (arg, flag, from_tty)
cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
make_cleanup (free, cond[i]);
cond_end = tok;
- cond_string[i] = savestring (cond_start, cond_end - cond_start);
+ cond_string[i] = gdb_savestring (cond_start, cond_end - cond_start);
make_cleanup (free, cond_string[i]);
}
else if (toklen >= 1 && strncmp (tok, "thread", toklen) == 0)
@@ -5456,11 +5456,11 @@ watch_command_1 (arg, accessflag, from_t
b->disposition = donttouch;
b->exp = exp;
b->exp_valid_block = exp_valid_block;
- b->exp_string = savestring (exp_start, exp_end - exp_start);
+ b->exp_string = gdb_savestring (exp_start, exp_end - exp_start);
b->val = val;
b->cond = cond;
if (cond_start)
- b->cond_string = savestring (cond_start, cond_end - cond_start);
+ b->cond_string = gdb_savestring (cond_start, cond_end - cond_start);
else
b->cond_string = 0;
@@ -6272,7 +6272,7 @@ create_exception_catchpoint (tempflag, c
b->number = breakpoint_count;
b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
- NULL : savestring (cond_string, strlen (cond_string));
+ NULL : gdb_savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
b->enable = enabled;
@@ -7159,7 +7159,7 @@ breakpoint_re_set_one (bint)
b->source_file = NULL;
else
b->source_file =
- savestring (sals.sals[i].symtab->filename,
+ gdb_savestring (sals.sals[i].symtab->filename,
strlen (sals.sals[i].symtab->filename));
b->line_number = sals.sals[i].line;
b->address = sals.sals[i].pc;
Index: buildsym.c
===================================================================
RCS file: /cvs/src//src/gdb/buildsym.c,v
retrieving revision 1.5
diff -c -u -p -r1.5 buildsym.c
--- buildsym.c 2000/06/05 20:49:53 1.5
+++ buildsym.c 2000/07/06 17:42:27
@@ -549,9 +549,9 @@ start_subfile (char *name, char *dirname
current_subfile = subfile;
/* Save its name and compilation directory name */
- subfile->name = (name == NULL) ? NULL : savestring (name, strlen (name));
+ subfile->name = (name == NULL) ? NULL : gdb_savestring (name, strlen (name));
subfile->dirname =
- (dirname == NULL) ? NULL : savestring (dirname, strlen (dirname));
+ (dirname == NULL) ? NULL : gdb_savestring (dirname, strlen (dirname));
/* Initialize line-number recording for this subfile. */
subfile->line_vector = NULL;
@@ -629,7 +629,7 @@ patch_subfile_names (struct subfile *sub
&& subfile->name[strlen (subfile->name) - 1] == '/')
{
subfile->dirname = subfile->name;
- subfile->name = savestring (name, strlen (name));
+ subfile->name = gdb_savestring (name, strlen (name));
last_source_file = name;
/* Default the source language to whatever can be deduced from
@@ -1068,7 +1068,7 @@ hashname (char *name)
void
record_debugformat (char *format)
{
- current_subfile->debugformat = savestring (format, strlen (format));
+ current_subfile->debugformat = gdb_savestring (format, strlen (format));
}
/* Merge the first symbol list SRCLIST into the second symbol list
Index: ch-lang.c
===================================================================
RCS file: /cvs/src//src/gdb/ch-lang.c,v
retrieving revision 1.3
diff -c -u -p -r1.3 ch-lang.c
--- ch-lang.c 2000/05/28 01:12:26 1.3
+++ ch-lang.c 2000/07/06 17:42:27
@@ -71,7 +71,7 @@ chill_demangle (mangled)
}
if (joiner != NULL && *(joiner + 1) == *joiner)
{
- demangled = savestring (mangled, joiner - mangled);
+ demangled = gdb_savestring (mangled, joiner - mangled);
}
else
{
Index: coffread.c
===================================================================
RCS file: /cvs/src//src/gdb/coffread.c,v
retrieving revision 1.9
diff -c -u -p -r1.9 coffread.c
--- coffread.c 2000/06/12 14:05:44 1.9
+++ coffread.c 2000/07/06 17:42:28
@@ -444,7 +444,7 @@ coff_start_symtab (name)
this pointer into last_source_file and we put it in
subfiles->name, which end_symtab frees; that's why
it must be malloc'd. */
- savestring (name, strlen (name)),
+ gdb_savestring (name, strlen (name)),
/* We never know the directory name for COFF. */
NULL,
/* The start address is irrelevant, since we set
@@ -466,7 +466,7 @@ complete_symtab (name, start_addr, size)
{
if (last_source_file != NULL)
free (last_source_file);
- last_source_file = savestring (name, strlen (name));
+ last_source_file = gdb_savestring (name, strlen (name));
current_source_start_addr = start_addr;
current_source_end_addr = start_addr + size;
Index: command.c
===================================================================
RCS file: /cvs/src//src/gdb/command.c,v
retrieving revision 1.14
diff -c -u -p -r1.14 command.c
--- command.c 2000/06/23 08:12:27 1.14
+++ command.c 2000/07/06 17:42:28
@@ -1670,7 +1670,7 @@ do_setshow_command (arg, from_tty, c)
arg = "";
if (*(char **) c->var != NULL)
free (*(char **) c->var);
- *(char **) c->var = savestring (arg, strlen (arg));
+ *(char **) c->var = gdb_savestring (arg, strlen (arg));
break;
case var_filename:
if (arg == NULL)
Index: corefile.c
===================================================================
RCS file: /cvs/src//src/gdb/corefile.c,v
retrieving revision 1.5
diff -c -u -p -r1.5 corefile.c
--- corefile.c 2000/06/04 00:41:09 1.5
+++ corefile.c 2000/07/06 17:42:28
@@ -437,7 +437,7 @@ set_gnutarget (newtarget)
{
if (gnutarget_string != NULL)
free (gnutarget_string);
- gnutarget_string = savestring (newtarget, strlen (newtarget));
+ gnutarget_string = gdb_savestring (newtarget, strlen (newtarget));
set_gnutarget_command (NULL, 0, NULL);
}
Index: dbxread.c
===================================================================
RCS file: /cvs/src//src/gdb/dbxread.c,v
retrieving revision 1.6
diff -c -u -p -r1.6 dbxread.c
--- dbxread.c 2000/06/04 00:41:09 1.6
+++ dbxread.c 2000/07/06 17:42:29
@@ -423,7 +423,7 @@ add_new_header_file (name, instance)
i = N_HEADER_FILES (current_objfile)++;
hfile = HEADER_FILES (current_objfile) + i;
- hfile->name = savestring (name, strlen (name));
+ hfile->name = gdb_savestring (name, strlen (name));
hfile->instance = instance;
hfile->length = 10;
hfile->vector
Index: defs.h
===================================================================
RCS file: /cvs/src//src/gdb/defs.h,v
retrieving revision 1.26
diff -c -u -p -r1.26 defs.h
--- defs.h 2000/06/19 10:14:22 1.26
+++ defs.h 2000/07/06 17:42:30
@@ -782,7 +782,7 @@ extern int longest_to_int (LONGEST);
/* Assorted functions we can declare, now that const and volatile are
defined. */
-extern char *savestring (const char *, int);
+extern char *gdb_savestring (const char *, int);
extern char *msavestring (void *, const char *, int);
Index: demangle.c
===================================================================
RCS file: /cvs/src//src/gdb/demangle.c,v
retrieving revision 1.2
diff -c -u -p -r1.2 demangle.c
--- demangle.c 2000/05/28 01:12:26 1.2
+++ demangle.c 2000/07/06 17:42:30
@@ -162,7 +162,7 @@ set_demangling_command (ignore, from_tty
{
free (current_demangling_style_string);
current_demangling_style_string =
- savestring (dem->demangling_style_name,
+ gdb_savestring (dem->demangling_style_name,
strlen (dem->demangling_style_name));
}
}
@@ -173,7 +173,7 @@ set_demangling_command (ignore, from_tty
one as the default. */
current_demangling_style = demanglers[0].demangling_style;
current_demangling_style_string =
- savestring (demanglers[0].demangling_style_name,
+ gdb_savestring (demanglers[0].demangling_style_name,
strlen (demanglers[0].demangling_style_name));
warning ("`%s' style demangling chosen as the default.\n",
current_demangling_style_string);
@@ -191,7 +191,7 @@ set_demangling_style (style)
{
free (current_demangling_style_string);
}
- current_demangling_style_string = savestring (style, strlen (style));
+ current_demangling_style_string = gdb_savestring (style, strlen (style));
set_demangling_command ((char *) NULL, 0, (struct cmd_list_element *) NULL);
}
Index: dstread.c
===================================================================
RCS file: /cvs/src//src/gdb/dstread.c,v
retrieving revision 1.3
diff -c -u -p -r1.3 dstread.c
--- dstread.c 2000/05/28 01:12:26 1.3
+++ dstread.c 2000/07/06 17:42:30
@@ -129,7 +129,7 @@ complete_symtab (name, start_addr, size)
CORE_ADDR start_addr;
unsigned int size;
{
- last_source_file = savestring (name, strlen (name));
+ last_source_file = gdb_savestring (name, strlen (name));
cur_src_start_addr = start_addr;
cur_src_end_addr = start_addr + size;
Index: elfread.c
===================================================================
RCS file: /cvs/src//src/gdb/elfread.c,v
retrieving revision 1.9
diff -c -u -p -r1.9 elfread.c
--- elfread.c 2000/05/28 01:12:27 1.9
+++ elfread.c 2000/07/06 17:42:31
@@ -158,7 +158,7 @@ elf_interpreter (abfd)
if (bfd_get_section_contents (abfd, interp_sec, interp, (file_ptr) 0,
size))
{
- interp = savestring (interp, size - 1);
+ interp = gdb_savestring (interp, size - 1);
}
else
{
Index: event-top.c
===================================================================
RCS file: /cvs/src//src/gdb/event-top.c,v
retrieving revision 1.7
diff -c -u -p -r1.7 event-top.c
--- event-top.c 2000/07/05 10:36:41 1.7
+++ event-top.c 2000/07/06 17:42:32
@@ -362,22 +362,22 @@ change_annotation_level (void)
/* Pushes a new prompt on the prompt stack. Each prompt has three
parts: prefix, prompt, suffix. Usually prefix and suffix are empty
strings, except when the annotation level is 2. Memory is allocated
- within savestring for the new prompt. */
+ within gdb_savestring for the new prompt. */
void
push_prompt (char *prefix, char *prompt, char *suffix)
{
the_prompts.top++;
- PREFIX (0) = savestring (prefix, strlen (prefix));
+ PREFIX (0) = gdb_savestring (prefix, strlen (prefix));
/* Note that this function is used by the set annotate 2
command. This is why we take care of saving the old prompt
in case a new one is not specified. */
if (prompt)
- PROMPT (0) = savestring (prompt, strlen (prompt));
+ PROMPT (0) = gdb_savestring (prompt, strlen (prompt));
else
- PROMPT (0) = savestring (PROMPT (-1), strlen (PROMPT (-1)));
+ PROMPT (0) = gdb_savestring (PROMPT (-1), strlen (PROMPT (-1)));
- SUFFIX (0) = savestring (suffix, strlen (suffix));
+ SUFFIX (0) = gdb_savestring (suffix, strlen (suffix));
}
/* Pops the top of the prompt stack, and frees the memory allocated for it. */
@@ -394,7 +394,7 @@ pop_prompt (void)
if (strcmp (PROMPT (0), PROMPT (-1)))
{
free (PROMPT (-1));
- PROMPT (-1) = savestring (PROMPT (0), strlen (PROMPT (0)));
+ PROMPT (-1) = gdb_savestring (PROMPT (0), strlen (PROMPT (0)));
}
free (PREFIX (0));
@@ -698,7 +698,7 @@ command_line_handler (char *rl)
if (*p == '\\')
{
- readline_input_state.linebuffer = savestring (linebuffer,
+ readline_input_state.linebuffer = gdb_savestring (linebuffer,
strlen (linebuffer));
readline_input_state.linebuffer_ptr = p;
@@ -1122,7 +1122,7 @@ set_async_annotation_level (char *args,
void
set_async_prompt (char *args, int from_tty, struct cmd_list_element *c)
{
- PROMPT (0) = savestring (new_async_prompt, strlen (new_async_prompt));
+ PROMPT (0) = gdb_savestring (new_async_prompt, strlen (new_async_prompt));
}
/* Set things up for readline to be invoked via the alternate
Index: hppah-nat.c
===================================================================
RCS file: /cvs/src//src/gdb/hppah-nat.c,v
retrieving revision 1.3
diff -c -u -p -r1.3 hppah-nat.c
--- hppah-nat.c 2000/05/28 01:12:27 1.3
+++ hppah-nat.c 2000/07/06 17:42:32
@@ -1054,7 +1054,7 @@ child_has_execd (pid, execd_pathname)
if (ptrace_state.pe_report_event & PTRACE_EXEC)
{
char *exec_file = target_pid_to_exec_file (pid);
- *execd_pathname = savestring (exec_file, strlen (exec_file));
+ *execd_pathname = gdb_savestring (exec_file, strlen (exec_file));
return 1;
}
Index: infcmd.c
===================================================================
RCS file: /cvs/src//src/gdb/infcmd.c,v
retrieving revision 1.7
diff -c -u -p -r1.7 infcmd.c
--- infcmd.c 2000/05/28 01:12:27 1.7
+++ infcmd.c 2000/07/06 17:42:34
@@ -240,7 +240,7 @@ tty_command (file, from_tty)
if (file == 0)
error_no_arg ("terminal name for running target process");
- inferior_io_terminal = savestring (file, strlen (file));
+ inferior_io_terminal = gdb_savestring (file, strlen (file));
}
static void
@@ -1397,7 +1397,7 @@ set_environment_command (arg, from_tty)
{
nullset = 1;
if (p == 0)
- p = arg + strlen (arg); /* So that savestring below will work */
+ p = arg + strlen (arg); /* So that gdb_savestring below will work */
}
else
{
@@ -1410,7 +1410,7 @@ set_environment_command (arg, from_tty)
while (p != arg && (p[-1] == ' ' || p[-1] == '\t'))
p--;
- var = savestring (arg, p - arg);
+ var = gdb_savestring (arg, p - arg);
if (nullset)
{
printf_filtered ("Setting environment variable ");
@@ -1748,7 +1748,7 @@ attach_command (args, from_tty)
filename. Not much more we can do...)
*/
if (!source_full_path_of (exec_file, &full_exec_path))
- full_exec_path = savestring (exec_file, strlen (exec_file));
+ full_exec_path = gdb_savestring (exec_file, strlen (exec_file));
exec_file_attach (full_exec_path, from_tty);
symbol_file_command (full_exec_path, from_tty);
@@ -2019,7 +2019,7 @@ Register name as argument means describe
add_info ("float", float_info,
"Print the status of the floating point unit\n");
- inferior_args = savestring ("", 1); /* Initially no args */
+ inferior_args = gdb_savestring ("", 1); /* Initially no args */
inferior_environ = make_environ ();
init_environ (inferior_environ);
}
Index: infrun.c
===================================================================
RCS file: /cvs/src//src/gdb/infrun.c,v
retrieving revision 1.16
diff -c -u -p -r1.16 infrun.c
--- infrun.c 2000/06/08 01:52:44 1.16
+++ infrun.c 2000/07/06 17:42:35
@@ -1675,7 +1675,7 @@ handle_inferior_event (struct execution_
target_reported_exec_events_per_exec_call () - 1;
pending_follow.execd_pathname =
- savestring (ecs->ws.value.execd_pathname,
+ gdb_savestring (ecs->ws.value.execd_pathname,
strlen (ecs->ws.value.execd_pathname));
/* Did inferior_pid exec, or did a (possibly not-yet-followed)
Index: infttrace.c
===================================================================
RCS file: /cvs/src//src/gdb/infttrace.c,v
retrieving revision 1.2
diff -c -u -p -r1.2 infttrace.c
--- infttrace.c 2000/02/09 08:52:46 1.2
+++ infttrace.c 2000/07/06 17:42:37
@@ -3598,7 +3598,7 @@ child_has_execd (tid, execd_pathname)
*/
char *exec_file = target_pid_to_exec_file (tid);
- *execd_pathname = savestring (exec_file, strlen (exec_file));
+ *execd_pathname = gdb_savestring (exec_file, strlen (exec_file));
return 1;
}
Index: language.c
===================================================================
RCS file: /cvs/src//src/gdb/language.c,v
retrieving revision 1.6
diff -c -u -p -r1.6 language.c
--- language.c 2000/06/19 10:14:22 1.6
+++ language.c 2000/07/06 17:42:37
@@ -224,7 +224,7 @@ set_language_command (ignore, from_tty)
/* Reset the language (esp. the global string "language") to the
correct values. */
- err_lang = savestring (language, strlen (language));
+ err_lang = gdb_savestring (language, strlen (language));
make_cleanup (free, err_lang); /* Free it after error */
set_language (current_language->la_language);
error ("Unknown language `%s'.", err_lang);
@@ -1594,12 +1594,12 @@ _initialize_language ()
add_language (&local_language_defn);
add_language (&auto_language_defn);
- language = savestring ("auto", strlen ("auto"));
+ language = gdb_savestring ("auto", strlen ("auto"));
set_language_command (language, 0);
- type = savestring ("auto", strlen ("auto"));
+ type = gdb_savestring ("auto", strlen ("auto"));
set_type_command (NULL, 0);
- range = savestring ("auto", strlen ("auto"));
+ range = gdb_savestring ("auto", strlen ("auto"));
set_range_command (NULL, 0);
}
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src//src/gdb/mips-tdep.c,v
retrieving revision 1.22
diff -c -u -p -r1.22 mips-tdep.c
--- mips-tdep.c 2000/06/23 11:06:31 1.22
+++ mips-tdep.c 2000/07/06 17:42:39
@@ -3512,7 +3512,7 @@ mips_read_processor_type ()
prid = read_register (PRID_REGNUM);
if ((prid & ~0xf) == 0x700)
- return savestring ("r3041", strlen ("r3041"));
+ return gdb_savestring ("r3041", strlen ("r3041"));
return NULL;
}
Index: remote-adapt.c
===================================================================
RCS file: /cvs/src//src/gdb/remote-adapt.c,v
retrieving revision 1.2
diff -c -u -p -r1.2 remote-adapt.c
--- remote-adapt.c 2000/02/09 08:52:46 1.2
+++ remote-adapt.c 2000/07/06 17:42:39
@@ -628,7 +628,7 @@ the baud rate, and the name of the progr
if (prog_name != NULL)
free (prog_name);
- prog_name = savestring (p, strlen (p));
+ prog_name = gdb_savestring (p, strlen (p));
adapt_close (0);
Index: remote-eb.c
===================================================================
RCS file: /cvs/src//src/gdb/remote-eb.c,v
retrieving revision 1.2
diff -c -u -p -r1.2 remote-eb.c
--- remote-eb.c 2000/02/09 08:52:46 1.2
+++ remote-eb.c 2000/07/06 17:42:40
@@ -438,7 +438,7 @@ the baud rate, and the name of the progr
if (prog_name != NULL)
free (prog_name);
- prog_name = savestring (p, strlen (p));
+ prog_name = gdb_savestring (p, strlen (p));
eb_close (0);
Index: remote-es.c
===================================================================
RCS file: /cvs/src//src/gdb/remote-es.c,v
retrieving revision 1.3
diff -c -u -p -r1.3 remote-es.c
--- remote-es.c 2000/05/28 01:12:29 1.3
+++ remote-es.c 2000/07/06 17:42:40
@@ -317,7 +317,7 @@ es1800_open (name, from_tty)
{
perror_with_name (name);
}
- savename = savestring (name, strlen (name));
+ savename = gdb_savestring (name, strlen (name));
es1800_saved_ttystate = SERIAL_GET_TTY_STATE (es1800_desc);
Index: remote-mm.c
===================================================================
RCS file: /cvs/src//src/gdb/remote-mm.c,v
retrieving revision 1.2
diff -c -u -p -r1.2 remote-mm.c
--- remote-mm.c 2000/02/09 08:52:47 1.2
+++ remote-mm.c 2000/07/06 17:42:40
@@ -340,7 +340,7 @@ mm_open (name, from_tty)
if (prog_name != NULL)
free (prog_name);
- prog_name = savestring (p, strlen (p));
+ prog_name = gdb_savestring (p, strlen (p));
if (mm_desc >= 0)
Index: remote-nindy.c
===================================================================
RCS file: /cvs/src//src/gdb/remote-nindy.c,v
retrieving revision 1.4
diff -c -u -p -r1.4 remote-nindy.c
--- remote-nindy.c 2000/06/19 18:59:07 1.4
+++ remote-nindy.c 2000/07/06 17:42:41
@@ -207,7 +207,7 @@ nindy_open (name, from_tty)
perror_with_name (name);
}
- savename = savestring (name, strlen (name));
+ savename = gdb_savestring (name, strlen (name));
push_target (&nindy_ops);
target_fetch_registers (-1);
Index: remote-udi.c
===================================================================
RCS file: /cvs/src//src/gdb/remote-udi.c,v
retrieving revision 1.5
diff -c -u -p -r1.5 remote-udi.c
--- remote-udi.c 2000/05/28 01:12:29 1.5
+++ remote-udi.c 2000/07/06 17:42:41
@@ -135,7 +135,7 @@ udi_create_inferior (execfile, args, env
{
if (prog_name != NULL)
free (prog_name);
- prog_name = savestring (execfile, strlen (execfile));
+ prog_name = gdb_savestring (execfile, strlen (execfile));
}
else if (entry.Offset)
execfile = "";
Index: remote-utils.c
===================================================================
RCS file: /cvs/src//src/gdb/remote-utils.c,v
retrieving revision 1.3
diff -c -u -p -r1.3 remote-utils.c
--- remote-utils.c 2000/06/19 18:59:07 1.3
+++ remote-utils.c 2000/07/06 17:42:41
@@ -122,7 +122,7 @@ sr_scan_args (proto, args)
/* check for missing or empty device name. */
CHECKDONE (p, q);
- sr_set_device (savestring (p, q - p));
+ sr_set_device (gdb_savestring (p, q - p));
/* look for baud rate. */
n = strtol (q, &p, 10);
Index: remote-vx.c
===================================================================
RCS file: /cvs/src//src/gdb/remote-vx.c,v
retrieving revision 1.4
diff -c -u -p -r1.4 remote-vx.c
--- remote-vx.c 2000/05/28 01:12:29 1.4
+++ remote-vx.c 2000/07/06 17:42:42
@@ -232,7 +232,7 @@ vx_create_inferior (exec_file, args, env
error ("Can't create process on remote target machine");
/* Save the name of the running function */
- vx_running = savestring (passArgs.arg_array_val[0],
+ vx_running = gdb_savestring (passArgs.arg_array_val[0],
strlen (passArgs.arg_array_val[0]));
push_target (&vx_run_ops);
@@ -292,7 +292,7 @@ parse_args (arg_string, arg_struct)
while (*(arg_string = skip_white_space (arg_string)))
{
p0 = find_white_space (arg_string);
- arg_struct->arg_array_val[arg_index++] = savestring (arg_string,
+ arg_struct->arg_array_val[arg_index++] = gdb_savestring (arg_string,
p0 - arg_string);
arg_string = p0;
}
@@ -1145,7 +1145,7 @@ vx_open (args, from_tty)
push_target (&vx_ops);
/* Save a copy of the target host's name. */
- vx_host = savestring (args, strlen (args));
+ vx_host = gdb_savestring (args, strlen (args));
/* Find out the name of the file from which the target was booted
and load its symbol table. */
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src//src/gdb/rs6000-nat.c,v
retrieving revision 1.7
diff -c -u -p -r1.7 rs6000-nat.c
--- rs6000-nat.c 2000/06/16 21:02:21 1.7
+++ rs6000-nat.c 2000/07/06 17:42:42
@@ -655,8 +655,8 @@ add_vmap (LdInfo *ldi)
filename = LDI_FILENAME (ldi, arch64);
mem = filename + strlen (filename) + 1;
- mem = savestring (mem, strlen (mem));
- objname = savestring (filename, strlen (filename));
+ mem = gdb_savestring (mem, strlen (mem));
+ objname = gdb_savestring (filename, strlen (filename));
fd = LDI_FD (ldi, arch64);
if (fd < 0)
Index: source.c
===================================================================
RCS file: /cvs/src//src/gdb/source.c,v
retrieving revision 1.3
diff -c -u -p -r1.3 source.c
--- source.c 2000/05/28 01:12:29 1.3
+++ source.c 2000/07/06 17:42:43
@@ -380,7 +380,7 @@ mod_path (dirname, which_path)
else if (!ROOTED_P (name) && name[0] != '$')
name = concat (current_directory, SLASH_STRING, name, NULL);
else
- name = savestring (name, p - name);
+ name = gdb_savestring (name, p - name);
make_cleanup (free, name);
/* Unless it's a variable, check existence. */
@@ -608,7 +608,7 @@ done:
if (fd < 0)
*filename_opened = (char *) 0;
else if (ROOTED_P (filename))
- *filename_opened = savestring (filename, strlen (filename));
+ *filename_opened = gdb_savestring (filename, strlen (filename));
else
{
/* Beware the // my son, the Emacs barfs, the botch that catch... */
Index: stabsread.c
===================================================================
RCS file: /cvs/src//src/gdb/stabsread.c,v
retrieving revision 1.5
diff -c -u -p -r1.5 stabsread.c
--- stabsread.c 2000/05/28 01:12:29 1.5
+++ stabsread.c 2000/07/06 17:42:44
@@ -894,7 +894,7 @@ read_cfront_member_functions (fip, pp, t
/* physname used later in mangling; eg PFs_i,5 for foo__1aFPFs_i
physname gets strcat'd in order to recreate the onto mangled name */
pname = get_cfront_method_physname (fname);
- new_sublist->fn_field.physname = savestring (pname, strlen (pname));
+ new_sublist->fn_field.physname = gdb_savestring (pname, strlen (pname));
/* Set this member function's visibility fields.
@@ -3042,13 +3042,13 @@ read_member_functions (fip, pp, type, ob
{
*o++ = *p++;
}
- main_fn_name = savestring (opname, o - opname);
+ main_fn_name = gdb_savestring (opname, o - opname);
/* Skip past '.' */
*pp = p + 1;
}
else
{
- main_fn_name = savestring (*pp, p - *pp);
+ main_fn_name = gdb_savestring (*pp, p - *pp);
/* Skip past '::'. */
*pp = p + 2;
}
@@ -3096,7 +3096,7 @@ read_member_functions (fip, pp, type, ob
TYPE_DOMAIN_TYPE (new_sublist->fn_field.type) = type;
new_sublist->fn_field.is_stub = 1;
}
- new_sublist->fn_field.physname = savestring (*pp, p - *pp);
+ new_sublist->fn_field.physname = gdb_savestring (*pp, p - *pp);
*pp = p + 1;
/* Set this member function's visibility fields. */
@@ -3420,7 +3420,7 @@ read_one_struct_field (fip, pp, p, type,
p++;
}
/* Static class member. */
- SET_FIELD_PHYSNAME (fip->list->field, savestring (*pp, p - *pp));
+ SET_FIELD_PHYSNAME (fip->list->field, gdb_savestring (*pp, p - *pp));
*pp = p + 1;
return;
}
@@ -3908,7 +3908,7 @@ read_cfront_static_fields (fip, pp, type
fip->list->field.type = stype;
/* set bitpos & bitsize */
- SET_FIELD_PHYSNAME (fip->list->field, savestring (sname, strlen (sname)));
+ SET_FIELD_PHYSNAME (fip->list->field, gdb_savestring (sname, strlen (sname)));
/* set name field */
/* The following is code to work around cfront generated stabs.
Index: stack.c
===================================================================
RCS file: /cvs/src//src/gdb/stack.c,v
retrieving revision 1.6
diff -c -u -p -r1.6 stack.c
--- stack.c 2000/06/04 00:41:09 1.6
+++ stack.c 2000/07/06 17:42:44
@@ -760,7 +760,7 @@ parse_frame_specification (frame_exp)
/* Parse an argument. */
for (p = frame_exp; *p && *p != ' '; p++)
;
- addr_string = savestring (frame_exp, p - frame_exp);
+ addr_string = gdb_savestring (frame_exp, p - frame_exp);
{
tmp_cleanup = make_cleanup (free, addr_string);
Index: sun386-nat.c
===================================================================
RCS file: /cvs/src//src/gdb/sun386-nat.c,v
retrieving revision 1.1.1.3
diff -c -u -p -r1.1.1.3 sun386-nat.c
--- sun386-nat.c 1999/07/07 20:10:24 1.1.1.3
+++ sun386-nat.c 2000/07/06 17:42:44
@@ -122,7 +122,7 @@ core_file_command (filename, from_tty)
corestr.c_signo, safe_strsignal (corestr.c_signo));
}
if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
+ corefile = gdb_savestring (filename, strlen (filename));
else
{
corefile = concat (current_directory, "/", filename, NULL);
Index: symtab.c
===================================================================
RCS file: /cvs/src//src/gdb/symtab.c,v
retrieving revision 1.8
diff -c -u -p -r1.8 symtab.c
--- symtab.c 2000/06/14 00:59:07 1.8
+++ symtab.c 2000/07/06 17:42:46
@@ -3389,7 +3389,7 @@ decode_line_2 (sym_arr, nelts, funfirstl
if (canonical_arr[i] == NULL)
{
symname = SYMBOL_NAME (sym_arr[i]);
- canonical_arr[i] = savestring (symname, strlen (symname));
+ canonical_arr[i] = gdb_savestring (symname, strlen (symname));
}
}
}
@@ -3413,7 +3413,7 @@ decode_line_2 (sym_arr, nelts, funfirstl
{
symname = SYMBOL_NAME (sym_arr[num]);
make_cleanup (free, symname);
- canonical_arr[i] = savestring (symname, strlen (symname));
+ canonical_arr[i] = gdb_savestring (symname, strlen (symname));
}
return_values.sals[i++] = values.sals[num];
values.sals[num].pc = 0;
Index: top.c
===================================================================
RCS file: /cvs/src//src/gdb/top.c,v
retrieving revision 1.15
diff -c -u -p -r1.15 top.c
--- top.c 2000/07/05 10:36:41 1.15
+++ top.c 2000/07/06 17:42:47
@@ -870,7 +870,7 @@ build_command_line (type, args)
= (struct command_line **) xmalloc (sizeof (struct command_line *)
* cmd->body_count);
memset (cmd->body_list, 0, sizeof (struct command_line *) * cmd->body_count);
- cmd->line = savestring (args, strlen (args));
+ cmd->line = gdb_savestring (args, strlen (args));
return cmd;
}
@@ -2666,7 +2666,7 @@ read_next_line (command)
*command = (struct command_line *)
xmalloc (sizeof (struct command_line));
(*command)->next = NULL;
- (*command)->line = savestring (p, p1 - p);
+ (*command)->line = gdb_savestring (p, p1 - p);
(*command)->control_type = simple_control;
(*command)->body_count = 0;
(*command)->body_list = NULL;
@@ -3108,7 +3108,7 @@ define_command (comname, from_tty)
}
}
- comname = savestring (comname, strlen (comname));
+ comname = gdb_savestring (comname, strlen (comname));
/* If the rest of the commands will be case insensitive, this one
should behave in the same manner. */
@@ -3124,7 +3124,7 @@ define_command (comname, from_tty)
newc = add_cmd (comname, class_user, user_defined_command,
(c && c->class == class_user)
- ? c->doc : savestring ("User-defined.", 13), &cmdlist);
+ ? c->doc : gdb_savestring ("User-defined.", 13), &cmdlist);
newc->user_commands = cmds;
/* If this new command is a hook, then mark both commands as being
@@ -3507,14 +3507,14 @@ set_prompt (s)
char *s;
{
/* ??rehrauer: I don't know why this fails, since it looks as though
- assignments to prompt are wrapped in calls to savestring...
+ assignments to prompt are wrapped in calls to gdb_savestring...
if (prompt != NULL)
free (prompt);
*/
if (event_loop_p)
- PROMPT (0) = savestring (s, strlen (s));
+ PROMPT (0) = gdb_savestring (s, strlen (s));
else
- gdb_prompt_string = savestring (s, strlen (s));
+ gdb_prompt_string = gdb_savestring (s, strlen (s));
}
@@ -3674,7 +3674,7 @@ cd_command (dir, from_tty)
len--;
}
- dir = savestring (dir, len);
+ dir = gdb_savestring (dir, len);
if (ROOTED_P (dir))
current_directory = dir;
else
@@ -3797,7 +3797,7 @@ source_command (args, from_tty)
source_line_number = 0;
source_file_name = file;
source_pre_error = error_pre_print == NULL ? "" : error_pre_print;
- source_pre_error = savestring (source_pre_error, strlen (source_pre_error));
+ source_pre_error = gdb_savestring (source_pre_error, strlen (source_pre_error));
make_cleanup (free, source_pre_error);
/* This will get set every time we read a line. So it won't stay "" for
long. */
@@ -4082,7 +4082,7 @@ init_history ()
tmpenv = getenv ("GDBHISTFILE");
if (tmpenv)
- history_filename = savestring (tmpenv, strlen (tmpenv));
+ history_filename = gdb_savestring (tmpenv, strlen (tmpenv));
else if (!history_filename)
{
/* We include the current directory so that if the user changes
@@ -4107,7 +4107,7 @@ init_main ()
we initialize the prompts differently. */
if (!event_loop_p)
{
- gdb_prompt_string = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
+ gdb_prompt_string = gdb_savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
}
else
{
@@ -4115,13 +4115,13 @@ init_main ()
whatever the DEFAULT_PROMPT is. */
the_prompts.top = 0;
PREFIX (0) = "";
- PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
+ PROMPT (0) = gdb_savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
SUFFIX (0) = "";
/* Set things up for annotation_level > 1, if the user ever decides
to use it. */
async_annotation_suffix = "prompt";
/* Set the variable associated with the setshow prompt command. */
- new_async_prompt = savestring (PROMPT (0), strlen (PROMPT (0)));
+ new_async_prompt = gdb_savestring (PROMPT (0), strlen (PROMPT (0)));
}
gdb_prompt_escape = 0; /* default to none. */
Index: tracepoint.c
===================================================================
RCS file: /cvs/src//src/gdb/tracepoint.c,v
retrieving revision 1.7
diff -c -u -p -r1.7 tracepoint.c
--- tracepoint.c 2000/06/04 00:41:09 1.7
+++ tracepoint.c 2000/07/06 17:42:48
@@ -352,7 +352,7 @@ set_raw_tracepoint (sal)
if (sal.symtab == NULL)
t->source_file = NULL;
else
- t->source_file = savestring (sal.symtab->filename,
+ t->source_file = gdb_savestring (sal.symtab->filename,
strlen (sal.symtab->filename));
t->section = sal.section;
@@ -425,7 +425,7 @@ trace_command (arg, from_tty)
if (canonical != (char **) NULL && canonical[i] != NULL)
t->addr_string = canonical[i];
else if (addr_start)
- t->addr_string = savestring (addr_start, addr_end - addr_start);
+ t->addr_string = gdb_savestring (addr_start, addr_end - addr_start);
trace_mention (t);
@@ -1428,7 +1428,7 @@ stringify_collection_list (list, string)
sprintf (end, "%02X", list->regs_mask[i]);
end += 2;
}
- (*str_list)[ndx] = savestring (temp_buf, end - temp_buf);
+ (*str_list)[ndx] = gdb_savestring (temp_buf, end - temp_buf);
ndx++;
}
if (info_verbose)
@@ -1448,7 +1448,7 @@ stringify_collection_list (list, string)
}
if (count + 27 > MAX_AGENT_EXPR_LEN)
{
- (*str_list)[ndx] = savestring (temp_buf, count);
+ (*str_list)[ndx] = gdb_savestring (temp_buf, count);
ndx++;
count = 0;
end = temp_buf;
@@ -1468,7 +1468,7 @@ stringify_collection_list (list, string)
QUIT; /* allow user to bail out with ^C */
if ((count + 10 + 2 * list->aexpr_list[i]->len) > MAX_AGENT_EXPR_LEN)
{
- (*str_list)[ndx] = savestring (temp_buf, count);
+ (*str_list)[ndx] = gdb_savestring (temp_buf, count);
ndx++;
count = 0;
end = temp_buf;
@@ -1483,7 +1483,7 @@ stringify_collection_list (list, string)
if (count != 0)
{
- (*str_list)[ndx] = savestring (temp_buf, count);
+ (*str_list)[ndx] = gdb_savestring (temp_buf, count);
ndx++;
count = 0;
end = temp_buf;
Index: umax-xdep.c
===================================================================
RCS file: /cvs/src//src/gdb/umax-xdep.c,v
retrieving revision 1.1.1.3
diff -c -u -p -r1.1.1.3 umax-xdep.c
--- umax-xdep.c 1999/07/07 20:10:55 1.1.1.3
+++ umax-xdep.c 2000/07/06 17:42:48
@@ -118,7 +118,7 @@ core_file_command (filename, from_tty)
}
}
if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
+ corefile = gdb_savestring (filename, strlen (filename));
else
{
corefile = concat (current_directory, "/", filename, NULL);
Index: utils.c
===================================================================
RCS file: /cvs/src//src/gdb/utils.c,v
retrieving revision 1.18
diff -c -u -p -r1.18 utils.c
--- utils.c 2000/06/15 20:40:29 1.18
+++ utils.c 2000/07/06 17:42:48
@@ -1148,7 +1148,7 @@ myread (desc, addr, len)
Uses malloc to get the space. Returns the address of the copy. */
char *
-savestring (ptr, size)
+gdb_savestring (ptr, size)
const char *ptr;
int size;
{
@@ -1174,7 +1174,7 @@ char *
strsave (ptr)
const char *ptr;
{
- return savestring (ptr, strlen (ptr));
+ return gdb_savestring (ptr, strlen (ptr));
}
char *
Index: values.c
===================================================================
RCS file: /cvs/src//src/gdb/values.c,v
retrieving revision 1.7
diff -c -u -p -r1.7 values.c
--- values.c 2000/06/09 00:51:55 1.7
+++ values.c 2000/07/06 17:42:49
@@ -1153,7 +1153,7 @@ value_headof (in_arg, btype, dtype)
FIXME: there has to be a better way to do this. */
struct type *error_type = (struct type *) xmalloc (sizeof (struct type));
memcpy (error_type, VALUE_TYPE (in_arg), sizeof (struct type));
- TYPE_NAME (error_type) = savestring ("suspicious *", sizeof ("suspicious *"));
+ TYPE_NAME (error_type) = gdb_savestring ("suspicious *", sizeof ("suspicious *"));
VALUE_TYPE (in_arg) = error_type;
return in_arg;
}
Index: varobj.c
===================================================================
RCS file: /cvs/src//src/gdb/varobj.c,v
retrieving revision 1.6
diff -c -u -p -r1.6 varobj.c
--- varobj.c 2000/06/04 00:41:09 1.6
+++ varobj.c 2000/07/06 17:42:49
@@ -462,7 +462,7 @@ varobj_create (char *objname,
var->format = variable_default_display (var);
var->root->valid_block = innermost_block;
- var->name = savestring (expression, strlen (expression));
+ var->name = gdb_savestring (expression, strlen (expression));
/* When the frame is different from the current frame,
we must select the appropriate frame before parsing
@@ -507,7 +507,7 @@ varobj_create (char *objname,
if ((var != NULL) && (objname != NULL))
{
- var->obj_name = savestring (objname, strlen (objname));
+ var->obj_name = gdb_savestring (objname, strlen (objname));
/* If a varobj name is duplicated, the install will fail so
we must clenup */
@@ -1677,7 +1677,7 @@ value_of_root (var_handle, type_changed)
if (*type_changed)
{
tmp_var->obj_name =
- savestring (var->obj_name, strlen (var->obj_name));
+ gdb_savestring (var->obj_name, strlen (var->obj_name));
uninstall_variable (var);
}
else
@@ -1841,7 +1841,7 @@ static char *
c_name_of_variable (parent)
struct varobj *parent;
{
- return savestring (parent->name, strlen (parent->name));
+ return gdb_savestring (parent->name, strlen (parent->name));
}
static char *
@@ -1873,7 +1873,7 @@ c_name_of_child (parent, index)
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
string = TYPE_FIELD_NAME (type, index);
- name = savestring (string, strlen (string));
+ name = gdb_savestring (string, strlen (string));
break;
case TYPE_CODE_PTR:
@@ -1882,7 +1882,7 @@ c_name_of_child (parent, index)
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
string = TYPE_FIELD_NAME (target, index);
- name = savestring (string, strlen (string));
+ name = gdb_savestring (string, strlen (string));
break;
default:
@@ -2317,7 +2317,7 @@ cplus_name_of_child (parent, index)
else
{
if (name != NULL)
- name = savestring (name, strlen (name));
+ name = gdb_savestring (name, strlen (name));
}
return name;
Index: xcoffread.c
===================================================================
RCS file: /cvs/src//src/gdb/xcoffread.c,v
retrieving revision 1.5
diff -c -u -p -r1.5 xcoffread.c
--- xcoffread.c 2000/06/16 21:02:21 1.5
+++ xcoffread.c 2000/07/06 17:42:50
@@ -865,7 +865,7 @@ enter_line_range (subfile, beginoffset,
text address for the file, and SIZE is the number of bytes of text. */
#define complete_symtab(name, start_addr) { \
- last_source_file = savestring (name, strlen (name)); \
+ last_source_file = gdb_savestring (name, strlen (name)); \
last_source_start_addr = start_addr; \
}