From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 404 invoked by alias); 11 Feb 2014 13:55:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 392 invoked by uid 89); 11 Feb 2014 13:55:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Feb 2014 13:55:55 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Feb 2014 05:51:38 -0800 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 11 Feb 2014 05:55:53 -0800 Received: from ullecvh004g04.iul.intel.com (ullecvh004g04.iul.intel.com [172.28.50.14]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s1BDtqIY001128 for ; Tue, 11 Feb 2014 13:55:52 GMT Received: from ullecvh004g04.iul.intel.com (ullecvh004g04.iul.intel.com [127.0.0.1]) by ullecvh004g04.iul.intel.com (8.13.8/8.13.8) with ESMTP id s1BDtqg6025381 for ; Tue, 11 Feb 2014 14:55:52 +0100 Received: (from sagovic@localhost) by ullecvh004g04.iul.intel.com (8.13.8/8.13.8/Submit) id s1BDtpBI025380 for gdb-patches@sourceware.org; Tue, 11 Feb 2014 14:55:51 +0100 From: Sanimir Agovic To: gdb-patches@sourceware.org Subject: [PATCH] cleanup: remove declared variables without any references Date: Tue, 11 Feb 2014 13:55:00 -0000 Message-Id: <1392126951-25347-1-git-send-email-sanimir.agovic@intel.com> X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00354.txt.bz2 Hello, I am currently digging through the gdb sources to remove declared variables without any references with the help of a compiler. The findings below are variables with static storage duration. I am uncertain about the removal, thus I like to get feedback. Build pass on x86_64 with --enable-targets=all 2014-02-11 Sanimir Agovic * cris-tdep.c (cris_supply_gregset): Remove zerobuf. (_initialize_cris_tdep): Remove cris_set_cmdlist, cris_show_cmdlist. * h8300-tdep.c (setmachinelist): Remove global. * hppa-tdep.c (hppa_sigtramp): Remove global. * ia64-tdep.c (fp_regnum, lr_regnum): Remove globals. * mipsnbsd-tdep.c (sigtramp_retcode_mipsel, sigtramp_retcode_mipseb): Remove globals. * ravenscar-thread.c (update_target_observer): Remove global. * rs6000-tdep.c (rs6000_gdbarch_init): Remove segment_regs. * symfile-debug.c (debug_sym_fns): Remove global. Change-Id: I4c2aeb3a516c600b8aaedddca562e443d0ae9bc5 Signed-off-by: Sanimir Agovic --- gdb/cris-tdep.c | 4 ---- gdb/h8300-tdep.c | 2 -- gdb/hppa-tdep.c | 12 ------------ gdb/ia64-tdep.c | 2 -- gdb/mipsnbsd-tdep.c | 14 -------------- gdb/ravenscar-thread.c | 2 -- gdb/rs6000-tdep.c | 4 ---- gdb/symfile-debug.c | 19 ------------------- 8 files changed, 59 deletions(-) diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 78bbfcd..9e3fb78 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -3830,7 +3830,6 @@ cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp) struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); int i; cris_elf_greg_t *regp = *gregsetp; - static char zerobuf[4] = {0}; /* The kernel dumps all 32 registers as unsigned longs, but supply_register knows about the actual size of each register so that's no problem. */ @@ -3898,9 +3897,6 @@ extern initialize_file_ftype _initialize_cris_tdep; /* -Wmissing-prototypes */ void _initialize_cris_tdep (void) { - static struct cmd_list_element *cris_set_cmdlist; - static struct cmd_list_element *cris_show_cmdlist; - gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep); /* CRIS-specific user-commands. */ diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index ffffbc9..648d902 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -937,8 +937,6 @@ h8300h_return_value (struct gdbarch *gdbarch, struct value *function, return RETURN_VALUE_REGISTER_CONVENTION; } -static struct cmd_list_element *setmachinelist; - static const char * h8300_register_name (struct gdbarch *gdbarch, int regno) { diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 8314b4d..9769e6e 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -2770,18 +2770,6 @@ static struct insn_pattern hppa_plt_stub[] = { { 0, 0 } }; -static struct insn_pattern hppa_sigtramp[] = { - /* ldi 0, %r25 or ldi 1, %r25 */ - { 0x34190000, 0xfffffffd }, - /* ldi __NR_rt_sigreturn, %r20 */ - { 0x3414015a, 0xffffffff }, - /* be,l 0x100(%sr2, %r0), %sr0, %r31 */ - { 0xe4008200, 0xffffffff }, - /* nop */ - { 0x08000240, 0xffffffff }, - { 0, 0 } -}; - /* Maximum number of instructions on the patterns above. */ #define HPPA_MAX_INSN_PATTERN_LEN 4 diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index b2f9368..50209a8 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -127,8 +127,6 @@ static CORE_ADDR ia64_find_global_pointer (struct gdbarch *gdbarch, #define NUM_IA64_RAW_REGS 462 static int sp_regnum = IA64_GR12_REGNUM; -static int fp_regnum = IA64_VFP_REGNUM; -static int lr_regnum = IA64_VRAP_REGNUM; /* NOTE: we treat the register stack registers r32-r127 as pseudo-registers because they may not be accessible via the ptrace diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index 4773ae0..b753e36 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -230,20 +230,6 @@ mipsnbsd_fill_fpreg (const struct regcache *regcache, char *fpregs, int regno) #define RETCODE_NWORDS 3 #define RETCODE_SIZE (RETCODE_NWORDS * 4) -static const unsigned char sigtramp_retcode_mipsel[RETCODE_SIZE] = -{ - 0x10, 0x00, 0xa4, 0x27, /* addu a0, sp, 16 */ - 0x27, 0x01, 0x02, 0x24, /* li v0, 295 */ - 0x0c, 0x00, 0x00, 0x00, /* syscall */ -}; - -static const unsigned char sigtramp_retcode_mipseb[RETCODE_SIZE] = -{ - 0x27, 0xa4, 0x00, 0x10, /* addu a0, sp, 16 */ - 0x24, 0x02, 0x01, 0x27, /* li v0, 295 */ - 0x00, 0x00, 0x00, 0x0c, /* syscall */ -}; - /* Figure out where the longjmp will land. We expect that we have just entered longjmp and haven't yet setup the stack frame, so the args are still in the argument regs. MIPS_A0_REGNUM points at the diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index e070a1d..a98f8fb 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -52,8 +52,6 @@ static const char first_task_name[] = "system__tasking__debug__first_task"; static const char ravenscar_runtime_initializer[] = "system__bb__threads__initialize"; -static struct observer *update_target_observer = NULL; - static void ravenscar_find_new_threads (struct target_ops *ops); static ptid_t ravenscar_running_thread (void); static char *ravenscar_extra_thread_info (struct thread_info *tp); diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 9f5c3ad..5478cba 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -3651,10 +3651,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31" }; - static const char *const segment_regs[] = { - "sr0", "sr1", "sr2", "sr3", "sr4", "sr5", "sr6", "sr7", - "sr8", "sr9", "sr10", "sr11", "sr12", "sr13", "sr14", "sr15" - }; const struct tdesc_feature *feature; int i, valid_p; static const char *const msr_names[] = { "msr", "ps" }; diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 705d9cb..a83fd21 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -532,25 +532,6 @@ debug_sym_relocate (struct objfile *objfile, asection *sectp, bfd_byte *buf) return retval; } -/* Template of debugging version of struct sym_fns. - A copy is made, with sym_flavour updated, and a pointer to the real table - installed in real_sf, and then a pointer to the copy is installed in the - objfile. */ - -static const struct sym_fns debug_sym_fns = -{ - debug_sym_new_init, - debug_sym_init, - debug_sym_read, - debug_sym_read_psymbols, - debug_sym_finish, - debug_sym_offsets, - debug_sym_segments, - debug_sym_read_linetable, - debug_sym_relocate, - &debug_sym_probe_fns, - &debug_sym_quick_functions -}; /* Free the copy of sym_fns recorded in the registry. */ -- 1.8.4.2