From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix thinko on common/offset-type.h (compare 'lhs' against 'rhs')
Date: Fri, 26 Oct 2018 16:30:00 -0000 [thread overview]
Message-ID: <87k1m4eklx.fsf@redhat.com> (raw)
In-Reply-To: <20181025210312.143b91aa@pinnacle.lan> (Kevin Buettner's message of "Thu, 25 Oct 2018 21:03:12 -0700")
On Friday, October 26 2018, Kevin Buettner wrote:
> On Thu, 25 Oct 2018 17:10:08 -0400
> Sergio Durigan Junior <sergiodj@redhat.com> wrote:
>
>> While doing something else, I noticed that the OFFSET_TYPE's
>> "DEFINE_OFFSET_REL_OP" has a thinko: it is comparing 'lhs' against
>> itself, instead of against 'rhs'. This patch fixes it.
>>
>> I also found an interesting thing. We have an unittest for
>> offset-type, and in theory it should have caught this problem, because
>> it has tests for relational operators. However, the tests
>> successfully pass, and after some investigation I'm almost sure this
>> is because these operators are not being properly overloaded. I tried
>> a few things to make them be used, without success. If someone wants
>> to give this a try, I'd appreciate.
>>
>> No regressions introduced.
>>
>> gdb/ChangeLog:
>> 2018-10-25 Sergio Durigan Junior <sergiodj@redhat.com>
>>
>> * common/offset-type.h (DEFINE_OFFSET_REL_OP): Compare 'lhs'
>> against 'rhs', instead of with 'lhs' again.
>
> LGTM.
>
> (I'm surprised that it wasn't caught by the unit test or by someone
> else noticing a bug elsewhere in GDB.)
Thanks for the review, Kevin.
According to my discussion with Simon, the proposed approach (for which
I'll submit a new patch soon) is to entirely remove the overloads for
relational operators, since they're clearly not being used.
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
next prev parent reply other threads:[~2018-10-26 16:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-25 21:10 Sergio Durigan Junior
2018-10-26 4:03 ` Kevin Buettner
2018-10-26 16:30 ` Sergio Durigan Junior [this message]
2018-10-26 16:08 ` Simon Marchi
2018-10-26 16:29 ` Sergio Durigan Junior
2018-10-26 18:23 ` Simon Marchi
2018-10-29 20:11 ` Pedro Alves
2018-10-29 20:14 ` Pedro Alves
2018-10-29 21:14 ` [PATCH] Remove relational operators from common/offset-type.h Sergio Durigan Junior
2018-10-30 3:17 ` Simon Marchi
2018-10-30 3:49 ` Sergio Durigan Junior
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=87k1m4eklx.fsf@redhat.com \
--to=sergiodj@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@redhat.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).