aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
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/mi
parent6fa957a9b9408297206fb88e7c773931760f0528 (diff)
downloadgdb-b8c9b27d1e133d46199734ca1f047af8bb2d3314.zip
gdb-b8c9b27d1e133d46199734ca1f047af8bb2d3314.tar.gz
gdb-b8c9b27d1e133d46199734ca1f047af8bb2d3314.tar.bz2
Replace free() with xfree().
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-disas.c8
-rw-r--r--gdb/mi/mi-cmd-var.c16
-rw-r--r--gdb/mi/mi-console.c2
-rw-r--r--gdb/mi/mi-main.c20
-rw-r--r--gdb/mi/mi-parse.c8
5 files changed, 27 insertions, 27 deletions
diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c
index bbd1c00..accddd5 100644
--- a/gdb/mi/mi-cmd-disas.c
+++ b/gdb/mi/mi-cmd-disas.c
@@ -428,9 +428,9 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
ui_out_field_int (uiout, "offset", offset);
}
if (filename != NULL)
- free (filename);
+ xfree (filename);
if (name != NULL)
- free (name);
+ xfree (name);
ui_file_rewind (stb->stream);
pc += (*tm_print_insn) (pc, &di);
@@ -476,9 +476,9 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
ui_out_field_int (uiout, "offset", offset);
}
if (filename != NULL)
- free (filename);
+ xfree (filename);
if (name != NULL)
- free (name);
+ xfree (name);
ui_file_rewind (stb->stream);
pc += (*tm_print_insn) (pc, &di);
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index a5caa2a..c557a9c 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -64,13 +64,13 @@ mi_cmd_var_create (char *command, char **argv, int argc)
old_cleanups = make_cleanup (free_current_contents, &name);
frame = xstrdup (argv[1]);
- old_cleanups = make_cleanup (free, frame);
+ old_cleanups = make_cleanup (xfree, frame);
expr = xstrdup (argv[2]);
if (strcmp (name, "-") == 0)
{
- free (name);
+ xfree (name);
name = varobj_gen_name ();
}
else if (!isalpha (*name))
@@ -104,7 +104,7 @@ mi_cmd_var_create (char *command, char **argv, int argc)
else
{
ui_out_field_string (uiout, "type", type);
- free (type);
+ xfree (type);
}
do_cleanups (old_cleanups);
@@ -147,9 +147,9 @@ mi_cmd_var_delete (char *command, char **argv, int argc)
if (strcmp (name, "-c") != 0)
error ("mi_cmd_var_delete: Invalid option.");
children_only_p = 1;
- free (name);
+ xfree (name);
name = xstrdup (expr);
- free (expr);
+ xfree (expr);
}
/* If we didn't error out, now NAME contains the name of the
@@ -289,7 +289,7 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
cc++;
}
ui_out_list_end (uiout);
- free (childlist);
+ xfree (childlist);
return MI_CMD_DONE;
}
@@ -433,7 +433,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
varobj_update_one (*cr);
cr++;
}
- free (rootlist);
+ xfree (rootlist);
ui_out_list_end (uiout);
}
else
@@ -494,7 +494,7 @@ varobj_update_one (struct varobj *var)
ui_out_field_string (uiout, "type_changed", "false");
cc++;
}
- free (changelist);
+ xfree (changelist);
return 1;
}
return 1;
diff --git a/gdb/mi/mi-console.c b/gdb/mi/mi-console.c
index 8df51ab..b27d14e 100644
--- a/gdb/mi/mi-console.c
+++ b/gdb/mi/mi-console.c
@@ -66,7 +66,7 @@ mi_console_file_delete (struct ui_file *file)
struct mi_console_file *mi_console = ui_file_data (file);
if (mi_console->magic != &mi_console_file_magic)
internal_error ("mi_console_file_delete: bad magic number");
- free (mi_console);
+ xfree (mi_console);
}
static void
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 75fd435..1472039 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -204,10 +204,10 @@ mi_cmd_exec_interrupt (char *args, int from_tty)
if (last_async_command)
fputs_unfiltered (last_async_command, raw_stdout);
fputs_unfiltered ("^done", raw_stdout);
- free (last_async_command);
+ xfree (last_async_command);
if (previous_async_command)
last_async_command = xstrdup (previous_async_command);
- free (previous_async_command);
+ xfree (previous_async_command);
previous_async_command = NULL;
mi_out_put (uiout, raw_stdout);
mi_out_rewind (uiout);
@@ -697,7 +697,7 @@ mi_cmd_target_download (char *args, int from_tty)
struct cleanup *old_cleanups = NULL;
xasprintf (&run, "load %s", args);
- old_cleanups = make_cleanup (free, run);
+ old_cleanups = make_cleanup (xfree, run);
execute_command (run, from_tty);
do_cleanups (old_cleanups);
@@ -712,7 +712,7 @@ mi_cmd_target_select (char *args, int from_tty)
struct cleanup *old_cleanups = NULL;
xasprintf (&run, "target %s", args);
- old_cleanups = make_cleanup (free, run);
+ old_cleanups = make_cleanup (xfree, run);
/* target-select is always synchronous. once the call has returned
we know that we are connected. */
@@ -859,7 +859,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
/* create a buffer and read it in. */
total_bytes = word_size * nr_rows * nr_cols;
mbuf = calloc (total_bytes, 1);
- make_cleanup (free, mbuf);
+ make_cleanup (xfree, mbuf);
if (mbuf == NULL)
{
xasprintf (&mi_error_message,
@@ -1075,7 +1075,7 @@ captured_mi_execute_command (void *data)
fputs_unfiltered (context->token, raw_stdout);
fputs_unfiltered ("^error,msg=\"", raw_stdout);
fputstr_unfiltered (mi_error_message, '"', raw_stdout);
- free (mi_error_message);
+ xfree (mi_error_message);
fputs_unfiltered ("\"\n", raw_stdout);
}
mi_out_rewind (uiout);
@@ -1145,7 +1145,7 @@ mi_execute_command (char *cmd, int from_tty)
if (rc == 0)
{
char *msg = error_last_message ();
- struct cleanup *cleanup = make_cleanup (free, msg);
+ struct cleanup *cleanup = make_cleanup (xfree, msg);
/* The command execution failed and error() was called
somewhere */
fputs_unfiltered (command->token, raw_stdout);
@@ -1248,7 +1248,7 @@ mi_execute_cli_command (const char *cli, char *args)
/* FIXME: gdb_???? */
fprintf_unfiltered (gdb_stdout, "cli=%s run=%s\n",
cli, run);
- old_cleanups = make_cleanup (free, run);
+ old_cleanups = make_cleanup (xfree, run);
execute_command ( /*ui */ run, 0 /*from_tty */ );
do_cleanups (old_cleanups);
return;
@@ -1275,7 +1275,7 @@ mi_execute_async_cli_command (char *mi, char *args, int from_tty)
else
{
xasprintf (&run, "%s %s", mi, args);
- old_cleanups = make_cleanup (free, run);
+ old_cleanups = make_cleanup (xfree, run);
}
if (!target_can_async_p ())
@@ -1369,7 +1369,7 @@ mi_load_progress (const char *section_name,
strcmp (previous_sect_name, section_name) : 1);
if (new_section)
{
- free (previous_sect_name);
+ xfree (previous_sect_name);
previous_sect_name = xstrdup (section_name);
if (last_async_command)
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index a739043..41e0351 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -136,14 +136,14 @@ mi_parse_free (struct mi_parse *parse)
if (parse == NULL)
return;
if (parse->command != NULL)
- free (parse->command);
+ xfree (parse->command);
if (parse->token != NULL)
- free (parse->token);
+ xfree (parse->token);
if (parse->args != NULL)
- free (parse->args);
+ xfree (parse->args);
if (parse->argv != NULL)
freeargv (parse->argv);
- free (parse);
+ xfree (parse);
}