Remove some unused variables
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 5 Dec 2017 21:05:34 +0000 (16:05 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 5 Dec 2017 21:05:50 +0000 (16:05 -0500)
This patch removes some unused variables, found with -Wunused.  I have
not removed everything reported by -Wunused, because some expressions
such as

  struct type *arg_type = check_typedef (value_type);

in bfin-tdep.c could have an unexpected but important side-effect.  I
removed others that I considered more low-risk, such as:

  struct gdbarch *gdbarch = get_objfile_arch (objfile);

I tested building with Python 2/Python 3/no Python, with/without expat,
with/without libipt and with/without babeltrace.

gdb/ChangeLog:

* ada-lang.c (ada_collect_symbol_completion_matches): Remove
unused variables.
(ada_is_redundant_range_encoding): Likewise.
* ada-varobj.c (ada_varobj_get_value_of_array_variable):
Likewise.
* alpha-tdep.c (alpha_software_single_step): Likewise.
* arm-tdep.c (_initialize_arm_tdep): Likewise.
* auto-load.c (info_auto_load_cmd): Likewise.
* break-catch-syscall.c (insert_catch_syscall): Likewise.
(remove_catch_syscall): Likewise.
* breakpoint.c (condition_completer): Likewise.
(clear_command): Likewise.
(update_breakpoint_locations): Likewise.
* btrace.c (btrace_disable): Likewise.
(btrace_teardown): Likewise.
(btrace_maint_update_pt_packets): Likewise.
(maint_btrace_clear_cmd): Likewise.
* cli/cli-decode.c (lookup_cmd_1): Likewise.
(lookup_cmd_composition): Likewise.
* cli/cli-dump.c (scan_filename): Likewise.
(restore_command): Likewise.
* compile/compile-loc2c.c (compute_stack_depth): Likewise.
* compile/compile-object-load.c (compile_object_load): Likewise.
* compile/compile-object-run.c (compile_object_run): Likewise.
* compile/compile.c (compile_to_object): Likewise.
* completer.c (filename_completer): Likewise.
(complete_files_symbols): Likewise.
(complete_expression): Likewise.
* corelow.c (core_open): Likewise.
* ctf.c (ctf_start): Likewise.
(ctf_write_status): Likewise.
(ctf_write_uploaded_tsv): Likewise.
(ctf_write_definition_end): Likewise.
(ctf_open_dir): Likewise.
(ctf_xfer_partial): Likewise.
(ctf_trace_find): Likewise.
* disasm.c (gdb_pretty_print_disassembler::pretty_print_insn):
Likewise.
* dwarf2loc.c (allocate_piece_closure): Likewise.
(indirect_pieced_value): Likewise.
(dwarf2_evaluate_loc_desc_full): Likewise.
* dwarf2read.c (dw2_expand_marked_cus): Likewise.
(dw2_expand_symtabs_matching): Likewise.
(dw2_map_symbol_filenames): Likewise.
(read_and_check_comp_unit_head): Likewise.
(read_cutu_die_from_dwo): Likewise.
(lookup_dwo_unit): Likewise.
(read_comp_units_from_section): Likewise.
(dwarf2_compute_name): Likewise.
(handle_DW_AT_stmt_list): Likewise.
(create_cus_hash_table): Likewise.
(create_dwp_v2_section): Likewise.
(dwarf2_rnglists_process): Likewise.
(dwarf2_ranges_process): Likewise.
(dwarf2_record_block_ranges): Likewise.
(is_vtable_name): Likewise.
(read_formatted_entries): Likewise.
(skip_form_bytes): Likewise.
* elfread.c (elf_symtab_read): Likewise.
* exec.c (exec_file_command): Likewise.
* f-valprint.c (f_val_print): Likewise.
(info_common_command_for_block): Likewise.
* guile/guile.c (initialize_scheme_side): Likewise.
* guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Likewise.
* guile/scm-cmd.c (cmdscm_completer): Likewise.
(gdbscm_register_command_x): Likewise.
* guile/scm-frame.c (gdbscm_frame_read_var): Likewise.
* guile/scm-param.c (gdbscm_parameter_value): Likewise.
* guile/scm-ports.c (file_port_magic): Likewise.
* guile/scm-pretty-print.c (ppscm_search_pp_list): Likewise.
(ppscm_pretty_print_one_value): Likewise.
(ppscm_print_children): Likewise.
* guile/scm-string.c (gdbscm_string_to_argv): Likewise.
* guile/scm-symtab.c (gdbscm_sal_symtab): Likewise.
* guile/scm-type.c (gdbscm_type_next_field_x): Likewise.
* guile/scm-utils.c (gdbscm_parse_function_args): Likewise.
* i386-tdep.c (i386_register_reggroup_p): Likewise.
* infcmd.c (run_command_1): Likewise.
(until_next_fsm_clean_up): Likewise.
* linespec.c (linespec_complete): Likewise.
(find_label_symbols): Likewise.
* m2-valprint.c (m2_val_print): Likewise.
* memattr.c (require_user_regions): Likewise.
(lookup_mem_region): Likewise.
(disable_mem_command): Likewise.
(mem_delete): Likewise.
* mep-tdep.c (mep_register_name): Likewise.
(mep_analyze_prologue): Likewise.
* mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Likewise.
* mi/mi-interp.c (mi_on_sync_execution_done): Likewise.
* mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise.
* microblaze-linux-tdep.c (microblaze_linux_init_abi): Likewise.
* minidebug.c (lzma_open): Likewise.
* minsyms.c (lookup_minimal_symbol): Likewise.
* mips-linux-tdep.c (mips64_fill_fpregset): Likewise.
* mips-tdep.c (mips_stub_frame_sniffer): Likewise.
(mips_o64_return_value): Likewise.
(mips_single_step_through_delay): Likewise.
(_initialize_mips_tdep): Likewise.
* nios2-tdep.c (nios2_push_dummy_call): Likewise.
(nios2_software_single_step): Likewise.
* parse.c (find_minsym_type_and_address): Likewise.
* psymtab.c (psym_relocate): Likewise.
* python/py-breakpoint.c (bppy_get_commands): Likewise.
(gdbpy_breakpoint_modified): Likewise.
* python/py-infevents.c (create_inferior_call_event_object):
Likewise.
* python/py-record-btrace.c (btpy_list_item): Likewise.
* python/py-type.c (typy_str): Likewise.
* python/py-value.c (valpy_call): Likewise.
* python/python.c (do_start_initialization): Likewise.
* record-btrace.c (record_btrace_insn_history_range): Likewise.
(record_btrace_call_history_range): Likewise.
(record_btrace_record_method): Likewise.
(record_btrace_xfer_partial): Likewise.
(btrace_get_frame_function): Likewise.
* record-full.c (record_full_open): Likewise.
* record.c (get_context_size): Likewise.
* registry.h (DEFINE_REGISTRY): Likewise.
* remote-fileio.c (remote_fileio_request): Likewise.
* remote.c (remote_update_thread_list): Likewise.
(remote_check_symbols): Likewise.
(remote_commit_resume): Likewise.
(remote_interrupt): Likewise.
(remote_insert_breakpoint): Likewise.
(compare_sections_command): Likewise.
* rust-exp.y (super_name): Likewise.
(lex_string): Likewise.
(convert_ast_to_type): Likewise.
(convert_ast_to_expression): Likewise.
* rust-lang.c (rust_print_struct_def): Likewise.
(rust_print_type): Likewise.
(rust_evaluate_subexp): Likewise.
* rx-tdep.c (rx_register_type): Likewise.
* ser-event.c (serial_event_clear): Likewise.
* serial.c (serial_open): Likewise.
* spu-tdep.c (spu_overlay_new_objfile): Likewise.
* symfile.c (section_is_overlay): Likewise.
(overlay_unmapped_address): Likewise.
(overlay_mapped_address): Likewise.
(simple_overlay_update_1): Likewise.
(simple_overlay_update): Likewise.
* symtab.c (symbol_find_demangled_name): Likewise.
(search_symbols): Likewise.
* target-descriptions.c (tdesc_predefined_type): Likewise.
* target.c (target_commit_resume): Likewise.
* thread.c (print_selected_thread_frame): Likewise.
* top.c (new_ui_command): Likewise.
(gdb_readline_no_editing): Likewise.
* tracefile-tfile.c (tfile_open): Likewise.
* tracepoint.c (create_tsv_from_upload): Likewise.
* utils.c (quit): Likewise.
(defaulted_query): Likewise.
* valarith.c (value_concat): Likewise.
* xml-syscall.c (xml_list_syscalls_by_group): Likewise.
* xml-tdesc.c (target_fetch_description_xml): Likewise.
* xtensa-tdep.c (xtensa_pseudo_register_read): Likewise.
(xtensa_pseudo_register_write): Likewise.

gdb/gdbserver/ChangeLog:

* regcache.c (registers_to_string): Remove unused variable.

85 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/ada-varobj.c
gdb/alpha-tdep.c
gdb/arm-tdep.c
gdb/auto-load.c
gdb/break-catch-syscall.c
gdb/breakpoint.c
gdb/btrace.c
gdb/cli/cli-decode.c
gdb/cli/cli-dump.c
gdb/compile/compile-loc2c.c
gdb/compile/compile-object-load.c
gdb/compile/compile-object-run.c
gdb/compile/compile.c
gdb/completer.c
gdb/corelow.c
gdb/ctf.c
gdb/disasm.c
gdb/dwarf2loc.c
gdb/dwarf2read.c
gdb/elfread.c
gdb/exec.c
gdb/f-valprint.c
gdb/gdbserver/ChangeLog
gdb/gdbserver/regcache.c
gdb/guile/guile.c
gdb/guile/scm-breakpoint.c
gdb/guile/scm-cmd.c
gdb/guile/scm-frame.c
gdb/guile/scm-param.c
gdb/guile/scm-ports.c
gdb/guile/scm-pretty-print.c
gdb/guile/scm-string.c
gdb/guile/scm-symtab.c
gdb/guile/scm-type.c
gdb/guile/scm-utils.c
gdb/i386-tdep.c
gdb/infcmd.c
gdb/linespec.c
gdb/m2-valprint.c
gdb/memattr.c
gdb/mep-tdep.c
gdb/mi/mi-cmd-file.c
gdb/mi/mi-interp.c
gdb/mi/mi-main.c
gdb/microblaze-linux-tdep.c
gdb/minidebug.c
gdb/minsyms.c
gdb/mips-linux-tdep.c
gdb/mips-tdep.c
gdb/nios2-tdep.c
gdb/parse.c
gdb/psymtab.c
gdb/python/py-breakpoint.c
gdb/python/py-infevents.c
gdb/python/py-record-btrace.c
gdb/python/py-type.c
gdb/python/py-value.c
gdb/python/python.c
gdb/record-btrace.c
gdb/record-full.c
gdb/record.c
gdb/registry.h
gdb/remote-fileio.c
gdb/remote.c
gdb/rust-exp.y
gdb/rust-lang.c
gdb/rx-tdep.c
gdb/ser-event.c
gdb/serial.c
gdb/spu-tdep.c
gdb/symfile.c
gdb/symtab.c
gdb/target-descriptions.c
gdb/target.c
gdb/thread.c
gdb/top.c
gdb/tracefile-tfile.c
gdb/tracepoint.c
gdb/utils.c
gdb/valarith.c
gdb/xml-syscall.c
gdb/xml-tdesc.c
gdb/xtensa-tdep.c

index 0bb4546bfff24abf8553c56e1d602c34eb25ae0d..524eef3f5e555871ef9699d1d6395acb0984db4b 100644 (file)
@@ -1,3 +1,164 @@
+2017-12-05  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * ada-lang.c (ada_collect_symbol_completion_matches): Remove
+       unused variables.
+       (ada_is_redundant_range_encoding): Likewise.
+       * ada-varobj.c (ada_varobj_get_value_of_array_variable):
+       Likewise.
+       * alpha-tdep.c (alpha_software_single_step): Likewise.
+       * arm-tdep.c (_initialize_arm_tdep): Likewise.
+       * auto-load.c (info_auto_load_cmd): Likewise.
+       * break-catch-syscall.c (insert_catch_syscall): Likewise.
+       (remove_catch_syscall): Likewise.
+       * breakpoint.c (condition_completer): Likewise.
+       (clear_command): Likewise.
+       (update_breakpoint_locations): Likewise.
+       * btrace.c (btrace_disable): Likewise.
+       (btrace_teardown): Likewise.
+       (btrace_maint_update_pt_packets): Likewise.
+       (maint_btrace_clear_cmd): Likewise.
+       * cli/cli-decode.c (lookup_cmd_1): Likewise.
+       (lookup_cmd_composition): Likewise.
+       * cli/cli-dump.c (scan_filename): Likewise.
+       (restore_command): Likewise.
+       * compile/compile-loc2c.c (compute_stack_depth): Likewise.
+       * compile/compile-object-load.c (compile_object_load): Likewise.
+       * compile/compile-object-run.c (compile_object_run): Likewise.
+       * compile/compile.c (compile_to_object): Likewise.
+       * completer.c (filename_completer): Likewise.
+       (complete_files_symbols): Likewise.
+       (complete_expression): Likewise.
+       * corelow.c (core_open): Likewise.
+       * ctf.c (ctf_start): Likewise.
+       (ctf_write_status): Likewise.
+       (ctf_write_uploaded_tsv): Likewise.
+       (ctf_write_definition_end): Likewise.
+       (ctf_open_dir): Likewise.
+       (ctf_xfer_partial): Likewise.
+       (ctf_trace_find): Likewise.
+       * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn):
+       Likewise.
+       * dwarf2loc.c (allocate_piece_closure): Likewise.
+       (indirect_pieced_value): Likewise.
+       (dwarf2_evaluate_loc_desc_full): Likewise.
+       * dwarf2read.c (dw2_expand_marked_cus): Likewise.
+       (dw2_expand_symtabs_matching): Likewise.
+       (dw2_map_symbol_filenames): Likewise.
+       (read_and_check_comp_unit_head): Likewise.
+       (read_cutu_die_from_dwo): Likewise.
+       (lookup_dwo_unit): Likewise.
+       (read_comp_units_from_section): Likewise.
+       (dwarf2_compute_name): Likewise.
+       (handle_DW_AT_stmt_list): Likewise.
+       (create_cus_hash_table): Likewise.
+       (create_dwp_v2_section): Likewise.
+       (dwarf2_rnglists_process): Likewise.
+       (dwarf2_ranges_process): Likewise.
+       (dwarf2_record_block_ranges): Likewise.
+       (is_vtable_name): Likewise.
+       (read_formatted_entries): Likewise.
+       (skip_form_bytes): Likewise.
+       * elfread.c (elf_symtab_read): Likewise.
+       * exec.c (exec_file_command): Likewise.
+       * f-valprint.c (f_val_print): Likewise.
+       (info_common_command_for_block): Likewise.
+       * guile/guile.c (initialize_scheme_side): Likewise.
+       * guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Likewise.
+       * guile/scm-cmd.c (cmdscm_completer): Likewise.
+       (gdbscm_register_command_x): Likewise.
+       * guile/scm-frame.c (gdbscm_frame_read_var): Likewise.
+       * guile/scm-param.c (gdbscm_parameter_value): Likewise.
+       * guile/scm-ports.c (file_port_magic): Likewise.
+       * guile/scm-pretty-print.c (ppscm_search_pp_list): Likewise.
+       (ppscm_pretty_print_one_value): Likewise.
+       (ppscm_print_children): Likewise.
+       * guile/scm-string.c (gdbscm_string_to_argv): Likewise.
+       * guile/scm-symtab.c (gdbscm_sal_symtab): Likewise.
+       * guile/scm-type.c (gdbscm_type_next_field_x): Likewise.
+       * guile/scm-utils.c (gdbscm_parse_function_args): Likewise.
+       * i386-tdep.c (i386_register_reggroup_p): Likewise.
+       * infcmd.c (run_command_1): Likewise.
+       (until_next_fsm_clean_up): Likewise.
+       * linespec.c (linespec_complete): Likewise.
+       (find_label_symbols): Likewise.
+       * m2-valprint.c (m2_val_print): Likewise.
+       * memattr.c (require_user_regions): Likewise.
+       (lookup_mem_region): Likewise.
+       (disable_mem_command): Likewise.
+       (mem_delete): Likewise.
+       * mep-tdep.c (mep_register_name): Likewise.
+       (mep_analyze_prologue): Likewise.
+       * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Likewise.
+       * mi/mi-interp.c (mi_on_sync_execution_done): Likewise.
+       * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise.
+       * microblaze-linux-tdep.c (microblaze_linux_init_abi): Likewise.
+       * minidebug.c (lzma_open): Likewise.
+       * minsyms.c (lookup_minimal_symbol): Likewise.
+       * mips-linux-tdep.c (mips64_fill_fpregset): Likewise.
+       * mips-tdep.c (mips_stub_frame_sniffer): Likewise.
+       (mips_o64_return_value): Likewise.
+       (mips_single_step_through_delay): Likewise.
+       (_initialize_mips_tdep): Likewise.
+       * nios2-tdep.c (nios2_push_dummy_call): Likewise.
+       (nios2_software_single_step): Likewise.
+       * parse.c (find_minsym_type_and_address): Likewise.
+       * psymtab.c (psym_relocate): Likewise.
+       * python/py-breakpoint.c (bppy_get_commands): Likewise.
+       (gdbpy_breakpoint_modified): Likewise.
+       * python/py-infevents.c (create_inferior_call_event_object):
+       Likewise.
+       * python/py-record-btrace.c (btpy_list_item): Likewise.
+       * python/py-type.c (typy_str): Likewise.
+       * python/py-value.c (valpy_call): Likewise.
+       * python/python.c (do_start_initialization): Likewise.
+       * record-btrace.c (record_btrace_insn_history_range): Likewise.
+       (record_btrace_call_history_range): Likewise.
+       (record_btrace_record_method): Likewise.
+       (record_btrace_xfer_partial): Likewise.
+       (btrace_get_frame_function): Likewise.
+       * record-full.c (record_full_open): Likewise.
+       * record.c (get_context_size): Likewise.
+       * registry.h (DEFINE_REGISTRY): Likewise.
+       * remote-fileio.c (remote_fileio_request): Likewise.
+       * remote.c (remote_update_thread_list): Likewise.
+       (remote_check_symbols): Likewise.
+       (remote_commit_resume): Likewise.
+       (remote_interrupt): Likewise.
+       (remote_insert_breakpoint): Likewise.
+       (compare_sections_command): Likewise.
+       * rust-exp.y (super_name): Likewise.
+       (lex_string): Likewise.
+       (convert_ast_to_type): Likewise.
+       (convert_ast_to_expression): Likewise.
+       * rust-lang.c (rust_print_struct_def): Likewise.
+       (rust_print_type): Likewise.
+       (rust_evaluate_subexp): Likewise.
+       * rx-tdep.c (rx_register_type): Likewise.
+       * ser-event.c (serial_event_clear): Likewise.
+       * serial.c (serial_open): Likewise.
+       * spu-tdep.c (spu_overlay_new_objfile): Likewise.
+       * symfile.c (section_is_overlay): Likewise.
+       (overlay_unmapped_address): Likewise.
+       (overlay_mapped_address): Likewise.
+       (simple_overlay_update_1): Likewise.
+       (simple_overlay_update): Likewise.
+       * symtab.c (symbol_find_demangled_name): Likewise.
+       (search_symbols): Likewise.
+       * target-descriptions.c (tdesc_predefined_type): Likewise.
+       * target.c (target_commit_resume): Likewise.
+       * thread.c (print_selected_thread_frame): Likewise.
+       * top.c (new_ui_command): Likewise.
+       (gdb_readline_no_editing): Likewise.
+       * tracefile-tfile.c (tfile_open): Likewise.
+       * tracepoint.c (create_tsv_from_upload): Likewise.
+       * utils.c (quit): Likewise.
+       (defaulted_query): Likewise.
+       * valarith.c (value_concat): Likewise.
+       * xml-syscall.c (xml_list_syscalls_by_group): Likewise.
+       * xml-tdesc.c (target_fetch_description_xml): Likewise.
+       * xtensa-tdep.c (xtensa_pseudo_register_read): Likewise.
+       (xtensa_pseudo_register_write): Likewise.
+
 2017-12-04  Tom Tromey  <tom@tromey.com>
 
        * NEWS: Mention Rust trait object inspection.
index c5636b92f3fc134c29747c3c73f63410609ec1c1..d6f7ef4ce8dc272bbc0065774eb126195b4a0c1c 100644 (file)
@@ -6475,7 +6475,6 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
   struct minimal_symbol *msymbol;
   struct objfile *objfile;
   const struct block *b, *surrounding_static_block = 0;
-  int i;
   struct block_iterator iter;
   struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
 
@@ -8652,7 +8651,6 @@ static int
 ada_is_redundant_range_encoding (struct type *range_type,
                                 struct type *encoding_type)
 {
-  struct type *fixed_range_type;
   const char *bounds_str;
   int n;
   LONGEST lo, hi;
index 267ee2668bd6fa3ba057a138466a3c29813b1799..c8b4ba64cbcb123febc868a50b8721e1f7bdac24 100644 (file)
@@ -825,7 +825,6 @@ ada_varobj_get_value_of_array_variable (struct value *value,
                                        struct type *type,
                                        struct value_print_options *opts)
 {
-  char *result;
   const int numchild = ada_varobj_get_array_number_of_children (value, type);
 
   /* If we have a string, provide its contents in the "value" field.
index 3100d72ad1aae8b44beed17adf38d94ab8978184..21199bd9880ef4ea0aba0021e67a092afaa4668f 100644 (file)
@@ -1723,10 +1723,7 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
 std::vector<CORE_ADDR>
 alpha_software_single_step (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = regcache->arch ();
-  CORE_ADDR pc;
-
-  pc = alpha_next_pc (regcache, regcache_read_pc (regcache));
+  CORE_ADDR pc = alpha_next_pc (regcache, regcache_read_pc (regcache));
 
   return {pc};
 }
index 54c6392ba7b3608d73182aede76bb494c48473bf..ac92c88b5981d154505b6348b35c5e5c8cff59f2 100644 (file)
@@ -9546,8 +9546,6 @@ void
 _initialize_arm_tdep (void)
 {
   long length;
-  const char *setname;
-  const char *setdesc;
   int i, j;
   char regdesc[1024], *rdptr = regdesc;
   size_t rest = sizeof (regdesc);
index 3d560146af4785181699ec951329ee1cd19be744..69b242bbd220a3ff60c9b133fc73d04b94e2016f 100644 (file)
@@ -1521,7 +1521,6 @@ static void
 info_auto_load_cmd (const char *args, int from_tty)
 {
   struct cmd_list_element *list;
-  struct cleanup *infolist_chain;
   struct ui_out *uiout = current_uiout;
 
   ui_out_emit_tuple tuple_emitter (uiout, "infolist");
index 41ea424672481838f11da1afec0cdc12f90d3705..a8312f2542beca3a70956836aef5c3b40a7991ee 100644 (file)
@@ -104,8 +104,6 @@ insert_catch_syscall (struct bp_location *bl)
     {
       for (int iter : c->syscalls_to_be_caught)
        {
-          int elem;
-
          if (iter >= inf_data->syscalls_counts.size ())
            inf_data->syscalls_counts.resize (iter + 1);
          ++inf_data->syscalls_counts[iter];
@@ -137,7 +135,6 @@ remove_catch_syscall (struct bp_location *bl, enum remove_bp_reason reason)
     {
       for (int iter : c->syscalls_to_be_caught)
        {
-          int elem;
          if (iter >= inf_data->syscalls_counts.size ())
            /* Shouldn't happen.  */
            continue;
index d4d095d87eec34424c43a1408ba19028a8b2d675..76bfd53a4336e7e544dbcdf97eafb0ef1514b4cf 100644 (file)
@@ -921,7 +921,6 @@ condition_completer (struct cmd_list_element *cmd,
     {
       int len;
       struct breakpoint *b;
-      VEC (char_ptr) *result = NULL;
 
       if (text[0] == '$')
        {
@@ -11479,7 +11478,6 @@ clear_command (const char *arg, int from_tty)
 {
   struct breakpoint *b;
   int default_match;
-  int i;
 
   std::vector<symtab_and_line> decoded_sals;
   symtab_and_line last_sal;
@@ -13664,7 +13662,6 @@ update_breakpoint_locations (struct breakpoint *b,
                             gdb::array_view<const symtab_and_line> sals,
                             gdb::array_view<const symtab_and_line> sals_end)
 {
-  int i;
   struct bp_location *existing_locations;
 
   if (!sals_end.empty () && (sals.size () != 1 || sals_end.size () != 1))
index 8338ebfb0a2edf674897cc88a808a517c19eb367..4670b6f881850e2f9f21a0ab9320ad074dbc2f54 100644 (file)
@@ -1636,7 +1636,6 @@ void
 btrace_disable (struct thread_info *tp)
 {
   struct btrace_thread_info *btp = &tp->btrace;
-  int errcode = 0;
 
   if (btp->target == NULL)
     return;
@@ -1656,7 +1655,6 @@ void
 btrace_teardown (struct thread_info *tp)
 {
   struct btrace_thread_info *btp = &tp->btrace;
-  int errcode = 0;
 
   if (btp->target == NULL)
     return;
@@ -3021,7 +3019,6 @@ btrace_maint_decode_pt (struct btrace_maint_info *maint,
 static void
 btrace_maint_update_pt_packets (struct btrace_thread_info *btinfo)
 {
-  volatile struct gdb_exception except;
   struct pt_packet_decoder *decoder;
   struct btrace_data_pt *pt;
   struct pt_config config;
@@ -3358,7 +3355,6 @@ maint_btrace_clear_packet_history_cmd (const char *args, int from_tty)
 static void
 maint_btrace_clear_cmd (const char *args, int from_tty)
 {
-  struct btrace_thread_info *btinfo;
   struct thread_info *tp;
 
   if (args != NULL && *args != 0)
index 6140a1744798d74b8b874134f35ce928af069a10..81df308f4737f61257322bc061bec404c9c944e7 100644 (file)
@@ -1386,7 +1386,7 @@ lookup_cmd_1 (const char **text, struct cmd_list_element *clist,
              struct cmd_list_element **result_list, int ignore_help_classes)
 {
   char *command;
-  int len, tmp, nfound;
+  int len, nfound;
   struct cmd_list_element *found, *c;
   const char *line = *text;
 
@@ -1715,7 +1715,7 @@ lookup_cmd_composition (const char *text,
                       struct cmd_list_element **cmd)
 {
   char *command;
-  int len, tmp, nfound;
+  int len, nfound;
   struct cmd_list_element *cur_list;
   struct cmd_list_element *prev_cmd;
 
index e97dabfbf200915abc01f8b7a420533c09a99af8..4322640ccaf3b40318224d7c0884c5743e8e222a 100644 (file)
@@ -55,7 +55,6 @@ static gdb::unique_xmalloc_ptr<char>
 scan_filename (const char **cmd, const char *defname)
 {
   gdb::unique_xmalloc_ptr<char> filename;
-  char *fullname;
 
   /* FIXME: Need to get the ``/a(ppend)'' flag from somewhere.  */
 
@@ -516,7 +515,6 @@ static void
 restore_command (const char *args, int from_tty)
 {
   struct callback_data data;
-  bfd *ibfd;
   int binary_flag = 0;
 
   if (!target_has_execution)
index ca26f13eda359fea074da8f773c173eb374c0f31..2a340e8409e9c83c20b184c01f13e3ef66fe479a 100644 (file)
@@ -389,7 +389,6 @@ compute_stack_depth (enum bfd_endian byte_order, unsigned int addr_size,
                     int initial_depth,
                     std::vector<struct insn_info> *info)
 {
-  unsigned char *set;
   std::vector<int> to_do;
   int stack_depth, i;
 
index e69fbc6c9c0e9f7347c7d22e9a3348df2782a075..f1c8ccd4d09c42e3b89d21f43f1732f53ae8a332 100644 (file)
@@ -608,15 +608,13 @@ compile_object_load (const compile_file_names &file_names,
 {
   struct cleanup *cleanups;
   struct setup_sections_data setup_sections_data;
-  CORE_ADDR addr, regs_addr, out_value_addr = 0;
+  CORE_ADDR regs_addr, out_value_addr = 0;
   struct symbol *func_sym;
   struct type *func_type;
   struct bound_minimal_symbol bmsym;
   long storage_needed;
   asymbol **symbol_table, **symp;
   long number_of_symbols, missing_symbols;
-  struct type *dptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
-  unsigned dptr_type_len = TYPE_LENGTH (dptr_type);
   struct compile_module *retval;
   struct type *regs_type, *out_value_type = NULL;
   char **matching;
index 9c367796c7ad3b5e7a321d26f452bf6f5c76104c..6580f39c026d4dd8d770903ac40585341b94ba3f 100644 (file)
@@ -116,8 +116,6 @@ void
 compile_object_run (struct compile_module *module)
 {
   struct value *func_val;
-  struct frame_id dummy_id;
-  struct cleanup *cleanups;
   struct do_module_cleanup *data;
   const char *objfile_name_s = objfile_name (module->objfile);
   int dtor_found, executed = 0;
index 9de244a6ee2a14cfc834c068b52b3e50738bf8e2..c47d7d2e1c59e69b718a8719110e0c5d92fa056b 100644 (file)
@@ -462,7 +462,6 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
   int argc;
   char **argv;
   int ok;
-  FILE *src;
   struct gdbarch *gdbarch = get_current_arch ();
   char *triplet_rx;
   char *error_message;
index 701f578245595688945791595da178cc0922a7dd..1cfabcd2516c7b8002724c70dae896b40dd3c01d 100644 (file)
@@ -154,7 +154,6 @@ filename_completer (struct cmd_list_element *ignore,
                    const char *text, const char *word)
 {
   int subsequent_name;
-  VEC (char_ptr) *return_val = NULL;
 
   subsequent_name = 0;
   while (1)
@@ -429,7 +428,6 @@ static void
 complete_files_symbols (completion_tracker &tracker,
                        const char *text, const char *word)
 {
-  int ix;
   completion_list fn_list;
   const char *p;
   int quote_found = 0;
@@ -524,8 +522,6 @@ complete_files_symbols (completion_tracker &tracker,
 
   if (!fn_list.empty () && !tracker.have_completions ())
     {
-      char *fn;
-
       /* If we only have file names as possible completion, we should
         bring them in sync with what rl_complete expects.  The
         problem is that if the user types "break /foo/b TAB", and the
@@ -1081,7 +1077,6 @@ complete_expression (completion_tracker &tracker,
     }
   else if (fieldname && code != TYPE_CODE_UNDEF)
     {
-      VEC (char_ptr) *result;
       struct cleanup *cleanup = make_cleanup (xfree, fieldname);
 
       collect_symbol_completion_matches_type (tracker, fieldname, fieldname,
index 68009054a07e7b1c037a8967199bcd60fd880fb5..4214896aaf67065657b7a7ced8fbf39d8522dbb3 100644 (file)
@@ -272,7 +272,6 @@ core_open (const char *arg, int from_tty)
   const char *p;
   int siggy;
   struct cleanup *old_chain;
-  char *temp;
   int scratch_chan;
   int flags;
 
index 35cf78c40925fe0afba3839b7aa96147f7f81fd5..e9bd6fe58088473f7cd320bba815d02eab075260 100644 (file)
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -313,7 +313,6 @@ ctf_start (struct trace_file_writer *self, const char *dirname)
 {
   struct ctf_trace_file_writer *writer
     = (struct ctf_trace_file_writer *) self;
-  int i;
   mode_t hmode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH;
 
   /* Create DIRNAME.  */
@@ -453,7 +452,6 @@ ctf_write_status (struct trace_file_writer *self,
   struct ctf_trace_file_writer *writer
     = (struct ctf_trace_file_writer *) self;
   uint32_t id;
-  int32_t int32;
 
   ctf_save_write_metadata (&writer->tcs, "\n");
   ctf_save_write_metadata (&writer->tcs,
@@ -496,7 +494,6 @@ ctf_write_uploaded_tsv (struct trace_file_writer *self,
     = (struct ctf_trace_file_writer *) self;
   int32_t int32;
   int64_t int64;
-  unsigned int len;
   const gdb_byte zero = 0;
 
   /* Event Id.  */
@@ -618,9 +615,6 @@ ctf_write_tdesc (struct trace_file_writer *self)
 static void
 ctf_write_definition_end (struct trace_file_writer *self)
 {
-  struct ctf_trace_file_writer *writer
-    = (struct ctf_trace_file_writer *) self;
-
   self->ops->frame_ops->end (self);
 }
 
@@ -859,7 +853,6 @@ static void
 ctf_open_dir (const char *dirname)
 {
   struct bt_iter_pos begin_pos;
-  struct bt_iter_pos *pos;
   unsigned int count, i;
   struct bt_ctf_event_decl * const *list;
 
@@ -889,7 +882,6 @@ ctf_open_dir (const char *dirname)
   for (i = 0; i < count; i++)
     if (strcmp ("register", bt_ctf_get_decl_event_name (list[i])) == 0)
       {
-       unsigned int j;
        const struct bt_ctf_field_decl * const *field_list;
        const struct bt_declaration *decl;
 
@@ -1284,7 +1276,6 @@ ctf_xfer_partial (struct target_ops *ops, enum target_object object,
   if (get_traceframe_number () != -1)
     {
       struct bt_iter_pos *pos;
-      int i = 0;
       enum target_xfer_status res;
       /* Records the lowest available address of all blocks that
         intersects the requested range.  */
@@ -1302,8 +1293,6 @@ ctf_xfer_partial (struct target_ops *ops, enum target_object object,
          ULONGEST amt;
          uint64_t maddr;
          uint16_t mlen;
-         enum bfd_endian byte_order
-           = gdbarch_byte_order (target_gdbarch ());
          const struct bt_definition *scope;
          const struct bt_definition *def;
          struct bt_ctf_event *event
@@ -1336,8 +1325,6 @@ ctf_xfer_partial (struct target_ops *ops, enum target_object object,
            {
              const struct bt_definition *array
                = bt_ctf_get_field (event, scope, "contents");
-             const struct bt_declaration *decl
-               = bt_ctf_get_decl_from_def (array);
              gdb_byte *contents;
              int k;
 
@@ -1534,10 +1521,8 @@ static int
 ctf_trace_find (struct target_ops *self, enum trace_find_type type, int num,
                CORE_ADDR addr1, CORE_ADDR addr2, int *tpp)
 {
-  int ret = -1;
   int tfnum = 0;
   int found = 0;
-  struct bt_iter_pos pos;
 
   if (num == -1)
     {
@@ -1552,7 +1537,6 @@ ctf_trace_find (struct target_ops *self, enum trace_find_type type, int num,
 
   while (1)
     {
-      int id;
       struct bt_ctf_event *event;
       const char *name;
 
index 4b2c8e6b024ec61937e119e1807e5f9af5ccfde5..ab629f62a249c3599538ab12c5e6a3eb73d885db 100644 (file)
@@ -263,7 +263,6 @@ gdb_pretty_print_disassembler::pretty_print_insn (struct ui_out *uiout,
       {
        CORE_ADDR end_pc;
        bfd_byte data;
-       int err;
        const char *spacer = "";
 
        /* Build the opcodes using a temporary stream so we can
index fe2fea0d0e6a0e2b3c9656ba6e31dec17fe820f1..83a8c34229e44d789365ef05cea1148b740fdc9c 100644 (file)
@@ -1501,7 +1501,6 @@ allocate_piece_closure (struct dwarf2_per_cu_data *per_cu,
                        struct frame_info *frame)
 {
   struct piece_closure *c = new piece_closure;
-  int i;
 
   c->refc = 1;
   c->per_cu = per_cu;
@@ -2179,7 +2178,6 @@ indirect_pieced_value (struct value *value)
     = (struct piece_closure *) value_computed_closure (value);
   struct type *type;
   struct frame_info *frame;
-  struct dwarf2_locexpr_baton baton;
   int i, bit_length;
   LONGEST bit_offset;
   struct dwarf_expr_piece *piece = NULL;
@@ -2387,7 +2385,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
     {
       struct piece_closure *c;
       ULONGEST bit_size = 0;
-      int i;
 
       for (dwarf_expr_piece &piece : ctx.pieces)
        bit_size += piece.size;
index 78c663c49ba94985f03201084139e828ccfbe3c0..287de7bae9318586dd2d5e170a9f0cb564c7fbe6 100644 (file)
@@ -4938,7 +4938,6 @@ dw2_expand_marked_cus
    gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
    search_domain kind)
 {
-  const char *name;
   offset_type *vec, vec_len, vec_idx;
   bool global_seen = false;
 
@@ -5029,7 +5028,6 @@ dw2_expand_symtabs_matching
    enum search_domain kind)
 {
   int i;
-  offset_type iter;
 
   dw2_setup (objfile);
 
@@ -5213,7 +5211,6 @@ dw2_map_symbol_filenames (struct objfile *objfile, symbol_filename_ftype *fun,
 
       for (int i = 0; i < dwarf2_per_objfile->n_comp_units; ++i)
        {
-         int j;
          struct dwarf2_per_cu_data *per_cu = dw2_get_cu (i);
          struct quick_file_names *file_data;
          void **slot;
@@ -5553,7 +5550,6 @@ read_and_check_comp_unit_head (struct comp_unit_head *header,
                               rcuh_kind section_kind)
 {
   const gdb_byte *beg_of_comp_unit = info_ptr;
-  bfd *abfd = get_section_bfd_owner (section);
 
   header->sect_off = (sect_offset) (beg_of_comp_unit - section->buffer);
 
@@ -6196,7 +6192,6 @@ read_cutu_die_from_dwo (struct dwarf2_per_cu_data *this_cu,
   struct dwarf2_section_info *section;
   bfd *abfd;
   const gdb_byte *begin_info_ptr, *info_ptr;
-  ULONGEST signature; /* Or dwo_id.  */
   struct attribute *comp_dir, *stmt_list, *low_pc, *high_pc, *ranges;
   int i,num_extra_attrs;
   struct dwarf2_section_info *dwo_abbrev_section;
@@ -6383,7 +6378,6 @@ lookup_dwo_unit (struct dwarf2_per_cu_data *this_cu,
                 struct die_info *comp_unit_die)
 {
   struct dwarf2_cu *cu = this_cu->cu;
-  struct attribute *attr;
   ULONGEST signature;
   struct dwo_unit *dwo_unit;
   const char *comp_dir, *dwo_name;
@@ -7651,7 +7645,6 @@ read_comp_units_from_section (struct objfile *objfile,
                              struct dwarf2_per_cu_data ***all_comp_units)
 {
   const gdb_byte *info_ptr;
-  bfd *abfd = get_section_bfd_owner (section);
 
   if (dwarf_read_debug)
     fprintf_unfiltered (gdb_stdlog, "Reading %s for %s\n",
@@ -9666,7 +9659,6 @@ dwarf2_compute_name (const char *name,
     {
       if (die_needs_namespace (die, cu))
        {
-         long length;
          const char *prefix;
          const char *canonical_name = NULL;
 
@@ -10267,7 +10259,6 @@ handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu,
   struct attribute *attr;
   struct line_header line_header_local;
   hashval_t line_header_local_hash;
-  unsigned u;
   void **slot;
   int decode_mapping;
 
@@ -10739,7 +10730,6 @@ create_cus_hash_table (struct dwo_file &dwo_file, dwarf2_section_info &section,
                       htab_t &cus_htab)
 {
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  const struct dwarf2_section_info *abbrev_section = &dwo_file.sections.abbrev;
   const gdb_byte *info_ptr, *end_ptr;
 
   dwarf2_read_section (objfile, &section);
@@ -11359,8 +11349,6 @@ create_dwp_v2_section (struct dwarf2_section_info *section,
   if (sectp == NULL
       || offset + size > bfd_get_section_size (sectp))
     {
-      bfd *abfd = sectp->owner;
-
       error (_("Dwarf Error: Bad DWP V2 section info, doesn't fit"
               " in section %s [in module %s]"),
             sectp ? bfd_section_name (abfd, sectp) : "<unknown>",
@@ -13118,18 +13106,11 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
                         Callback &&callback)
 {
   struct objfile *objfile = cu->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
-  struct comp_unit_head *cu_header = &cu->header;
   bfd *obfd = objfile->obfd;
-  unsigned int addr_size = cu_header->addr_size;
-  CORE_ADDR mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
   /* Base address selection entry.  */
   CORE_ADDR base;
   int found_base;
-  unsigned int dummy;
   const gdb_byte *buffer;
-  CORE_ADDR low = 0;
-  CORE_ADDR high = 0;
   CORE_ADDR baseaddr;
   bool overflow = false;
 
@@ -13291,7 +13272,6 @@ dwarf2_ranges_process (unsigned offset, struct dwarf2_cu *cu,
                       Callback &&callback)
 {
   struct objfile *objfile = cu->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
   struct comp_unit_head *cu_header = &cu->header;
   bfd *obfd = objfile->obfd;
   unsigned int addr_size = cu_header->addr_size;
@@ -13665,7 +13645,6 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block,
   attr = dwarf2_attr (die, DW_AT_ranges, cu);
   if (attr)
     {
-      bfd *obfd = objfile->obfd;
       /* DW_AT_ranges_base does not apply to DIEs from the DWO skeleton.
         We take advantage of the fact that DW_AT_ranges does not appear
         in DW_TAG_compile_unit of DWO files.  */
@@ -14441,7 +14420,6 @@ static int
 is_vtable_name (const char *name, struct dwarf2_cu *cu)
 {
   static const char vptr[] = "_vptr";
-  static const char vtable[] = "vtable";
 
   /* Look for the C++ form of the vtable.  */
   if (startswith (name, vptr) && is_cplus_marker (name[sizeof (vptr) - 1]))
@@ -18733,7 +18711,6 @@ read_formatted_entries (bfd *abfd, const gdb_byte **bufp,
   ULONGEST data_count, datai;
   const gdb_byte *buf = *bufp;
   const gdb_byte *format_header_data;
-  int i;
   unsigned int bytes_read;
 
   format_count = read_1_byte (abfd, buf);
@@ -22793,7 +22770,6 @@ skip_form_bytes (bfd *abfd, const gdb_byte *bytes, const gdb_byte *buffer_end,
 
     default:
       {
-      complain:
        complaint (&symfile_complaints,
                   _("invalid form 0x%x in `%s'"),
                   form, get_section_name (section));
index b806ca3b40994e42e70396bbd853c5d776aafb44..b8881d92a7afc382a336158a78efb29c92b74b48 100644 (file)
@@ -237,7 +237,6 @@ elf_symtab_read (minimal_symbol_reader &reader,
   /* Name of the last file symbol.  This is either a constant string or is
      saved on the objfile's filename cache.  */
   const char *filesymname = "";
-  struct dbx_symfile_info *dbx = DBX_SYMFILE_INFO (objfile);
   int stripped = (bfd_get_symcount (objfile->obfd) == 0);
   int elf_make_msymbol_special_p
     = gdbarch_elf_make_msymbol_special_p (gdbarch);
index 4fbe9dd63514f6acb4a472246a8a1f78540c6d8f..adff980f0218d5af2c510cf3f9603303489fd4e2 100644 (file)
@@ -395,8 +395,6 @@ exec_file_attach (const char *filename, int from_tty)
 static void
 exec_file_command (const char *args, int from_tty)
 {
-  char *filename;
-
   if (from_tty && target_has_execution
       && !query (_("A program is being debugged already.\n"
                   "Are you sure you want to change the file? ")))
index c9ece0d5c044c2e167f19993810eb4a80f48a6a5..d16dc0593d86bf4cc81681c3580cb332cf4a62b4 100644 (file)
@@ -214,7 +214,6 @@ f_val_print (struct type *type, int embedded_offset,
             const struct value_print_options *options)
 {
   struct gdbarch *gdbarch = get_type_arch (type);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int printed_field = 0; /* Number of fields printed.  */
   struct type *elttype;
   CORE_ADDR addr;
@@ -376,7 +375,6 @@ info_common_command_for_block (const struct block *block, const char *comname,
 {
   struct block_iterator iter;
   struct symbol *sym;
-  const char *name;
   struct value_print_options opts;
 
   get_user_print_options (&opts);
index ccab17e350bf8f1baf8c4dbf24f956f3759811a0..04c6f232d8e529a01f20537520abf5ac945b3eb6 100644 (file)
@@ -1,3 +1,7 @@
+2017-12-05  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * regcache.c (registers_to_string): Remove unused variable.
+
 2017-12-02  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * inferiors.c (for_each_inferior_with_data): Remove.
index 6a2704276757bfabb0144650dd2827155e83ef53..c4ece0fd560200bcaa58a200180eb73a81a570d1 100644 (file)
@@ -207,8 +207,6 @@ registers_to_string (struct regcache *regcache, char *buf)
 
   for (int i = 0; i < tdesc->reg_defs.size (); ++i)
     {
-      struct reg *reg = tdesc->reg_defs[i];
-
       if (regcache->register_status[i] == REG_VALID)
        {
          bin2hex (registers, buf, register_size (tdesc, i));
index bc3c45f368d54f4b8632602b6a0183f9142d9c82..af1f9ae9f2786c1c1081994363fa13fd07e2fe45 100644 (file)
@@ -605,7 +605,6 @@ static void
 initialize_scheme_side (void)
 {
   char *boot_scm_path;
-  char *msg;
 
   guile_datadir = concat (gdb_datadir, SLASH_STRING, "guile", (char *) NULL);
   boot_scm_path = concat (guile_datadir, SLASH_STRING, "gdb",
index f84815e739e1e08cec463c0560833facd2b664e4..c2d5c7774c9e86f322b81e1465b4fdc129c45141 100644 (file)
@@ -975,7 +975,6 @@ gdbscm_breakpoint_commands (SCM self)
   breakpoint_smob *bp_smob
     = bpscm_get_valid_breakpoint_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct breakpoint *bp;
-  long length;
   SCM result;
 
   bp = bp_smob->bp;
index 4745defb27eab0ed0665bc36da2ee21a02b695c5..bcc7462caa322cfdab5ff1f642b039cd9b5ac86b 100644 (file)
@@ -385,7 +385,7 @@ cmdscm_completer (struct cmd_list_element *command,
 {
   command_smob *c_smob/*obj*/ = (command_smob *) get_cmd_context (command);
   SCM completer_result_scm;
-  SCM text_scm, word_scm, result_scm;
+  SCM text_scm, word_scm;
 
   gdb_assert (c_smob != NULL);
   gdb_assert (gdbscm_is_procedure (c_smob->complete));
@@ -746,7 +746,7 @@ gdbscm_register_command_x (SCM self)
 {
   command_smob *c_smob
     = cmdscm_get_command_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
-  char *cmd_name, *pfx_name;
+  char *cmd_name;
   struct cmd_list_element **cmd_list;
   struct cmd_list_element *cmd = NULL;
 
index 594d16e2371f1506ce5765d938159aa1ac58bf41..fd5a60e0e54bf1695a168609a0d2ec8cb770b439 100644 (file)
@@ -840,7 +840,6 @@ static SCM
 gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
 {
   SCM keywords[] = { block_keyword, SCM_BOOL_F };
-  int rc;
   frame_smob *f_smob;
   int block_arg_pos = -1;
   SCM block_scm = SCM_UNDEFINED;
index 94787787f10af2f5e6f98320508f9b22d92420ad..79b5bb484796032395adc00c474ee5ae8f1c1b95 100644 (file)
@@ -1062,7 +1062,6 @@ gdbscm_parameter_value (SCM self)
       char *name;
       SCM except_scm;
       struct cmd_list_element *alias, *prefix, *cmd;
-      const char *arg;
       char *newarg;
       int found = -1;
       struct gdb_exception except = exception_none;
index a7c0bd410c5cf20374a34bf229a4be3e3908a990..340f505a509befc01ce623f66aeb96dbb5d8e7a5 100644 (file)
@@ -98,10 +98,6 @@ static SCM input_port_scm;
 static SCM output_port_scm;
 static SCM error_port_scm;
 
-/* Magic number to identify port ui-files.
-   Actually, the address of this variable is the magic number.  */
-static int file_port_magic;
-
 /* Internal enum for specifying output port.  */
 enum oport { GDB_STDOUT, GDB_STDERR };
 
index a28e4e685ff8e6321b138496447618f86285102e..45edcf1cd6164002180bbaf2d490f9ccc9416708 100644 (file)
@@ -381,7 +381,6 @@ ppscm_search_pp_list (SCM list, SCM value)
       SCM matcher = scm_car (list);
       SCM worker;
       pretty_printer_smob *pp_smob;
-      int rc;
 
       if (!ppscm_is_pretty_printer (matcher))
        {
@@ -534,7 +533,6 @@ ppscm_pretty_print_one_value (SCM printer, struct value **out_value,
   *out_value = NULL;
   TRY
     {
-      int rc;
       pretty_printer_worker_smob *w_smob
        = (pretty_printer_worker_smob *) SCM_SMOB_DATA (printer);
 
@@ -744,7 +742,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
     = (pretty_printer_worker_smob *) SCM_SMOB_DATA (printer);
   int is_map, is_array, done_flag, pretty;
   unsigned int i;
-  SCM children, status;
+  SCM children;
   SCM iter = SCM_BOOL_F; /* -Wall */
   struct cleanup *cleanups;
 
@@ -799,7 +797,6 @@ ppscm_print_children (SCM printer, enum display_hint hint,
   done_flag = 0;
   for (i = 0; i < options->print_max; ++i)
     {
-      int rc;
       SCM scm_name, v_scm;
       char *name;
       SCM item = itscm_safe_call_next_x (iter, gdbscm_memory_error_p);
index 4e495ebd5c9cdd762fa3405d9f8e8a5ea5836374..5adac4ed09b0e6a63fcb1a93fd281f8735b105d3 100644 (file)
@@ -241,7 +241,6 @@ static SCM
 gdbscm_string_to_argv (SCM string_scm)
 {
   char *string;
-  int i;
   SCM result = SCM_EOL;
 
   gdbscm_parse_function_args (FUNC_NAME, SCM_ARG1, NULL, "s",
index 755ea672472ba19ecdff4a5669b585972bc9b5b8..e5278a76a746cc284c04a7c8d019a7d479a150b4 100644 (file)
@@ -578,7 +578,6 @@ static SCM
 gdbscm_sal_symtab (SCM self)
 {
   sal_smob *s_smob = stscm_get_valid_sal_smob_arg (self, SCM_ARG1, FUNC_NAME);
-  const struct symtab_and_line *sal = &s_smob->sal;
 
   return s_smob->symtab_scm;
 }
index 704be886d6a06a52b0e8f6eb38d057547ad15e1c..922351d303f2cd9aec20bd62168e0bc2740d23f5 100644 (file)
@@ -1090,7 +1090,7 @@ gdbscm_type_next_field_x (SCM self)
   type_smob *t_smob;
   struct type *type;
   SCM it_scm, result, progress, object;
-  int field, rc;
+  int field;
 
   it_scm = itscm_get_iterator_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   i_smob = (iterator_smob *) SCM_SMOB_DATA (it_scm);
index b7c955d777f2218cc15e08062ba790c435f460e5..c0557dd0fbf69e3471628433bb266d33e484331f 100644 (file)
@@ -381,7 +381,7 @@ gdbscm_parse_function_args (const char *func_name,
 {
   va_list args;
   const char *p;
-  int i, have_rest, num_keywords, length, position;
+  int i, have_rest, num_keywords, position;
   int have_optional = 0;
   SCM status;
   SCM rest = SCM_EOL;
index 81048081ad8035cd0c82c651f8982d7c6de987f7..12d5a24bc630b8f679fbb6844b92af57a787c341 100644 (file)
@@ -4518,8 +4518,8 @@ i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
   const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int fp_regnum_p, mmx_regnum_p, xmm_regnum_p, mxcsr_regnum_p,
       ymm_regnum_p, ymmh_regnum_p, ymm_avx512_regnum_p, ymmh_avx512_regnum_p,
-      bndr_regnum_p, bnd_regnum_p, k_regnum_p, zmm_regnum_p, zmmh_regnum_p,
-      zmm_avx512_regnum_p, mpx_ctrl_regnum_p, xmm_avx512_regnum_p,
+      bndr_regnum_p, bnd_regnum_p, zmm_regnum_p, zmmh_regnum_p,
+      mpx_ctrl_regnum_p, xmm_avx512_regnum_p,
       avx512_p, avx_p, sse_p, pkru_regnum_p;
 
   /* Don't include pseudo registers, except for MMX, in any register
index 9cee17403424f7888a35acbf610602b576ed8ebe..8bde28eab69afbca1cc3aa6650eed92e7a7e9942 100644 (file)
@@ -569,7 +569,6 @@ run_command_1 (const char *args, int from_tty, enum run_how run_how)
   struct ui_out *uiout = current_uiout;
   struct target_ops *run_target;
   int async_exec;
-  CORE_ADDR pc;
 
   dont_repeat ();
 
@@ -1497,8 +1496,6 @@ until_next_fsm_should_stop (struct thread_fsm *self,
 static void
 until_next_fsm_clean_up (struct thread_fsm *self, struct thread_info *thread)
 {
-  struct until_next_fsm *sm = (struct until_next_fsm *) self;
-
   delete_longjmp_breakpoint (thread->global_num);
 }
 
index e9664a0f316ba4c50c314bd83ba6c9efdb8cd8de..097587629a416c77d6c6c68b9524db45663d7d28 100644 (file)
@@ -3113,7 +3113,6 @@ linespec_complete (completion_tracker &tracker, const char *text,
         the ':', then complete_linespec_component won't try to
         complete on source filenames.  */
 
-      const char *text = parser.completion_word;
       const char *word = parser.completion_word;
 
       complete_linespec_component (&parser, tracker,
@@ -4159,7 +4158,6 @@ find_label_symbols (struct linespec_state *self,
 {
   int ix;
   const struct block *block;
-  struct symbol *sym;
   struct symbol *fn_sym;
   VEC (symbolp) *result = NULL;
 
index 9660fe7c033e3e72fa9f6aece36c90b560e65fee..344a37678dc9f3c46997646c15a07973ce10f3e0 100644 (file)
@@ -313,7 +313,6 @@ m2_val_print (struct type *type, int embedded_offset,
              struct value *original_value,
              const struct value_print_options *options)
 {
-  struct gdbarch *gdbarch = get_type_arch (type);
   unsigned len;
   struct type *elttype;
   CORE_ADDR addr;
index 02b93e838b897b669cbdc17fb5a4830c67a3b135..aa772ef31f8d294f585c7227cfe74a3c9a8b645f 100644 (file)
@@ -74,9 +74,6 @@ show_inaccessible_by_default (struct ui_file *file, int from_tty,
 static void
 require_user_regions (int from_tty)
 {
-  struct mem_region *m;
-  int ix, length;
-
   /* If we're already using a user-provided list, nothing to do.  */
   if (!mem_use_target ())
     return;
@@ -166,10 +163,8 @@ struct mem_region *
 lookup_mem_region (CORE_ADDR addr)
 {
   static struct mem_region region (0, 0);
-  struct mem_region *m;
   CORE_ADDR lo;
   CORE_ADDR hi;
-  int ix;
 
   require_target_regions ();
 
@@ -531,9 +526,6 @@ disable_mem_command (const char *args, int from_tty)
 
   if (args == NULL || *args == '\0')
     {
-      struct mem_region *m;
-      int ix;
-
       for (mem_region &m : *mem_region_list)
        m.enabled_p = false;
     }
@@ -553,9 +545,6 @@ disable_mem_command (const char *args, int from_tty)
 static void
 mem_delete (int num)
 {
-  struct mem_region *m;
-  int ix;
-
   if (!mem_region_list)
     {
       printf_unfiltered (_("No memory region number %d.\n"), num);
index bf08ca14d27f17249a6367606c32560ba8e420ce..202cccb6e449716bfb22d3da6d9fafc934ff6c7c 100644 (file)
@@ -927,8 +927,6 @@ current_ccr_names (void)
 static const char *
 mep_register_name (struct gdbarch *gdbarch, int regnr)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);  
-
   /* General-purpose registers.  */
   static const char *gpr_names[] = {
     "r0",   "r1",   "r2",   "r3",   /* 0 */
@@ -1673,7 +1671,6 @@ mep_analyze_prologue (struct gdbarch *gdbarch,
   CORE_ADDR pc;
   unsigned long insn;
   int rn;
-  int found_lp = 0;
   pv_t reg[MEP_NUM_REGS];
   CORE_ADDR after_last_frame_setup_insn = start_pc;
 
index a39ef3b35b43f032dabfdb04230784061aac423f..b6a1d9ba274682591ee97f4cab87446c528afb16 100644 (file)
@@ -119,7 +119,6 @@ mi_cmd_file_list_shared_libraries (const char *command, char **argv, int argc)
   struct ui_out *uiout = current_uiout;
   const char *pattern;
   struct so_list *so = NULL;
-  struct gdbarch *gdbarch = target_gdbarch ();
 
   switch (argc)
     {
index d845a9c1b3dd269e3fcde01dfc2345685644cbd7..bbf537d09840d1da9040c6f4758490a849a58ad2 100644 (file)
@@ -284,7 +284,6 @@ mi_execute_command_wrapper (const char *cmd)
 static void
 mi_on_sync_execution_done (void)
 {
-  struct ui *ui = current_ui;
   struct mi_interp *mi = as_mi_interp (top_level_interpreter ());
 
   if (mi == NULL)
index 3261488d75208bab550115aedf5cd0ca42e232aa..3c04f59b060292f2650d755be52e9ed684fc9083 100644 (file)
@@ -2605,8 +2605,6 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
 
   /* Explicitly wholly collected variables.  */
   {
-    int i;
-
     ui_out_emit_list list_emitter (uiout, "explicit-variables");
     const std::vector<std::string> &wholly_collected
       = clist->wholly_collected ();
@@ -2619,9 +2617,6 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
 
   /* Computed expressions.  */
   {
-    char *p;
-    int i;
-
     ui_out_emit_list list_emitter (uiout, "computed-expressions");
 
     const std::vector<std::string> &computed = clist->computed ();
index 285eefe33fb78a98111360dcd28c5f1697f38fea..4fdf106042a626bd5b71f7aa57327eef6f4a30f5 100644 (file)
@@ -119,8 +119,6 @@ static void
 microblaze_linux_init_abi (struct gdbarch_info info,
                           struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   linux_init_abi (info, gdbarch);
 
   set_gdbarch_memory_remove_breakpoint (gdbarch,
index d4687dda09d803d77495fbf85cae0a42e294e036..fd00e60c08edff80be6f92c7d53d86eb4b259aaa 100644 (file)
@@ -83,7 +83,6 @@ lzma_open (struct bfd *nbfd, void *open_closure)
   gdb_byte footer[LZMA_STREAM_HEADER_SIZE];
   gdb_byte *indexdata;
   lzma_index *index;
-  int ret;
   uint64_t memlimit = UINT64_MAX;
   struct gdb_lzma_stream *lstream;
   size_t pos;
index d68fb65a9e0ad6cd5fea21f480ad70856d0eab76..123d466869dc9d5987a8c5169cd079c197042fc3 100644 (file)
@@ -330,8 +330,6 @@ lookup_minimal_symbol (const char *name, const char *sfile,
        objfile != NULL && found.external_symbol.minsym == NULL;
        objfile = objfile->next)
     {
-      struct minimal_symbol *msymbol;
-
       if (objf == NULL || objf == objfile
          || objf == objfile->separate_debug_objfile_backlink)
        {
index ebdacd981e6020706403dd19b6339104846cc670..53d3f197e331799139947ffe2b55bc2dc279a563 100644 (file)
@@ -530,7 +530,6 @@ mips64_fill_fpregset (const struct regcache *regcache,
                      mips64_elf_fpregset_t *fpregsetp, int regno)
 {
   struct gdbarch *gdbarch = regcache->arch ();
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   gdb_byte *to;
 
   if ((regno >= gdbarch_fp0_regnum (gdbarch))
index 830535f73d433e41bf7502439d093fd03309ba84..a09f644aaaa05d1fe35e9b91b953502ff422f3c2 100644 (file)
@@ -3781,7 +3781,6 @@ mips_stub_frame_sniffer (const struct frame_unwind *self,
                         struct frame_info *this_frame, void **this_cache)
 {
   gdb_byte dummy[4];
-  struct obj_section *s;
   CORE_ADDR pc = get_frame_address_in_block (this_frame);
   struct bound_minimal_symbol msym;
 
@@ -6074,7 +6073,6 @@ mips_o64_return_value (struct gdbarch *gdbarch, struct value *function,
 {
   CORE_ADDR func_addr = function ? find_function_addr (function, NULL) : 0;
   int mips16 = mips_pc_is_mips16 (gdbarch, func_addr);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum mips_fval_reg fval_reg;
 
   fval_reg = readbuf ? mips16 ? mips_fval_gpr : mips_fval_fpr : mips_fval_both;
@@ -6593,11 +6591,9 @@ static int
 mips_single_step_through_delay (struct gdbarch *gdbarch,
                                struct frame_info *frame)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR pc = get_frame_pc (frame);
   enum mips_isa isa;
   ULONGEST insn;
-  int status;
   int size;
 
   if ((mips_pc_is_mips (pc)
@@ -8969,7 +8965,6 @@ void
 _initialize_mips_tdep (void)
 {
   static struct cmd_list_element *mipsfpulist = NULL;
-  struct cmd_list_element *c;
 
   mips_abi_string = mips_abi_strings[MIPS_ABI_UNKNOWN];
   if (MIPS_ABI_LAST + 1
index 0a9f13801c0ac2e876a8814e537b6102c26a2b6e..51300d09db65a5a661d24314cb75d21bd9597dc9 100644 (file)
@@ -1817,7 +1817,6 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                        int struct_return, CORE_ADDR struct_addr)
 {
   int argreg;
-  int float_argreg;
   int argnum;
   int len = 0;
   int stack_offset = 0;
@@ -2209,7 +2208,6 @@ nios2_get_next_pc (struct regcache *regcache, CORE_ADDR pc)
 static std::vector<CORE_ADDR>
 nios2_software_single_step (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR next_pc = nios2_get_next_pc (regcache, regcache_read_pc (regcache));
 
   return {next_pc};
index 506efa38fb791105327cace7a97b385abbab5ddf..dff519ba63244183857105821a17caddbe99f3d8 100644 (file)
@@ -502,8 +502,6 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
   if (address_p != NULL)
     *address_p = addr;
 
-  struct type *the_type;
-
   switch (type)
     {
     case mst_text:
index c74ea21d6f4ca1104630a39990c909d900d0d4bc..c87ef25d612c0e9413e652416ab795f173a0dcd1 100644 (file)
@@ -803,7 +803,6 @@ psym_relocate (struct objfile *objfile,
               const struct section_offsets *new_offsets,
               const struct section_offsets *delta)
 {
-  struct partial_symbol **psym;
   struct partial_symtab *p;
 
   ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, p)
index 5bc073ece65df5c0e45234bb428bcd28a19dc360..2574683ed4785259c67fee2b00875098905e47d0 100644 (file)
@@ -484,8 +484,6 @@ bppy_get_commands (PyObject *self, void *closure)
 {
   gdbpy_breakpoint_object *self_bp = (gdbpy_breakpoint_object *) self;
   struct breakpoint *bp = self_bp->bp;
-  long length;
-  PyObject *result;
 
   BPPY_REQUIRE_VALID (self_bp);
 
@@ -936,7 +934,6 @@ gdbpy_breakpoint_modified (struct breakpoint *b)
   int num = b->number;
   PyGILState_STATE state;
   struct breakpoint *bp = NULL;
-  gdbpy_breakpoint_object *bp_obj;
 
   state = PyGILState_Ensure ();
   bp = get_breakpoint (num);
index 825a89205d678b34773423fa73bb8f15e624f99e..2464f8b5a6569aeffd926c066d83ac04b372114c 100644 (file)
@@ -29,7 +29,6 @@ create_inferior_call_event_object (inferior_call_kind flag, ptid_t ptid,
                                   CORE_ADDR addr)
 {
   gdbpy_ref<> event;
-  int failed;
 
   switch (flag)
     {
index 220990b33caa99a91fc9781c7219b6f55f8e97b7..55f673eedaf2b3c40412d69a0706c713f7d7fa22 100644 (file)
@@ -464,7 +464,6 @@ static PyObject *
 btpy_list_item (PyObject *self, Py_ssize_t index)
 {
   const btpy_list_object * const obj = (btpy_list_object *) self;
-  struct thread_info * const tinfo = find_thread_ptid (obj->ptid);
   Py_ssize_t number;
 
   if (index < 0 || index >= btpy_list_length (self))
index 51184ca5ed63069a81cd30eeb9d1491509b2f51e..1453df54c02d2fa674c66eae80db4516d3150988 100644 (file)
@@ -965,7 +965,6 @@ static PyObject *
 typy_str (PyObject *self)
 {
   string_file thetype;
-  PyObject *result;
 
   TRY
     {
index 11f1fc978f60b939cde52f07352a9056d15bd015..b1ab824e39f02beb75477f572ec8df7e731f54cd 100644 (file)
@@ -874,7 +874,6 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
   struct value *function = ((value_object *) self)->value;
   struct value **vargs = NULL;
   struct type *ftype = NULL;
-  struct value *mark = value_mark ();
   PyObject *result = NULL;
 
   TRY
index c29a46b4486a073c549aaaa95d66f582fc840ac7..44ca121ff2ded4974cb7f082b59b4936290f488e 100644 (file)
@@ -1660,7 +1660,6 @@ static bool
 do_start_initialization ()
 {
 #ifdef IS_PY3K
-  int i;
   size_t progsize, count;
   wchar_t *progname_copy;
 #endif
index 07ef912f2dfddface0a223a68ec14e5673cce7df..452e4c74f6a0cd86a04fae5aa19b1f61be85325d 100644 (file)
@@ -810,7 +810,6 @@ record_btrace_insn_history_range (struct target_ops *self,
                                  gdb_disassembly_flags flags)
 {
   struct btrace_thread_info *btinfo;
-  struct btrace_insn_history *history;
   struct btrace_insn_iterator begin, end;
   struct ui_out *uiout;
   unsigned int low, high;
@@ -1167,7 +1166,6 @@ record_btrace_call_history_range (struct target_ops *self,
                                  int int_flags)
 {
   struct btrace_thread_info *btinfo;
-  struct btrace_call_history *history;
   struct btrace_call_iterator begin, end;
   struct ui_out *uiout;
   unsigned int low, high;
@@ -1251,7 +1249,6 @@ record_btrace_call_history_from (struct target_ops *self,
 static enum record_method
 record_btrace_record_method (struct target_ops *self, ptid_t ptid)
 {
-  const struct btrace_config *config;
   struct thread_info * const tp = find_thread_ptid (ptid);
 
   if (tp == NULL)
@@ -1293,8 +1290,6 @@ record_btrace_xfer_partial (struct target_ops *ops, enum target_object object,
                            const gdb_byte *writebuf, ULONGEST offset,
                            ULONGEST len, ULONGEST *xfered_len)
 {
-  struct target_ops *t;
-
   /* Filter out requests that don't make sense during replay.  */
   if (replay_memory_access == replay_memory_access_read_only
       && !record_btrace_generating_corefile
@@ -1545,7 +1540,6 @@ static const struct btrace_function *
 btrace_get_frame_function (struct frame_info *frame)
 {
   const struct btrace_frame_cache *cache;
-  const struct btrace_function *bfun;
   struct btrace_frame_cache pattern;
   void **slot;
 
index ec6fc696cfdd6452b7c2ae74634853db9024e802..b49f54cd820bfeb22ef55840731654691b031261 100644 (file)
@@ -828,8 +828,6 @@ static void record_full_init_record_breakpoints (void);
 static void
 record_full_open (const char *name, int from_tty)
 {
-  struct target_ops *t;
-
   if (record_debug)
     fprintf_unfiltered (gdb_stdlog, "Process record: record_full_open\n");
 
index b53c0bcd1f57f9f37a97d25c55e44825f5cd05be..5b554d47a5c9cd23675077d6bd49de9d523e0f4a 100644 (file)
@@ -452,7 +452,6 @@ get_context_size (const char **arg)
 {
   const char *pos;
   char *end;
-  int number;
 
   pos = skip_spaces (*arg);
 
index 1efa3f969006265c2b655146350fe164cae0c4f6..7f61ba2af7a0d4439747efeb76f2fe2d12d66ef2 100644 (file)
@@ -158,8 +158,6 @@ const struct TAG ## _data *                                         \
 register_ ## TAG ## _data_with_cleanup (void (*save) (struct TAG *, void *), \
                                        void (*free) (struct TAG *, void *)) \
 {                                                                      \
-  struct registry_data_registration **curr;                            \
-                                                                       \
   return (struct TAG ## _data *)                                       \
     register_data_with_cleanup (&TAG ## _data_registry,                        \
                                (registry_data_callback) save,          \
@@ -186,8 +184,6 @@ TAG ## registry_callback_adaptor (registry_data_callback func,              \
                                  void *data)                           \
 {                                                                      \
   struct TAG *tagged_container = (struct TAG *) container;             \
-  struct registry_fields *rdata                                                \
-    = &ACCESS (tagged_container)->registry_data;                       \
                                                                        \
   registry_ ## TAG ## _callback tagged_func                            \
     = (registry_ ## TAG ## _callback) func;                            \
index 877189382c49e1ba7f04b910b3972100b53d04a2..0bd7b9663370002234a60f6a5e33bdd13564ea52 100644 (file)
@@ -1169,8 +1169,6 @@ remote_fileio_reset (void)
 void
 remote_fileio_request (char *buf, int ctrlc_pending_p)
 {
-  int ex;
-
   /* Save the previous quit handler, so we can restore it.  No need
      for a cleanup since we catch all exceptions below.  Note that the
      quit handler is also restored by remote_fileio_reply just before
index 0a62ae00e573761f68202054fe6bb4191d4349e7..be2c65b3cfc3b639c363d29d791b2155005da607 100644 (file)
@@ -3222,7 +3222,6 @@ remote_update_thread_list (struct target_ops *ops)
       || remote_get_threads_with_qthreadinfo (ops, &context)
       || remote_get_threads_with_ql (ops, &context))
     {
-      int i;
       struct thread_info *tp, *tmp;
 
       got_list = 1;
@@ -4352,7 +4351,6 @@ init_all_packet_configs (void)
 static void
 remote_check_symbols (void)
 {
-  struct remote_state *rs = get_remote_state ();
   char *msg, *reply, *tmp;
   int end;
   long reply_size;
@@ -5869,7 +5867,6 @@ vcont_builder_push_action (struct vcont_builder *builder,
 static void
 remote_commit_resume (struct target_ops *ops)
 {
-  struct remote_state *rs = get_remote_state ();
   struct inferior *inf;
   struct thread_info *tp;
   int any_process_wildcard;
@@ -6167,8 +6164,6 @@ remote_stop (struct target_ops *self, ptid_t ptid)
 static void
 remote_interrupt (struct target_ops *self, ptid_t ptid)
 {
-  struct remote_state *rs = get_remote_state ();
-
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "remote_interrupt called\n");
 
@@ -9768,7 +9763,6 @@ remote_insert_breakpoint (struct target_ops *ops,
       CORE_ADDR addr = bp_tgt->reqstd_address;
       struct remote_state *rs;
       char *p, *endbuf;
-      int bpsize;
 
       /* Make sure the remote is pointing at the right process, if
         necessary.  */
@@ -10226,7 +10220,6 @@ static void
 compare_sections_command (const char *args, int from_tty)
 {
   asection *s;
-  gdb_byte *sectdata;
   const char *sectname;
   bfd_size_type size;
   bfd_vma lma;
index e372a6ea1eff0bee05f7d4219cbd3fa9622a5fa5..731a0391a6c5e9bb80acccfa93115d3725cf61f8 100644 (file)
@@ -1011,7 +1011,6 @@ super_name (const struct rust_op *ident, unsigned int n_supers)
 
   if (n_supers > 0)
     {
-      int i;
       int len;
       std::vector<int> offsets;
       unsigned int current_len;
@@ -1251,7 +1250,6 @@ lex_string (void)
 {
   int is_byte = lexptr[0] == 'b';
   int raw_length;
-  int len_in_chars = 0;
 
   if (is_byte)
     ++lexptr;
@@ -2069,7 +2067,6 @@ convert_ast_to_type (struct parser_state *state,
        std::vector<struct type *> args
          (convert_params_to_types (state, operation->left.params));
        int i;
-       struct type *type;
        const char *name;
 
        obstack_1grow (work_obstack, '(');
@@ -2397,7 +2394,6 @@ convert_ast_to_expression (struct parser_state *state,
 
     case OP_AGGREGATE:
       {
-       int i;
        int length;
        rust_set_vector *fields = operation->right.field_inits;
        struct type *type;
index f3562e0f32b2c8940f8554b0cf40c2ec17ef0fea..535a72bda84e0818fb9edc777c0a9777a5c23980 100644 (file)
@@ -848,8 +848,6 @@ rust_print_struct_def (struct type *type, const char *varstring,
 
   for (i = 0; i < TYPE_NFIELDS (type); ++i)
     {
-      const char *name;
-
       QUIT;
       if (field_is_static (&TYPE_FIELD (type, i)))
        continue;
@@ -997,7 +995,7 @@ rust_print_type (struct type *type, const char *varstring,
     case TYPE_CODE_UNION:
       {
        /* ADT enums.  */
-       int i, len = 0;
+       int i;
        /* Skip the discriminant field.  */
        int skip_to = 1;
 
@@ -1780,7 +1778,6 @@ rust_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
        if (noside == EVAL_NORMAL)
          {
-           CORE_ADDR addr;
            int i;
            std::vector<struct value *> eltvec (copies);
 
index 7d0436c33f37ba209a8887f478fecbb3f51fb22b..c4631ab0884f71b7486a612f996625f3b529c29e 100644 (file)
@@ -214,8 +214,6 @@ rx_fpsw_type (struct gdbarch *gdbarch)
 static struct type *
 rx_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   if (reg_nr == RX_PC_REGNUM)
     return builtin_type (gdbarch)->builtin_func_ptr;
   else if (reg_nr == RX_PSW_REGNUM || reg_nr == RX_BPSW_REGNUM)
index 8b88ca0b601ae71c9eaad3a71393a891c0123484..1280c6e304531cc38630ed8cb179c1699528163e 100644 (file)
@@ -202,7 +202,6 @@ void
 serial_event_clear (struct serial_event *event)
 {
   struct serial *ser = (struct serial *) event;
-  struct serial_event_state *state = (struct serial_event_state *) ser->state;
 #ifndef USE_WIN32API
   int r;
 
@@ -214,6 +213,7 @@ serial_event_clear (struct serial_event *event)
     }
   while (r > 0 || (r < 0 && errno == EINTR));
 #else
+  struct serial_event_state *state = (struct serial_event_state *) ser->state;
   ResetEvent (state->event);
 #endif
 }
index a2895d26e8434474d12924ea9083e90aaca15e07..c6256fe37e95d4e5a44629f03399f91ffce76fa6 100644 (file)
@@ -203,7 +203,6 @@ static struct serial *serial_open_ops_1 (const struct serial_ops *ops,
 struct serial *
 serial_open (const char *name)
 {
-  struct serial *scb;
   const struct serial_ops *ops;
   const char *open_name = name;
 
index 34a536a260393cce42d4a5b6e226d23e14af7ce3..fb9a5d8730b81e7db3a9375f0c6be3563c943176 100644 (file)
@@ -1915,7 +1915,6 @@ spu_overlay_new_objfile (struct objfile *objfile)
   /* Now go and fiddle with all the LMAs.  */
   ALL_OBJFILE_OSECTIONS (objfile, osect)
     {
-      bfd *obfd = objfile->obfd;
       asection *bsect = osect->the_bfd_section;
       int ndx = osect - objfile->sections;
 
index 8f45d45d85c6d5e293c1f5ddd032d0336240dd0b..5a1447d9d51e517c055495d4dd2acc9da22e9593 100644 (file)
@@ -2979,7 +2979,6 @@ section_is_overlay (struct obj_section *section)
 {
   if (overlay_debugging && section)
     {
-      bfd *abfd = section->objfile->obfd;
       asection *bfd_section = section->the_bfd_section;
 
       if (bfd_section_lma (abfd, bfd_section) != 0
@@ -3109,7 +3108,6 @@ overlay_unmapped_address (CORE_ADDR pc, struct obj_section *section)
 {
   if (section_is_overlay (section) && pc_in_mapped_range (pc, section))
     {
-      bfd *abfd = section->objfile->obfd;
       asection *bfd_section = section->the_bfd_section;
 
       return pc + bfd_section_lma (abfd, bfd_section)
@@ -3128,7 +3126,6 @@ overlay_mapped_address (CORE_ADDR pc, struct obj_section *section)
 {
   if (section_is_overlay (section) && pc_in_unmapped_range (pc, section))
     {
-      bfd *abfd = section->objfile->obfd;
       asection *bfd_section = section->the_bfd_section;
 
       return pc + bfd_section_vma (abfd, bfd_section)
@@ -3526,7 +3523,6 @@ static int
 simple_overlay_update_1 (struct obj_section *osect)
 {
   int i;
-  bfd *obfd = osect->objfile->obfd;
   asection *bsect = osect->the_bfd_section;
   struct gdbarch *gdbarch = get_objfile_arch (osect->objfile);
   int word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
@@ -3599,7 +3595,6 @@ simple_overlay_update (struct obj_section *osect)
     if (section_is_overlay (osect))
     {
       int i;
-      bfd *obfd = osect->objfile->obfd;
       asection *bsect = osect->the_bfd_section;
 
       for (i = 0; i < cache_novlys; i++)
index dd7434ed5093a580c2f77bf5a485cd65dd80e623..996d52199fcc8367ca74c70a3fdffdf7aea8bd7b 100644 (file)
@@ -729,7 +729,6 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
 {
   char *demangled = NULL;
   int i;
-  int recognized;
 
   if (gsymbol->language == language_unknown)
     gsymbol->language = language_auto;
@@ -4283,7 +4282,6 @@ search_symbols (const char *regexp, enum search_domain kind,
          and <TYPENAME> or <OPERATOR>.  */
       const char *opend;
       const char *opname = operator_chars (regexp, &opend);
-      int errcode;
 
       if (*opname)
        {
index 7896dd159989bfc4a950033b6be20c0ae6e3118b..1a90110f1f3f8a46c485e2b17d7b86ac59b9c393 100644 (file)
@@ -831,10 +831,7 @@ static struct tdesc_type tdesc_predefined_types[] =
 static struct tdesc_type *
 tdesc_predefined_type (enum tdesc_type_kind kind)
 {
-  int ix;
-  struct tdesc_type *type;
-
-  for (ix = 0; ix < ARRAY_SIZE (tdesc_predefined_types); ix++)
+  for (int ix = 0; ix < ARRAY_SIZE (tdesc_predefined_types); ix++)
     if (tdesc_predefined_types[ix].kind == kind)
       return &tdesc_predefined_types[ix];
 
index 3bfc8b5aefa80ceb3614d15536301ac329220293..3b8b8ea2186ba61dc38b6af6b8e7c387e1a98f05 100644 (file)
@@ -2231,8 +2231,6 @@ static int defer_target_commit_resume;
 void
 target_commit_resume (void)
 {
-  struct target_ops *t;
-
   if (defer_target_commit_resume)
     return;
 
index 052549a7c6e487b373ce91bf60b00e5f3d0b9ac7..9a5534667d02f65b4fa60df6457275eb7ac43be9 100644 (file)
@@ -1943,7 +1943,6 @@ print_selected_thread_frame (struct ui_out *uiout,
                             user_selected_what selection)
 {
   struct thread_info *tp = inferior_thread ();
-  struct inferior *inf = current_inferior ();
 
   if (selection & USER_SELECTED_THREAD)
     {
index 8cd7c993467df839908d27f5713c2967c6ee7398..3fb113c38147a13491fe975ea587e536b369cd58 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -326,10 +326,8 @@ open_terminal_stream (const char *name)
 static void
 new_ui_command (const char *args, int from_tty)
 {
-  struct interp *interp;
   gdb_file_up stream[3];
   int i;
-  int res;
   int argc;
   const char *interpreter_name;
   const char *tty_name;
@@ -750,7 +748,6 @@ gdb_readline_no_editing (const char *prompt)
   while (1)
     {
       int c;
-      int numfds;
       fd_set readfds;
 
       QUIT;
index 6ef904daeb5d0d99be4a242bd3ef3b0eeb9995e6..54b9148736242c0524acc3d4b1e46fa1f94fb95c 100644 (file)
@@ -422,7 +422,6 @@ tfile_read (gdb_byte *readbuf, int size)
 static void
 tfile_open (const char *arg, int from_tty)
 {
-  char *temp;
   int flags;
   int scratch_chan;
   char header[TRACE_HEADER_SIZE];
index 76d05dfc13bc6c3b1a49b21408cf85e6042f3e4b..550a72fe5e08b7fdb265250905833f7574ae3b45 100644 (file)
@@ -3265,7 +3265,6 @@ create_tsv_from_upload (struct uploaded_tsv *utsv)
   std::string buf;
   int try_num = 0;
   struct trace_state_variable *tsv;
-  struct cleanup *old_chain;
 
   if (utsv->name)
     {
index 98ef6ac4570cb401c5d90b8c41b614c70bdf48e0..b95dcfd5ce91e8871fd4ded48c69f2c613ddd8b1 100644 (file)
@@ -730,8 +730,6 @@ print_sys_errmsg (const char *string, int errcode)
 void
 quit (void)
 {
-  struct ui *ui = current_ui;
-
   if (sync_quit_force_run)
     {
       sync_quit_force_run = 0;
@@ -892,7 +890,6 @@ private:
 static int ATTRIBUTE_PRINTF (1, 0)
 defaulted_query (const char *ctlstr, const char defchar, va_list args)
 {
-  int ans2;
   int retval;
   int def_value;
   char def_answer, not_def_answer;
index 89e44f3fb01ff2af5731479f97d8aac6d31f137d..f3b44f9682907cbd43f7942d15dec0779c1b98c2 100644 (file)
@@ -657,7 +657,6 @@ value_concat (struct value *arg1, struct value *arg2)
   struct value *outval = NULL;
   int inval1len, inval2len;
   int count, idx;
-  char *ptr;
   char inchar;
   struct type *type1 = check_typedef (value_type (arg1));
   struct type *type2 = check_typedef (value_type (arg2));
index 307c3045126ba3b9d4e3579267f9e95e40a1ca7a..7bd7bee764cf1ef92115e2d271de147b2c938e3a 100644 (file)
@@ -455,7 +455,6 @@ xml_list_syscalls_by_group (struct gdbarch *gdbarch, const char *group)
 {
   struct syscalls_info *syscalls_info = gdbarch_syscalls_info (gdbarch);
   struct syscall_group_desc *groupdesc;
-  struct syscall_desc *sysdesc;
   struct syscall *syscalls = NULL;
   int nsyscalls;
   int i;
index 5a1f459f980a4b31fab1bbce4f3f6654a5d15a9a..a50ac5e6a7ca518cc807fb40ee24ac60c6d973a6 100644 (file)
@@ -740,8 +740,6 @@ target_fetch_description_xml (struct target_ops *ops)
 
   return {};
 #else
-  struct target_desc *tdesc;
-
   gdb::unique_xmalloc_ptr<char>
     tdesc_str = fetch_available_features_from_target ("target.xml", ops);
   if (tdesc_str == NULL)
index 0b0ec2e41621135108d656051161d85d4d68c173..4af6184200352cecb5be44a93b5b40e9e9915a51 100644 (file)
@@ -551,8 +551,6 @@ xtensa_pseudo_register_read (struct gdbarch *gdbarch,
                             int regnum,
                             gdb_byte *buffer)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-
   DEBUGTRACE ("xtensa_pseudo_register_read (... regnum = %d (%s) ...)\n",
              regnum, xtensa_register_name (gdbarch, regnum));
 
@@ -647,8 +645,6 @@ xtensa_pseudo_register_write (struct gdbarch *gdbarch,
                              int regnum,
                              const gdb_byte *buffer)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-
   DEBUGTRACE ("xtensa_pseudo_register_write (... regnum = %d (%s) ...)\n",
              regnum, xtensa_register_name (gdbarch, regnum));
 
This page took 0.119615 seconds and 4 git commands to generate.