public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Trevor Saunders <tbsaunde@tbsaunde.org>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: tbsaunde+binutils@tbsaunde.org, gdb-patches@sourceware.org
Subject: Re: [PATCH, committed] remove trivialy unused variables
Date: Tue, 10 May 2016 03:35:00 -0000	[thread overview]
Message-ID: <20160510033437.GA9700@tsaunders-iceball.corp.tor1.mozilla.com> (raw)
In-Reply-To: <8660und5zq.fsf@gmail.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 (齐尧)

  reply	other threads:[~2016-05-10  3:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-08  0:10 tbsaunde+binutils
2016-05-09  7:38 ` Yao Qi
2016-05-10  1:07   ` Trevor Saunders
2016-05-09  7:51 ` Yao Qi
2016-05-10  3:35   ` Trevor Saunders [this message]
2016-05-10  7:13     ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160510033437.GA9700@tsaunders-iceball.corp.tor1.mozilla.com \
    --to=tbsaunde@tbsaunde.org \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    --cc=tbsaunde+binutils@tbsaunde.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).