From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7034 invoked by alias); 11 Feb 2014 15:17:34 -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 7008 invoked by uid 89); 11 Feb 2014 15:17:33 -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,SPF_PASS 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 15:17:30 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 11 Feb 2014 07:13:08 -0800 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga001.jf.intel.com with ESMTP; 11 Feb 2014 07:17:21 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.202]) by IRSMSX102.ger.corp.intel.com ([169.254.2.210]) with mapi id 14.03.0123.003; Tue, 11 Feb 2014 15:17:19 +0000 From: "Agovic, Sanimir" To: 'Mark Kettenis' CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH] cleanup: remove declared variables without any references Date: Tue, 11 Feb 2014 15:17:00 -0000 Message-ID: <0377C58828D86C4588AEEC42FC3B85A7176FBF02@IRSMSX105.ger.corp.intel.com> References: <1392126951-25347-1-git-send-email-sanimir.agovic@intel.com> <201402111412.s1BECWEX000161@glazunov.sibelius.xs4all.nl> In-Reply-To: <201402111412.s1BECWEX000161@glazunov.sibelius.xs4all.nl> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00356.txt.bz2 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 refer= ences >=20 > > From: Sanimir Agovic > > Date: Tue, 11 Feb 2014 14:55:51 +0100 > > > > Hello, > > > > I am currently digging through the gdb sources to remove declared varia= bles > > without any references with the help of a compiler. The findings below= are > > variables with static storage duration. I am uncertain about the remov= al, > > thus I like to get feedback. >=20 > The cris-tdep.c is ok. >=20 > 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. >=20 > 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. >=20 > I'll leave the other ones to people with more intimate knowledge about > the particular code. >=20 >=20 > > Build pass on x86_64 with --enable-targets=3Dall > > > > 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, c= ris_elf_gregset_t > *gregsetp) > > struct gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); > > int i; > > cris_elf_greg_t *regp =3D *gregsetp; > > - static char zerobuf[4] =3D {0}; > > > > /* The kernel dumps all 32 registers as unsigned longs, but supply_r= egister > > knows about the actual size of each register so that's no problem= . */ > > @@ -3898,9 +3897,6 @@ extern initialize_file_ftype _initialize_cris_tde= p; /* -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, struc= t 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[] =3D { > > { 0, 0 } > > }; > > > > -static struct insn_pattern hppa_sigtramp[] =3D { > > - /* 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 g= dbarch *gdbarch, > > #define NUM_IA64_RAW_REGS 462 > > > > static int sp_regnum =3D IA64_GR12_REGNUM; > > -static int fp_regnum =3D IA64_VFP_REGNUM; > > -static int lr_regnum =3D 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 *regcac= he, char *fpregs, > int regno) > > #define RETCODE_NWORDS 3 > > #define RETCODE_SIZE (RETCODE_NWORDS * 4) > > > > -static const unsigned char sigtramp_retcode_mipsel[RETCODE_SIZE] =3D > > -{ > > - 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] =3D > > -{ > > - 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[] =3D > "system__tasking__debug__first_task"; > > static const char ravenscar_runtime_initializer[] =3D > > "system__bb__threads__initialize"; > > > > -static struct observer *update_target_observer =3D 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, s= truct > 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[] =3D { > > - "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[] =3D { "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, asect= ion *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 i= n the > > - objfile. */ > > - > > -static const struct sym_fns debug_sym_fns =3D > > -{ > > - 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 > > -}; > >=20=20 > > /* 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