This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH, committed] remove trivialy unused variables
- From: Trevor Saunders <tbsaunde at tbsaunde dot org>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: tbsaunde+binutils at tbsaunde dot org, gdb-patches at sourceware dot org
- Date: Mon, 9 May 2016 23:35:39 -0400
- Subject: Re: [PATCH, committed] remove trivialy unused variables
- Authentication-results: sourceware.org; auth=none
- References: <1462666464-7737-1-git-send-email-tbsaunde+binutils at tbsaunde dot org> <8660und5zq dot fsf at gmail dot com>
On Mon, May 09, 2016 at 08:51:05AM +0100, Yao Qi wrote:
> tbsaunde+binutils@tbsaunde.org writes:
>
> > diff --git a/gdb/linespec.c b/gdb/linespec.c
> > index 2360cc1..c0c3b3b3 100644
> > --- a/gdb/linespec.c
> > +++ b/gdb/linespec.c
> > @@ -845,8 +845,6 @@ add_sal_to_sals (struct linespec_state *self,
> > canonical = &self->canonical_names[sals->nelts - 1];
> > if (!literal_canonical && sal->symtab)
> > {
> > - const char *fullname = symtab_to_fullname (sal->symtab);
> > -
>
>
> Variable fullname isn't used, but I am not sure we can remove the call
> to symtab_to_fullname. At least, symtab_to_fullname sets
> sal->symtab->fullname, and we have this some lines below,
>
> canonical->symtab = sal->symtab;
arg yeah, it looks like calling it maybe needed. Applying the below doesn't
seem to change any testsuite results so perhaps the linespec code could use
better tests.
Is the below ok with a ChangeLog?
Thanks!
Trev
diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c
index 14d2afe..600d70a 100644
--- a/gdb/iq2000-tdep.c
+++ b/gdb/iq2000-tdep.c
@@ -248,7 +248,6 @@ iq2000_scan_prologue (struct gdbarch *gdbarch,
if (tgtreg >= 0 && tgtreg < E_NUM_REGS)
cache->saved_regs[tgtreg] = -((signed short) (insn & 0xffff));
- if (tgtreg == E_LR_REGNUM)
continue;
}
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 2360cc1..7162163 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -845,7 +845,7 @@ add_sal_to_sals (struct linespec_state *self,
canonical = &self->canonical_names[sals->nelts - 1];
if (!literal_canonical && sal->symtab)
{
- const char *fullname = symtab_to_fullname (sal->symtab);
+ symtab_to_fullname (sal->symtab);
/* Note that the filter doesn't have to be a valid linespec
input. We only apply the ":LINE" treatment to Ada for
>
> --
> Yao (éå)