2013-01-31 Aleksandar Ristovski <aristovski@qnx.com>

* charset.c (intermediate_encoding): Remove unused i.
	* completer.c (signal_completer): Remove unused i.
	* continuations.c (discard_my_continuations_1): Remove unused
	continuation_ptr.
	* corelow.c (core_close): Remove unuseD name.
	(get_core_siginfo): Remove unused pid.
	* cp-namespace.c (cp_lookup_symbol_imports_or_template): Remove unused
	i, cps.
	* dwarf2loc.c (dwarf2_compile_expr_to_ax): Remove unused base_offset.
	(loclist_describe_location): Remove unused first.
	* event-top.c (command_line_handler): Remove unused got_eof.
	* exec.c (exec_close_1): Remove unused need_symtab_cleanup.
	(resize_section_table): Remove unused old_value.
	* gdb_bfd.c (gdb_bfd_map_section): Remove unused header.
	* gnu-v3-abi.c (compute_vtable_size): Remove unused addr.
	* i386-tdep.c (i386_process_record): Remove unused rex.
	* infcmd.c (get_return_value): Remove unused uiout.
	* jv-lang.c (type_from_class): Remove unused is_array.
	* jv-valprint.c (java_val_print): Remove unused i.
	* linux-nat.c (linux_nat_stop_lwp): Remove unused ptid.
	* linux-thread-db.c (thread_db_find_new_threads_2): Remove unuseD pid.
	* m2-typeprint.c (m2_print_type): Remove unused code.
	* macroexp.c (get_character_constant): Remove unused body_start.
	(macro_stringify): Remove unused result.
	* objc-lang.c (find_methods): Remove unused gdbarch.
	* objfiles.c (filter_overlapping_sections): Remove unused abfd1, abfd2.
	* regcache.c (regcache_cooked_read): Remove unused gdbarch.
	* stack.c (print_frame_args): Remove unused summary.
	* thread.c (thread_apply_command): Remove unused p.
	* valarith.c (value_x_unop): Remove unused mangle_ptr.
	* valops.c (search_struct_method): Remove unused skip.
	* valprint.c (generic_val_print): Remove unused byte_order.
	* varobj.c (varobj_update): Remove unused changed.
	* cli/cli-cmds.c (complete_command): Remove unused next_item.
	(alias_command): Remove unused c.
	* mi/mi-cmd-catch.c (mi_catch_load_unload): Remove unused c.
	* mi/mi-main.c (mi_cmd_data_write_register_values): Remove unused
	format.
	(mi_cmd_data_write_memory): Remove unused word_format.
	(mi_cmd_data_write_memory_bytes): Remove unused r.
	* python/py-gdb-readline.c (gdbpy_readline_wrapper): Remove unused
	p_start, p_end.
	* python/python.c (_initialize_python): Remove unused cmd_name, cmd.
	* tui/tui-disasm.c (tui_set_disassem_content): Remove unused
	line_width.

Reference: http://sourceware.org/ml/gdb-patches/2013-01/msg00766.html
This commit is contained in:
Aleksandar Ristovski 2013-01-31 18:37:39 +00:00
parent c656bca578
commit 5799c0b969
34 changed files with 53 additions and 73 deletions

View File

@ -1,3 +1,51 @@
2013-01-31 Aleksandar Ristovski <aristovski@qnx.com>
* charset.c (intermediate_encoding): Remove unused i.
* completer.c (signal_completer): Remove unused i.
* continuations.c (discard_my_continuations_1): Remove unused
continuation_ptr.
* corelow.c (core_close): Remove unuseD name.
(get_core_siginfo): Remove unused pid.
* cp-namespace.c (cp_lookup_symbol_imports_or_template): Remove unused
i, cps.
* dwarf2loc.c (dwarf2_compile_expr_to_ax): Remove unused base_offset.
(loclist_describe_location): Remove unused first.
* event-top.c (command_line_handler): Remove unused got_eof.
* exec.c (exec_close_1): Remove unused need_symtab_cleanup.
(resize_section_table): Remove unused old_value.
* gdb_bfd.c (gdb_bfd_map_section): Remove unused header.
* gnu-v3-abi.c (compute_vtable_size): Remove unused addr.
* i386-tdep.c (i386_process_record): Remove unused rex.
* infcmd.c (get_return_value): Remove unused uiout.
* jv-lang.c (type_from_class): Remove unused is_array.
* jv-valprint.c (java_val_print): Remove unused i.
* linux-nat.c (linux_nat_stop_lwp): Remove unused ptid.
* linux-thread-db.c (thread_db_find_new_threads_2): Remove unuseD pid.
* m2-typeprint.c (m2_print_type): Remove unused code.
* macroexp.c (get_character_constant): Remove unused body_start.
(macro_stringify): Remove unused result.
* objc-lang.c (find_methods): Remove unused gdbarch.
* objfiles.c (filter_overlapping_sections): Remove unused abfd1, abfd2.
* regcache.c (regcache_cooked_read): Remove unused gdbarch.
* stack.c (print_frame_args): Remove unused summary.
* thread.c (thread_apply_command): Remove unused p.
* valarith.c (value_x_unop): Remove unused mangle_ptr.
* valops.c (search_struct_method): Remove unused skip.
* valprint.c (generic_val_print): Remove unused byte_order.
* varobj.c (varobj_update): Remove unused changed.
* cli/cli-cmds.c (complete_command): Remove unused next_item.
(alias_command): Remove unused c.
* mi/mi-cmd-catch.c (mi_catch_load_unload): Remove unused c.
* mi/mi-main.c (mi_cmd_data_write_register_values): Remove unused
format.
(mi_cmd_data_write_memory): Remove unused word_format.
(mi_cmd_data_write_memory_bytes): Remove unused r.
* python/py-gdb-readline.c (gdbpy_readline_wrapper): Remove unused
p_start, p_end.
* python/python.c (_initialize_python): Remove unused cmd_name, cmd.
* tui/tui-disasm.c (tui_set_disassem_content): Remove unused
line_width.
2013-01-31 Aleksandar Ristovski <aristovski@qnx.com>
* dwarf2-frame.c (dwarf2_compile_cfa_to_ax): Remove unused num_regs.

View File

@ -965,7 +965,6 @@ intermediate_encoding (void)
iconv_t desc;
static const char *stored_result = NULL;
char *result;
int i;
if (stored_result)
return stored_result;

View File

@ -285,8 +285,6 @@ complete_command (char *arg, int from_tty)
unique item once. */
for (ix = 0; VEC_iterate (char_ptr, completions, ix, item); ++ix)
{
int next_item;
if (prev == NULL || strcmp (item, prev) != 0)
{
printf_unfiltered ("%s%s\n", arg_prefix, item);
@ -1323,7 +1321,6 @@ alias_command (char *args, int from_tty)
char *args2, *equals, *alias, *command;
char **alias_argv, **command_argv;
dyn_string_t alias_dyn_string, command_dyn_string;
struct cmd_list_element *c;
static const char usage[] = N_("Usage: alias [-a] [--] ALIAS = COMMAND");
if (args == NULL || strchr (args, '=') == NULL)

View File

@ -787,7 +787,6 @@ VEC (char_ptr) *
signal_completer (struct cmd_list_element *ignore,
char *text, char *word)
{
int i;
VEC (char_ptr) *return_val = NULL;
size_t len = strlen (word);
enum gdb_signal signum;

View File

@ -100,8 +100,6 @@ discard_my_continuations_1 (struct continuation **pmy_chain)
static void
discard_my_continuations (struct continuation **list)
{
struct continuation *continuation_ptr = *list;
discard_my_continuations_1 (list);
*list = NULL;
}

View File

@ -194,8 +194,6 @@ gdb_check_format (bfd *abfd)
static void
core_close (int quitting)
{
char *name;
if (core_bfd)
{
int pid = ptid_get_pid (inferior_ptid);
@ -664,7 +662,6 @@ static LONGEST
get_core_siginfo (bfd *abfd, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
{
asection *section;
long pid;
char *section_name;
const char *name = ".note.linuxcore.siginfo";

View File

@ -451,10 +451,6 @@ cp_lookup_symbol_imports_or_template (const char *scope,
if (function != NULL && SYMBOL_LANGUAGE (function) == language_cplus)
{
int i;
struct cplus_specific *cps
= function->ginfo.language_specific.cplus_specific;
/* Search the function's template parameters. */
if (SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION (function))
{

View File

@ -2865,7 +2865,6 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
size_t datalen;
struct block *b;
struct symbol *framefunc;
LONGEST base_offset = 0;
b = block_for_pc (expr->scope);
@ -4051,7 +4050,6 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
{
struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
const gdb_byte *loc_ptr, *buf_end;
int first = 1;
struct objfile *objfile = dwarf2_per_cu_objfile (dlbaton->per_cu);
struct gdbarch *gdbarch = get_objfile_arch (objfile);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);

View File

@ -453,8 +453,6 @@ command_line_handler (char *rl)
char *p;
char *p1;
char *nline;
char got_eof = 0;
int repeat = (instream == stdin);
if (annotation_level > 1 && instream == stdin)
@ -499,7 +497,6 @@ command_line_handler (char *rl)
and exit from gdb. */
if (!rl || rl == (char *) EOF)
{
got_eof = 1;
command_handler (0);
return; /* Lint. */
}

View File

@ -117,7 +117,6 @@ exec_close (void)
static void
exec_close_1 (int quitting)
{
int need_symtab_cleanup = 0;
struct vmap *vp, *nxt;
using_exec_ops = 0;
@ -128,10 +127,7 @@ exec_close_1 (int quitting)
nxt = vp->nxt;
if (vp->objfile)
{
free_objfile (vp->objfile);
need_symtab_cleanup = 1;
}
free_objfile (vp->objfile);
gdb_bfd_unref (vp->bfd);
@ -391,11 +387,9 @@ add_to_section_table (bfd *abfd, struct bfd_section *asect,
int
resize_section_table (struct target_section_table *table, int num_added)
{
struct target_section *old_value;
int old_count;
int new_count;
old_value = table->sections;
old_count = table->sections_end - table->sections;
new_count = num_added + old_count;

View File

@ -345,7 +345,6 @@ const gdb_byte *
gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
{
bfd *abfd;
unsigned char header[4];
struct gdb_bfd_section_data *descriptor;
bfd_byte *data;

View File

@ -805,7 +805,6 @@ compute_vtable_size (htab_t offset_hash,
struct type *type = check_typedef (value_type (value));
void **slot;
struct value_and_voffset search_vo, *current_vo;
CORE_ADDR addr = value_address (value) + value_embedded_offset (value);
/* If the object is not dynamic, then we are done; as it cannot have
dynamic base types either. */

View File

@ -4339,7 +4339,6 @@ i386_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
gdb_byte buf[MAX_REGISTER_SIZE];
struct i386_record_s ir;
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
int rex = 0;
uint8_t rex_w = -1;
uint8_t rex_r = 0;
@ -4419,7 +4418,6 @@ i386_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
if (ir.regmap[X86_RECORD_R8_REGNUM]) /* 64 bit target */
{
/* REX */
rex = 1;
rex_w = (opcode8 >> 3) & 1;
rex_r = (opcode8 & 0x4) << 1;
ir.rex_x = (opcode8 & 0x2) << 2;

View File

@ -1450,7 +1450,6 @@ get_return_value (struct value *function, struct type *value_type)
struct regcache *stop_regs = stop_registers;
struct gdbarch *gdbarch;
struct value *value;
struct ui_out *uiout = current_uiout;
struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
/* If stop_registers were not saved, use the current registers. */

View File

@ -269,7 +269,6 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas)
struct value *utf8_name;
char *nptr;
CORE_ADDR addr;
int is_array = 0;
type = check_typedef (value_type (clas));
if (TYPE_CODE (type) == TYPE_CODE_PTR)
@ -318,7 +317,6 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas)
name = obstack_alloc (&objfile->objfile_obstack, namelen + 1);
java_demangled_signature_copy (name, signature);
name[namelen] = '\0';
is_array = 1;
temp = clas;
/* Set array element type. */
temp = value_struct_elt (&temp, NULL, "methods", NULL, "structure");

View File

@ -471,7 +471,6 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
const struct value_print_options *options)
{
struct gdbarch *gdbarch = get_type_arch (type);
unsigned int i = 0; /* Number of characters printed. */
struct type *target_type;
CORE_ADDR addr;

View File

@ -4976,8 +4976,6 @@ linux_nat_stop_lwp (struct lwp_info *lwp, void *data)
{
if (!lwp->stopped)
{
ptid_t ptid = lwp->ptid;
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
"LNSL: running -> suspending %s\n",

View File

@ -1661,7 +1661,6 @@ thread_db_find_new_threads_2 (ptid_t ptid, int until_no_new)
{
td_err_e err = TD_OK;
struct thread_db_info *info;
int pid = ptid_get_pid (ptid);
int i, loop;
info = get_thread_db_info (GET_PID (ptid));

View File

@ -77,8 +77,6 @@ m2_print_type (struct type *type, const char *varstring,
int show, int level,
const struct type_print_options *flags)
{
enum type_code code;
CHECK_TYPEDEF (type);
QUIT;
@ -90,7 +88,6 @@ m2_print_type (struct type *type, const char *varstring,
return;
}
code = TYPE_CODE (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_SET:

View File

@ -337,7 +337,6 @@ get_character_constant (struct macro_buffer *tok, char *p, char *end)
&& p[1] == '\''))
{
char *tok_start = p;
char *body_start;
int char_count = 0;
if (*p == '\'')
@ -347,7 +346,6 @@ get_character_constant (struct macro_buffer *tok, char *p, char *end)
else
gdb_assert_not_reached ("unexpected character constant");
body_start = p;
for (;;)
{
if (p >= end)
@ -700,7 +698,6 @@ macro_stringify (const char *str)
{
struct macro_buffer buffer;
int len = strlen (str);
char *result;
init_buffer (&buffer, len);
stringify (&buffer, str, len);

View File

@ -33,7 +33,6 @@
static void
mi_catch_load_unload (int load, char *argv[], int argc)
{
struct solib_catchpoint *c;
struct cleanup *back_to;
const char *actual_cmd = load ? "-catch-load" : "-catch-unload";
int temp = 0;

View File

@ -1189,7 +1189,6 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
struct regcache *regcache;
struct gdbarch *gdbarch;
int numregs, i;
char format;
/* Note that the test for a valid register must include checking the
gdbarch_register_name because gdbarch_num_regs may be allocated
@ -1206,8 +1205,6 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
error (_("-data-write-register-values: Usage: -data-write-register-"
"values <format> [<regnum1> <value1>...<regnumN> <valueN>]"));
format = (int) argv[0][0];
if (!target_has_registers)
error (_("-data-write-register-values: No registers."));
@ -1588,7 +1585,6 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc)
struct gdbarch *gdbarch = get_current_arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR addr;
char word_format;
long word_size;
/* FIXME: ezannoni 2000-02-17 LONGEST could possibly not be big
enough when using a compiler other than GCC. */
@ -1632,9 +1628,6 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc)
/* Extract all the arguments. */
/* Start address of the memory dump. */
addr = parse_and_eval_address (argv[0]);
/* The format character to use when displaying a memory word. See
the ``x'' command. */
word_format = argv[1][0];
/* The size of the memory word. */
word_size = atol (argv[2]);
@ -1666,7 +1659,7 @@ mi_cmd_data_write_memory_bytes (char *command, char **argv, int argc)
char *cdata;
gdb_byte *data;
gdb_byte *databuf;
size_t len, r, i, steps, remainder;
size_t len, i, steps, remainder;
long int count, j;
struct cleanup *back_to;

View File

@ -996,8 +996,6 @@ find_methods (char type, const char *class, const char *category,
ALL_OBJFILE_MSYMBOLS (objfile, msymbol)
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
QUIT;
/* Check the symbol name first as this can be done entirely without

View File

@ -1234,9 +1234,6 @@ filter_overlapping_sections (struct obj_section **map, int map_size)
struct objfile *const objf1 = sect1->objfile;
struct objfile *const objf2 = sect2->objfile;
const struct bfd *const abfd1 = objf1->obfd;
const struct bfd *const abfd2 = objf2->obfd;
const struct bfd_section *const bfds1 = sect1->the_bfd_section;
const struct bfd_section *const bfds2 = sect2->the_bfd_section;

View File

@ -37,7 +37,7 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
char *prompt)
{
int n;
char *p = NULL, *p_start, *p_end, *q;
char *p = NULL, *q;
volatile struct gdb_exception except;
TRY_CATCH (except, RETURN_MASK_ALL)

View File

@ -1436,8 +1436,6 @@ extern initialize_file_ftype _initialize_python;
void
_initialize_python (void)
{
char *cmd_name;
struct cmd_list_element *cmd;
char *progname;
#ifdef IS_PY3K
int i;

View File

@ -706,8 +706,6 @@ regcache_cooked_read (struct regcache *regcache, int regnum, gdb_byte *buf)
{
/* Read-only register cache, perhaps the cooked value was
cached? */
struct gdbarch *gdbarch = regcache->descr->gdbarch;
if (regcache->register_status[regnum] == REG_VALID)
memcpy (buf, register_buffer (regcache, regnum),
regcache->descr->sizeof_register[regnum]);

View File

@ -504,8 +504,6 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
struct ui_file *stb;
/* True if we should print arguments, false otherwise. */
int print_args = strcmp (print_frame_arguments, "none");
/* True in "summary" mode, false otherwise. */
int summary = !strcmp (print_frame_arguments, "scalars");
stb = mem_fileopen ();
old_chain = make_cleanup_ui_file_delete (stb);

View File

@ -1233,7 +1233,6 @@ thread_apply_command (char *tidlist, int from_tty)
{
struct thread_info *tp;
int start;
char *p = tidlist;
start = get_number_or_range (&state);

View File

@ -173,7 +173,7 @@ tui_set_disassem_content (struct gdbarch *gdbarch, CORE_ADDR pc)
enum tui_status ret = TUI_FAILURE;
int i;
int offset = TUI_DISASM_WIN->detail.source_info.horizontal_offset;
int line_width, max_lines;
int max_lines;
CORE_ADDR cur_pc;
struct tui_gen_win_info *locator = tui_locator_win_info_ptr ();
int tab_len = tui_default_tab_len ();
@ -203,8 +203,6 @@ tui_set_disassem_content (struct gdbarch *gdbarch, CORE_ADDR pc)
* max_lines);
memset (asm_lines, 0, sizeof (struct tui_asm_line) * max_lines);
line_width = TUI_DISASM_WIN->generic.width - 1;
tui_disassemble (gdbarch, asm_lines, pc, max_lines);
/* See what is the maximum length of an address and of a line. */

View File

@ -510,7 +510,7 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
{
struct gdbarch *gdbarch = get_type_arch (value_type (arg1));
struct value **argvec;
char *ptr, *mangle_ptr;
char *ptr;
char tstr[13], mangle_tstr[13];
int static_memfuncp, nargs;
@ -532,7 +532,6 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
strcpy (tstr, "operator__");
ptr = tstr + 8;
strcpy (mangle_tstr, "__");
mangle_ptr = mangle_tstr + 2;
switch (op)
{
case UNOP_PREINCREMENT:

View File

@ -2236,7 +2236,6 @@ search_struct_method (const char *name, struct value **arg1p,
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
{
int base_offset;
int skip = 0;
int this_offset;
if (BASETYPE_VIA_VIRTUAL (type, i))

View File

@ -370,7 +370,6 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
const struct generic_val_print_decorations *decorations)
{
struct gdbarch *gdbarch = get_type_arch (type);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
unsigned int i = 0; /* Number of characters printed. */
unsigned len;
struct type *elttype, *unresolved_elttype;

View File

@ -1969,7 +1969,6 @@ varobj_value_has_mutated (struct varobj *var, struct value *new_value,
VEC(varobj_update_result) *
varobj_update (struct varobj **varp, int explicit)
{
int changed = 0;
int type_changed = 0;
int i;
struct value *new;