Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Christian Biesinger (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Christian Biesinger <cbiesinger@google.com>,	gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@sourceware.org>
Subject: [review] Replace some more qsort calls with std::sort
Date: Fri, 18 Oct 2019 21:41:00 -0000	[thread overview]
Message-ID: <20191018214108.F0E9020AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571352182000.Ibcddce12a3d07448701e731b7150fa23611d86de@gnutoolchain-gerrit.osci.io>

Christian Biesinger has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131
......................................................................


Patch Set 1:

(9 comments)

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/breakpoint.c 
File gdb/breakpoint.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/breakpoint.c@522 
PS1, Line 522: /* Array is sorted by bp_location_is_less_than - primarily by the ADDRESS.  */
> In gerrit I can't tell if this line is overlong. […]
When you're logged in, you can set diff preferences using the "gear" icon on the right, where you can set the diff width to 80. That lets you see if a line is too long.

(this line is 78 characters long)


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/breakpoint.c@11440 
PS1, Line 11440:     return (a->address > b->address) < (a->address < b->address);
> I think this can just be a->address < b->address ?
Yeah, I think you're right. Done. I was confused by this code.


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/breakpoint.c@11448 
PS1, Line 11448: 	    < (a->pspace->num < b->pspace->num));
> Likewise this can be simplified. […]
Done


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/breakpoint.c@11450 
PS1, Line 11450: /* Sort permanent breakpoints first.  */
               :   if (a->permanent != b->permanent)
Test of a multiline comment (I think you have to highlight in the code, then press c, instead of directly selectng multiple lines)


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/breakpoint.c@11452 
PS1, Line 11452:     return (a->permanent < b->permanent) < (a->permanent > b->permanent);
> Ditto.
Done


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/breakpoint.c@11460 
PS1, Line 11460: 	    < (a->owner->number < b->owner->number));
> Ditto.
Done


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/breakpoint.c@11462 
PS1, Line 11462:   return (a > b) < (a < b);
> Even here.
Done.

I wonder why this code wasn't just subtracting one variable from the other in all these cases.


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/disasm.c 
File gdb/disasm.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/disasm.c@184 
PS1, Line 184:         val = mle1.start_pc - mle2.start_pc;
> This code is a bit weird.  It only works because "val" has signed type, […]
Done


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/mdebugread.c 
File gdb/mdebugread.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131/1/gdb/mdebugread.c@4570 
PS1, Line 4570:   addr_diff = (BLOCK_START (b1)) - (BLOCK_START (b2));
> This has the same oddity involving signs.  I think just using the […]
Done




  parent reply	other threads:[~2019-10-18 21:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17 22:43 Christian Biesinger (Code Review)
2019-10-18 13:47 ` Tom Tromey (Code Review)
2019-10-18 21:40 ` Christian Biesinger (Code Review)
2019-10-18 21:41 ` Christian Biesinger (Code Review) [this message]
2019-10-19  4:32 ` Simon Marchi (Code Review)
2019-10-19 20:43 ` [review v2] " Tom Tromey (Code Review)
2019-10-19 20:47 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-10-19 20:47 ` Sourceware to Gerrit sync (Code Review)
2019-10-21  4:45 ` [review v3] " Simon Marchi (Code Review)
2019-10-21 16:22 ` Christian Biesinger (Code Review)

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=20191018214108.F0E9020AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@sourceware.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