public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Bruno Larsen <blarsen@redhat.com>
Cc: gdb-patches@sourceware.org, Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH] gdb: Remove unused extra_lines variable
Date: Sat, 1 Oct 2022 00:50:41 +0900	[thread overview]
Message-ID: <0fec0ecc-952f-006d-de51-cc8f3a357689@irq.a4lg.com> (raw)
In-Reply-To: <a5b6188a-8321-a25c-6211-3f7d751cab02@redhat.com>

On 2022/09/26 18:00, Bruno Larsen wrote:
> On 25/09/2022 10:17, Tsukasa OI via Gdb-patches wrote:
>> Clang generates a warning if there is a variable that is set but not used
>> otherwise ("-Wunused-but-set-variable").  On the default
>> configuration, it
>> causes a build failure (unless "--disable-werror" is specified).
>>
>> The only extra_lines use in arrange_linetable function is removed on the
>> commit 558802e4d1c5dcbd0df7d2c6ef62a6deac247a2f
>> ("gdb: change subfile::line_vector to an std::vector").  So, this
>> variable
>> should be removed to prevent a build failure.
> 
> Hi Tsukasa!
> 
> This patch looks pretty safe. The point at which extra_lines would be
> used has the exact same check used to set it, instead of using the
> variable, so I think there is no need for it after all.
> 
> That said, I can't approve the patch for pushing, so I hope a maintainer
> looks at this soon.
> 
>>
>> gdb/ChangeLog:
>>
>>     * xcoffread.c (arrange_linetable): Remove unused extra_lines.
> side note, GDB doesn't require changelogs anymore, but there are no
> rules against it, so you can leave it here if you'd like.

Thanks for letting me know!

A maintainer (Tom) approved the patch and I removed the ChangeLog in the
commit message (as an obvious change) and then pushed.  The original
intent of ChangeLog was to keep formatting as common as Binutils but it
required extra work (contrib/mklog.py does not work properly on GDB
files) and I think I looked pretty old version of contribution guide or
something when I decided to do so.

Thanks,
Tsukasa

> 
> Cheers,
> Bruno
> 
>> ---
>>   gdb/xcoffread.c | 8 --------
>>   1 file changed, 8 deletions(-)
>>
>> diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
>> index b7d65771115..aa88cbc724d 100644
>> --- a/gdb/xcoffread.c
>> +++ b/gdb/xcoffread.c
>> @@ -419,8 +419,6 @@ add_stab_to_list (char *stabname, struct
>> pending_stabs **stabvector)
>>   static void
>>   arrange_linetable (std::vector<linetable_entry> &old_linetable)
>>   {
>> -  int extra_lines = 0;
>> -
>>     std::vector<linetable_entry> fentries;
>>       for (int ii = 0; ii < old_linetable.size (); ++ii)
>> @@ -436,12 +434,6 @@ arrange_linetable (std::vector<linetable_entry>
>> &old_linetable)
>>         e.line = ii;
>>         e.is_stmt = 1;
>>         e.pc = old_linetable[ii].pc;
>> -
>> -      /* If the function was compiled with XLC, we may have to add an
>> -         extra line entry later.  Reserve space for that.  */
>> -      if (ii + 1 < old_linetable.size ()
>> -          && old_linetable[ii].pc != old_linetable[ii + 1].pc)
>> -        extra_lines++;
>>       }
>>       }
>>  
>> base-commit: 58d69206b8173b9d027a6c65f56cdaf045ae6e64
> 

  reply	other threads:[~2022-09-30 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25  8:17 Tsukasa OI
2022-09-26  9:00 ` Bruno Larsen
2022-09-30 15:50   ` Tsukasa OI [this message]
2022-09-29 17:22 ` Tom Tromey

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=0fec0ecc-952f-006d-de51-cc8f3a357689@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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).