aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2000-12-15 01:01:51 +0000
committerKevin Buettner <kevinb@redhat.com>2000-12-15 01:01:51 +0000
commitb8c9b27d1e133d46199734ca1f047af8bb2d3314 (patch)
tree1aa002791f0e97bfc48c64222199e6d9f9e5eb53 /gdb/cli
parent6fa957a9b9408297206fb88e7c773931760f0528 (diff)
downloadgdb-b8c9b27d1e133d46199734ca1f047af8bb2d3314.zip
gdb-b8c9b27d1e133d46199734ca1f047af8bb2d3314.tar.gz
gdb-b8c9b27d1e133d46199734ca1f047af8bb2d3314.tar.bz2
Replace free() with xfree().
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c8
-rw-r--r--gdb/cli/cli-decode.c10
-rw-r--r--gdb/cli/cli-script.c12
-rw-r--r--gdb/cli/cli-setshow.c6
4 files changed, 18 insertions, 18 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 557e1fd..edf9b4d 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -227,7 +227,7 @@ complete_command (char *arg, int from_tty)
completion = line_completion_function (arg, ++i, arg, argpoint))
{
printf_unfiltered ("%s\n", completion);
- free (completion);
+ xfree (completion);
}
}
@@ -287,7 +287,7 @@ cd_command (char *dir, int from_tty)
error_no_arg ("new working directory");
dir = tilde_expand (dir);
- make_cleanup (free, dir);
+ make_cleanup (xfree, dir);
if (chdir (dir) < 0)
perror_with_name (dir);
@@ -321,7 +321,7 @@ cd_command (char *dir, int from_tty)
current_directory = concat (current_directory, dir, NULL);
else
current_directory = concat (current_directory, SLASH_STRING, dir, NULL);
- free (dir);
+ xfree (dir);
}
/* Now simplify any occurrences of `.' and `..' in the pathname. */
@@ -383,7 +383,7 @@ source_command (char *args, int from_tty)
}
file = tilde_expand (file);
- old_cleanups = make_cleanup (free, file);
+ old_cleanups = make_cleanup (xfree, file);
stream = fopen (file, FOPEN_RT);
if (!stream)
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 2889efc..42c1267 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -346,7 +346,7 @@ delete_cmd (char *name, struct cmd_list_element **list)
if ((*list)->hookee_post)
(*list)->hookee_post->hook_post = 0; /* Hook slips out of its bottom */
p = (*list)->next;
- free ((PTR) * list);
+ xfree (* list);
*list = p;
}
@@ -361,7 +361,7 @@ delete_cmd (char *name, struct cmd_list_element **list)
c->next->hookee_post->hook_post = 0; /* remove post hook */
/* :( no fishing metaphore */
p = c->next->next;
- free ((PTR) c->next);
+ xfree (c->next);
c->next = p;
}
else
@@ -626,7 +626,7 @@ print_doc_line (struct ui_file *stream, char *str)
if (p - str > line_size - 1)
{
line_size = p - str + 1;
- free ((PTR) line_buffer);
+ xfree (line_buffer);
line_buffer = (char *) xmalloc (line_size);
}
strncpy (line_buffer, str, p - str);
@@ -1258,7 +1258,7 @@ complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word)
if (matches == 0)
{
- free ((PTR) matchlist);
+ xfree (matchlist);
matchlist = 0;
}
else
@@ -1329,7 +1329,7 @@ complete_on_enum (const char *enumlist[],
if (matches == 0)
{
- free ((PTR) matchlist);
+ xfree (matchlist);
matchlist = 0;
}
else
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 67a6515..66aa4fa 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -516,7 +516,7 @@ arg_cleanup (void *ignore)
internal_error ("Internal error, arg_cleanup called with no user args.\n");
user_args = user_args->next;
- free (oargs);
+ xfree (oargs);
}
/* Bind the incomming arguments for a user defined command to
@@ -701,7 +701,7 @@ realloc_body_list (struct command_line *command, int new_length)
memcpy (body_list, command->body_list, sizeof (struct command_line *) * n);
- free (command->body_list);
+ xfree (command->body_list);
command->body_list = body_list;
command->body_count = new_length;
}
@@ -1022,8 +1022,8 @@ free_command_lines (struct command_line **lptr)
free_command_lines (blist);
}
next = l->next;
- free (l->line);
- free ((PTR) l);
+ xfree (l->line);
+ xfree (l);
l = next;
}
}
@@ -1192,7 +1192,7 @@ document_command (char *comname, int from_tty)
doclines = read_command_lines (tmpbuf, from_tty);
if (c->doc)
- free (c->doc);
+ xfree (c->doc);
{
register struct command_line *cl1;
@@ -1266,7 +1266,7 @@ script_from_file (FILE *stream, char *file)
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));
- make_cleanup (free, source_pre_error);
+ make_cleanup (xfree, source_pre_error);
/* This will get set every time we read a line. So it won't stay "" for
long. */
error_pre_print = "";
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index eebcf5e..b6cbfed 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -146,7 +146,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
*q++ = '\0';
new = (char *) xrealloc (new, q - new);
if (*(char **) c->var != NULL)
- free (*(char **) c->var);
+ xfree (*(char **) c->var);
*(char **) c->var = new;
}
break;
@@ -154,14 +154,14 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
if (arg == NULL)
arg = "";
if (*(char **) c->var != NULL)
- free (*(char **) c->var);
+ xfree (*(char **) c->var);
*(char **) c->var = savestring (arg, strlen (arg));
break;
case var_filename:
if (arg == NULL)
error_no_arg ("filename to set it to.");
if (*(char **) c->var != NULL)
- free (*(char **) c->var);
+ xfree (*(char **) c->var);
*(char **) c->var = tilde_expand (arg);
break;
case var_boolean: