This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] mi, remove unused variables
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 05 May 2010 15:17:50 -0700
- Subject: [PATCH] mi, remove unused variables
2010-05-05 Michael Snyder <msnyder@vmware.com>
* mi/mi-out.c (mi_table_begin): Delete unused variable.
* mi/mi-cmd-var.c (print_varobj): Delete unused variable.
(mi_cmd_var_list_children): Delete unused variable.
(varobj_update_one): Delete unused variable.
* mi/mi-cmd-break.c (mi_cmd_break_insert): Delete unused variables.
* mi/mi-cmd-stack.c (mi_cmd_stack_list_locals):
Delete unused variable.
(mi_cmd_stack_list_variables): Delete unused variable.
(list_args_or_locals): Delete unused variable.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file):
Delete unused variables.
(mi_cmd_file_list_exec_source_files): Delete unused variable.
* mi/mi-cmd-target.c (mi_cmd_target_file_delete):
Delete unused variable.
* mi/mi-interp.c (mi_interpreter_exec): Delete unused variable.
(mi_cmd_interpreter_exec): Delete unused variable.
(mi_on_normal_stop): Delete unused variable.
* mi/mi-main.c (run_one_inferior): Delete unused variable.
(print_one_inferior): Delete unused variables.
(mi_execute_command): Delete unused variable.
(mi_cmd_execute): Delete unused variable.
(timestamp): Delete unused variable.
Index: mi/mi-cmd-break.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-break.c,v
retrieving revision 1.33
diff -u -p -r1.33 mi-cmd-break.c
--- mi/mi-cmd-break.c 4 Apr 2010 23:47:15 -0000 1.33
+++ mi/mi-cmd-break.c 5 May 2010 22:16:06 -0000
@@ -66,7 +66,6 @@ void
mi_cmd_break_insert (char *command, char **argv, int argc)
{
char *address = NULL;
- enum bp_type type = REG_BP;
int hardware = 0;
int temp_p = 0;
int thread = -1;
@@ -77,8 +76,6 @@ mi_cmd_break_insert (char *command, char
int tracepoint = 0;
struct cleanup *back_to;
- struct gdb_exception e;
- struct gdb_events *old_hooks;
enum opt
{
HARDWARE_OPT, TEMP_OPT, CONDITION_OPT,
Index: mi/mi-cmd-file.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-file.c,v
retrieving revision 1.12
diff -u -p -r1.12 mi-cmd-file.c
--- mi/mi-cmd-file.c 10 Mar 2010 18:20:08 -0000 1.12
+++ mi/mi-cmd-file.c 5 May 2010 22:16:06 -0000
@@ -34,8 +34,6 @@ void
mi_cmd_file_list_exec_source_file (char *command, char **argv, int argc)
{
struct symtab_and_line st;
- int optind = 0;
- char *optarg;
if (!mi_valid_noargs ("mi_cmd_file_list_exec_source_file", argc, argv))
error (_("mi_cmd_file_list_exec_source_file: Usage: No args"));
@@ -83,7 +81,6 @@ void
mi_cmd_file_list_exec_source_files (char *command, char **argv, int argc)
{
struct symtab *s;
- struct partial_symtab *ps;
struct objfile *objfile;
if (!mi_valid_noargs ("mi_cmd_file_list_exec_source_files", argc, argv))
Index: mi/mi-cmd-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-stack.c,v
retrieving revision 1.49
diff -u -p -r1.49 mi-cmd-stack.c
--- mi/mi-cmd-stack.c 10 Feb 2010 22:22:02 -0000 1.49
+++ mi/mi-cmd-stack.c 5 May 2010 22:16:06 -0000
@@ -145,7 +145,6 @@ void
mi_cmd_stack_list_locals (char *command, char **argv, int argc)
{
struct frame_info *frame;
- enum print_values print_values;
if (argc != 1)
error (_("mi_cmd_stack_list_locals: Usage: PRINT_VALUES"));
@@ -223,7 +222,6 @@ void
mi_cmd_stack_list_variables (char *command, char **argv, int argc)
{
struct frame_info *frame;
- enum print_values print_values;
if (argc != 1)
error (_("Usage: PRINT_VALUES"));
@@ -244,7 +242,6 @@ list_args_or_locals (enum what_to_list w
struct block *block;
struct symbol *sym;
struct dict_iterator iter;
- int nsyms;
struct cleanup *cleanup_list;
static struct ui_stream *stb = NULL;
struct type *type;
Index: mi/mi-cmd-target.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-target.c,v
retrieving revision 1.5
diff -u -p -r1.5 mi-cmd-target.c
--- mi/mi-cmd-target.c 1 Jan 2010 07:31:50 -0000 1.5
+++ mi/mi-cmd-target.c 5 May 2010 22:16:06 -0000
@@ -76,7 +76,7 @@ mi_cmd_target_file_delete (char *command
{
int optind = 0;
char *optarg;
- const char *remote_file, *local_file;
+ const char *remote_file;
static struct mi_opt opts[] =
{
{ 0, 0, 0 }
Index: mi/mi-cmd-var.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-var.c,v
retrieving revision 1.62
diff -u -p -r1.62 mi-cmd-var.c
--- mi/mi-cmd-var.c 1 Jan 2010 07:31:50 -0000 1.62
+++ mi/mi-cmd-var.c 5 May 2010 22:16:06 -0000
@@ -50,7 +50,6 @@ static void
print_varobj (struct varobj *var, enum print_values print_values,
int print_expression)
{
- struct type *gdb_type;
char *type;
int thread_id;
char *display_hint;
@@ -394,7 +393,6 @@ mi_cmd_var_list_children (char *command,
struct varobj *var;
VEC(varobj_p) *children;
struct varobj *child;
- int numchild;
enum print_values print_values;
int ix;
int from, to;
@@ -712,7 +710,6 @@ static void
varobj_update_one (struct varobj *var, enum print_values print_values,
int explicit)
{
- struct varobj **cc;
struct cleanup *cleanup = NULL;
VEC (varobj_update_result) *changes;
varobj_update_result *r;
Index: mi/mi-interp.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-interp.c,v
retrieving revision 1.56
diff -u -p -r1.56 mi-interp.c
--- mi/mi-interp.c 2 May 2010 21:14:59 -0000 1.56
+++ mi/mi-interp.c 5 May 2010 22:16:06 -0000
@@ -169,7 +169,6 @@ mi_interpreter_suspend (void *data)
static struct gdb_exception
mi_interpreter_exec (void *data, const char *command)
{
- static struct gdb_exception ok;
char *tmp = alloca (strlen (command) + 1);
strcpy (tmp, command);
mi_execute_command_wrapper (tmp);
@@ -188,7 +187,6 @@ mi_cmd_interpreter_exec (char *command,
{
struct interp *interp_to_use;
int i;
- struct interp_procs *procs;
char *mi_error_message = NULL;
struct cleanup *old_chain;
@@ -375,7 +373,6 @@ mi_on_normal_stop (struct bpstats *bs, i
using cli interpreter, be sure to use MI uiout for output,
not the current one. */
struct ui_out *mi_uiout = interp_ui_out (top_level_interpreter ());
- struct mi_interp *mi = top_level_interpreter_data ();
if (print_frame)
{
Index: mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.174
diff -u -p -r1.174 mi-main.c
--- mi/mi-main.c 23 Mar 2010 22:05:46 -0000 1.174
+++ mi/mi-main.c 5 May 2010 22:16:06 -0000
@@ -358,8 +358,6 @@ mi_cmd_exec_interrupt (char *command, ch
static int
run_one_inferior (struct inferior *inf, void *arg)
{
- struct thread_info *tp = 0;
-
if (inf->pid != 0)
{
if (inf->pid != ptid_get_pid (inferior_ptid))
@@ -559,8 +557,6 @@ print_one_inferior (struct inferior *inf
if (!VEC_empty (int, data.cores))
{
- int elt;
- int i;
int *b, *e;
struct cleanup *back_to_2 =
make_cleanup_ui_out_list_begin_end (uiout, "cores");
@@ -1702,7 +1698,6 @@ void
mi_execute_command (char *cmd, int from_tty)
{
struct mi_parse *command;
- struct ui_out *saved_uiout = uiout;
/* This is to handle EOF (^D). We just quit gdb. */
/* FIXME: we should call some API function here. */
@@ -1793,7 +1788,6 @@ static void
mi_cmd_execute (struct mi_parse *parse)
{
struct cleanup *cleanup;
- int i;
prepare_execute_command ();
@@ -2027,7 +2021,6 @@ mi_load_progress (const char *section_na
static void
timestamp (struct mi_timestamp *tv)
{
- long usec;
gettimeofday (&tv->wallclock, NULL);
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &rusage);
@@ -2036,11 +2029,14 @@ timestamp (struct mi_timestamp *tv)
tv->stime.tv_sec = rusage.ru_stime.tv_sec;
tv->stime.tv_usec = rusage.ru_stime.tv_usec;
#else
- usec = get_run_time ();
- tv->utime.tv_sec = usec/1000000L;
- tv->utime.tv_usec = usec - 1000000L*tv->utime.tv_sec;
- tv->stime.tv_sec = 0;
- tv->stime.tv_usec = 0;
+ {
+ long usec = get_run_time ();
+
+ tv->utime.tv_sec = usec/1000000L;
+ tv->utime.tv_usec = usec - 1000000L*tv->utime.tv_sec;
+ tv->stime.tv_sec = 0;
+ tv->stime.tv_usec = 0;
+ }
#endif
}
Index: mi/mi-out.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-out.c,v
retrieving revision 1.37
diff -u -p -r1.37 mi-out.c
--- mi/mi-out.c 2 May 2010 21:14:59 -0000 1.37
+++ mi/mi-out.c 5 May 2010 22:16:06 -0000
@@ -106,7 +106,6 @@ mi_table_begin (struct ui_out *uiout,
int nr_rows,
const char *tblid)
{
- mi_out_data *data = ui_out_data (uiout);
mi_open (uiout, tblid, ui_out_type_tuple);
mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
"nr_rows", nr_rows);