* [PATCH] cleanup: remove declared variables without any references @ 2014-02-11 13:55 Sanimir Agovic 2014-02-11 14:12 ` Mark Kettenis 0 siblings, 1 reply; 5+ messages in thread From: Sanimir Agovic @ 2014-02-11 13:55 UTC (permalink / raw) To: gdb-patches 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 <sanimir.agovic@intel.com> * 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 <sanimir.agovic@intel.com> --- 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 -}; \f /* Free the copy of sym_fns recorded in the registry. */ -- 1.8.4.2 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cleanup: remove declared variables without any references 2014-02-11 13:55 [PATCH] cleanup: remove declared variables without any references Sanimir Agovic @ 2014-02-11 14:12 ` Mark Kettenis 2014-02-11 15:17 ` Agovic, Sanimir 2014-02-12 3:32 ` Joel Brobecker 0 siblings, 2 replies; 5+ messages in thread From: Mark Kettenis @ 2014-02-11 14:12 UTC (permalink / raw) To: sanimir.agovic; +Cc: gdb-patches > From: Sanimir Agovic <sanimir.agovic@intel.com> > Date: Tue, 11 Feb 2014 14:55:51 +0100 > > 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. The cris-tdep.c is ok. The hppa-tdep.c one is ok; that code got moved to hppa-linux-tdep.c, but it looks like a copy was left behind in hppa-tdep.c. The mipsnbsd-tdep.c one is not ok. For one thing, you're leaving behind the comment describing the code. But I think this is better left alone, as somebody might want to add (or put back) the missing glue that uses those bits. I'll leave the other ones to people with more intimate knowledge about the particular code. > Build pass on x86_64 with --enable-targets=all > > 2014-02-11 Sanimir Agovic <sanimir.agovic@intel.com> > > * 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 <sanimir.agovic@intel.com> > --- > 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 > -}; > \f > /* Free the copy of sym_fns recorded in the registry. */ > > -- > 1.8.4.2 > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] cleanup: remove declared variables without any references 2014-02-11 14:12 ` Mark Kettenis @ 2014-02-11 15:17 ` Agovic, Sanimir 2014-02-12 3:32 ` Joel Brobecker 1 sibling, 0 replies; 5+ messages in thread From: Agovic, Sanimir @ 2014-02-11 15:17 UTC (permalink / raw) To: 'Mark Kettenis'; +Cc: gdb-patches Thanks Mark. I will revert the changes done to mipsnbsd-tdep.c. > The mipsnbsd-tdep.c one is not ok. For one thing, you're leaving > behind the comment describing the code. Indeed, while changing more than 55 files I ended up with mechanical line deletes without looking at the surrounding code. I will have a serious look at the upcoming variable cleanups. 5 files left: * h8300-tdep.c (setmachinelist): Remove global. * ia64-tdep.c (fp_regnum, lr_regnum): 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. -Sanimir > -----Original Message----- > From: Mark Kettenis [mailto:mark.kettenis@xs4all.nl] > Sent: Tuesday, February 11, 2014 03:13 PM > To: Agovic, Sanimir > Cc: gdb-patches@sourceware.org > Subject: Re: [PATCH] cleanup: remove declared variables without any references > > > From: Sanimir Agovic <sanimir.agovic@intel.com> > > Date: Tue, 11 Feb 2014 14:55:51 +0100 > > > > 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. > > The cris-tdep.c is ok. > > The hppa-tdep.c one is ok; that code got moved to hppa-linux-tdep.c, > but it looks like a copy was left behind in hppa-tdep.c. > > The mipsnbsd-tdep.c one is not ok. For one thing, you're leaving > behind the comment describing the code. But I think this is better > left alone, as somebody might want to add (or put back) the missing > glue that uses those bits. > > I'll leave the other ones to people with more intimate knowledge about > the particular code. > > > > Build pass on x86_64 with --enable-targets=all > > > > 2014-02-11 Sanimir Agovic <sanimir.agovic@intel.com> > > > > * 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 <sanimir.agovic@intel.com> > > --- > > 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 > > > > Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cleanup: remove declared variables without any references 2014-02-11 14:12 ` Mark Kettenis 2014-02-11 15:17 ` Agovic, Sanimir @ 2014-02-12 3:32 ` Joel Brobecker 2014-02-12 10:58 ` Mark Kettenis 1 sibling, 1 reply; 5+ messages in thread From: Joel Brobecker @ 2014-02-12 3:32 UTC (permalink / raw) To: Mark Kettenis; +Cc: sanimir.agovic, gdb-patches Hello Sanimir, Thanks for sending the patches! As you can see, bunching the changes together is causing a little extra work, now, because multiple reviews end up being involved, and we end up having to keep track of what was already reviewed, and what has not. I know it's a lot of files, but all these changes should be mostly independent, so we could go one file at a time, a few files each day. When we've finished reviewing the a batch, just send another. WDYT? > > The mipsnbsd-tdep.c one is not ok. For one thing, you're leaving > behind the comment describing the code. But I think this is better > left alone, as somebody might want to add (or put back) the missing > glue that uses those bits. Hey Mark! The problem with leaving them behind is that they cause a build failure when building the HEAD, I think, because we build with -Werror. Can we find a way to avoid that? For instance, could we #if zero the code? > > 2014-02-11 Sanimir Agovic <sanimir.agovic@intel.com> > > > > * 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. The h8300-tdep.c, ravenscar-thread.c changes are OK. the ia64-tdep.c is officially Jan's jurisdiction, but the change looks OK to me. If he doesn't object by, say, end of this week, please apply the change (Jan: I'll revert immediately if you object). The rs6000-tdep.c change is OK. It looks like it was already unused when it was introduced, and I think it was an unintentional left over from the development phase where the table was first defined at one location, and then later moved to a different location (init_sim_regno_table). See commit: commit 7cc46491b1832408d1d5472e3f0c17c8a1d78ccb Date: Mon Oct 15 19:45:31 2007 +0000 This leaves symfile-debug.c, for which I don't know. -- Joel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cleanup: remove declared variables without any references 2014-02-12 3:32 ` Joel Brobecker @ 2014-02-12 10:58 ` Mark Kettenis 0 siblings, 0 replies; 5+ messages in thread From: Mark Kettenis @ 2014-02-12 10:58 UTC (permalink / raw) To: brobecker; +Cc: sanimir.agovic, gdb-patches > Date: Wed, 12 Feb 2014 07:32:34 +0400 > From: Joel Brobecker <brobecker@adacore.com> > > > The mipsnbsd-tdep.c one is not ok. For one thing, you're leaving > > behind the comment describing the code. But I think this is better > > left alone, as somebody might want to add (or put back) the missing > > glue that uses those bits. > > Hey Mark! The problem with leaving them behind is that they cause > a build failure when building the HEAD, I think, because we build > with -Werror. Can we find a way to avoid that? For instance, could > we #if zero the code? Probably best to do something like that. Ideally a NetBSd devloper would step in and fix things... ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-02-12 10:58 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-02-11 13:55 [PATCH] cleanup: remove declared variables without any references Sanimir Agovic 2014-02-11 14:12 ` Mark Kettenis 2014-02-11 15:17 ` Agovic, Sanimir 2014-02-12 3:32 ` Joel Brobecker 2014-02-12 10:58 ` Mark Kettenis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox