public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Add gdb::string_view
Date: Mon, 09 Apr 2018 19:11:00 -0000	[thread overview]
Message-ID: <8345c4a2670711eafd41c8b6a8726cf8b0771d6e@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 8345c4a2670711eafd41c8b6a8726cf8b0771d6e ***

Author: Simon Marchi <simon.marchi@polymtl.ca>
Branch: master
Commit: 8345c4a2670711eafd41c8b6a8726cf8b0771d6e

Add gdb::string_view

We had a few times the need for a data structure that does essentially
what C++17's std::string_view does, which is to give an std::string-like
interface (only the read-only operations) to an arbitrary character
buffer.

This patch adapts the files copied from libstdc++ by the previous patch
to integrate them with GDB.  Here's a summary of the changes:

  * Remove things related to wstring_view, u16string_view and
  u32string_view (I don't think we need them, but we can always add them
  later).

  * Remove usages of _GLIBCXX_BEGIN_NAMESPACE_VERSION and
  _GLIBCXX_END_NAMESPACE_VERSION.

  * Put the code in the gdb namespace.  I had to add a few "std::" in
  front of std type usages.

  * Change __throw_out_of_range_fmt() for error().

  * Make gdb::string_view an alias of std::string_view when building
  with >= c++17.

  * Remove a bunch of constexpr, because they are not valid in c++11
  (e.g. they are not a single return line).

  * Use std::common_type<_Tp>::type instead of std::common_type_t<_Tp>,
  because c++11 doesn't have the later.

  * Remove the #pragma GCC system_header, since that silences some
  warnings that we might want to have if we're doing something not
  correctly.

  * Remove operator ""sv.  It would need a lot of work to make all
  supported compilers happy, and we can easily live without it.

  * Remove operator<<.  It is implemented using __ostream_insert (a
  libstdc++ internal).  Bringing it in might be possible, but I don't
  think that would be worth the effort, since we don't really use
  streams at the moment.

  * Replace internal libstdc++ asserts ( __glibcxx_assert and
  __glibcxx_requires_string_len) with gdb_assert.

  * Remove hash helpers, because they use libstdc++ internal functions.
  If we need them we always import them later.

The string_view class in cli/cli-script.c is removed and its usage
replaced with the new gdb::string_view.

gdb/ChangeLog:

	* common/gdb_string_view.h: Remove libstdc++ implementation
	details, adjust to gdb reality.
	* common/gdb_string_view.tcc: Likewise.
	* cli/cli-script.c (struct string_view): Remove.
	(user_args) <m_args>: Change element type to gdb::string_view.
	(user_args::insert_args): Adjust.


             reply	other threads:[~2018-04-09 19:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 19:11 sergiodj+buildbot [this message]
2018-04-09 19:11 ` Failures on RHEL-s390x-m64, branch master sergiodj+buildbot
2018-04-09 19:38 ` Failures on Fedora-s390x-m64, " sergiodj+buildbot
2018-04-09 20:34 ` Failures on Debian-s390x-m64, " sergiodj+buildbot
2018-04-09 20:35 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2018-04-09 20:39 ` Failures on Fedora-i686, " sergiodj+buildbot
2018-04-09 20:58 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2018-04-09 21:13 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2018-04-10  4:31 ` Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, " sergiodj+buildbot
2018-04-10  4:57 ` Failures on Ubuntu-AArch32-native-gdbserver-m32, " sergiodj+buildbot
2018-04-10  5:23 ` Failures on Ubuntu-AArch32-m32, " sergiodj+buildbot

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=8345c4a2670711eafd41c8b6a8726cf8b0771d6e@gdb-build \
    --to=sergiodj+buildbot@sergiodj.net \
    --cc=gdb-testers@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).