Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Tom Tromey (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Christian Biesinger <cbiesinger@google.com>,	gdb-patches@sourceware.org
Subject: [review v4] Change some arguments to gdb::string_view instead of name+len
Date: Fri, 25 Oct 2019 17:55:00 -0000	[thread overview]
Message-ID: <20191025175510.58ECD204C9@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571215766000.I2675c6865e0368f9c755a1081088a53aa54dda4c@gnutoolchain-gerrit.osci.io>

Tom Tromey has posted comments on this change.

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


Patch Set 4:

(1 comment)

Thank you for the patch.  I'm sorry about the delay on this.

I agree with Pedro when he wrote:

> My feeling is that one of the points of vocabulary types like string_view is
> that you replace documentation with rules or contracts enforced by, or
> encoded in the types.  To me, it feels like a bit of a hack or design issue that
> we switch to string_view while at the same time, find that we need to step
> outside its contract.

This particular bit of code (I added a comment below for those reading along)
has always been a bit fishy.  It's an attempt to micro-optimize in a maybe
unusual case.  I think it would be better to just drop this little optimization
in favor of copying here.  Perhaps in conjunction with your other patches,
this won't even be a bit hit.

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/125/4/gdb/symtab.c 
File gdb/symtab.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/125/4/gdb/symtab.c@858 
PS4, Line 858:   /* Don't use string_view::operator[] because we are accessing beyond
             :      the size of the string_view, which is technically unsupported.  */
             :   if (l
This is the problem spot.



-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I2675c6865e0368f9c755a1081088a53aa54dda4c
Gerrit-Change-Number: 125
Gerrit-PatchSet: 4
Gerrit-Owner: Christian Biesinger <cbiesinger@google.com>
Gerrit-Reviewer: Christian Biesinger <cbiesinger@google.com>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-Comment-Date: Fri, 25 Oct 2019 17:55:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


  parent reply	other threads:[~2019-10-25 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16  8:49 [review] " Christian Biesinger (Code Review)
2019-10-16 12:39 ` Christian Biesinger (Code Review)
2019-10-19 22:06 ` [review v2] " Christian Biesinger (Code Review)
2019-10-22 22:14 ` [review v4] " Christian Biesinger (Code Review)
2019-10-25 17:55 ` Tom Tromey (Code Review) [this message]
2019-10-28 19:01 ` [review v5] " Christian Biesinger (Code Review)
2019-10-28 19:02 ` Christian Biesinger (Code Review)
2019-10-29 19:16 ` Tom Tromey (Code Review)
2019-10-29 19:28 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-10-29 19:28 ` Sourceware to Gerrit sync (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=20191025175510.58ECD204C9@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gnutoolchain-gerrit@osci.io \
    /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