public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/7] [gdb/build] Fix -std=c++20 issues
Date: Tue, 15 Aug 2023 20:13:02 +0200	[thread overview]
Message-ID: <20230815181309.8595-1-tdevries@suse.de> (raw)

I tried building gdb using -std=c++20, an ran into a few issues.

This series contains fixes for most of them.

I ran into a problem in a libguile header file, I've worked around that by
disabling guile support.  I'll file a PR about this.

The final patch, "[gdb/build, c++20] Handle deprecated
std::allocator::construct", exposes two problems where a gdb::byte_vector is
returned and consequently copied.

I have fix for one of those, patch "[gdb/build] Return reference in
target_read_auxv".

But the other one, in remote_target::thread_info_to_thread_handle remains
unfixed:
...
gdb::byte_vector
remote_target::thread_info_to_thread_handle (struct thread_info *tp)
{
  remote_thread_info *priv = get_remote_thread_info (tp);
  return priv->thread_handle;
}
...

I wrote a patch for this, which allowed me to finish the build with
-std=c++20, but it causes a regression in gdb.python/py-thrhandle.exp, so it's
not included in this series.

Tested on x86_64-linux, with:
- gcc 7.5.0 -std=c++11, and
- gcc 12.3.0 -std=c++17.

Build on x86_64-linux, with:
- gcc 12.3.0 -std=c++20, which runs into the single error mentioned above.

Tom de Vries (7):
  [gdb/build, c++20] Fix Wdeprecated-enum-enum-conversion
  [gdb/build, c++20] Stop using deprecated is_pod
  [gdb/build, c++20] Fix DISABLE_COPY_AND_ASSIGN use in ui_out_emit_type
  [gdb/build, c++20] Fix deprecated implicit capture of this
  [gdb/build, c++20] Fix invalid conversion in test_symbols
  [gdb/build] Return reference in target_read_auxv
  [gdb/build, c++20] Handle deprecated std::allocator::construct

 gdb/ada-lang.c                  |  2 +-
 gdb/arm-fbsd-tdep.c             |  2 +-
 gdb/auxv.c                      |  6 +++---
 gdb/auxv.h                      |  2 +-
 gdb/dwarf2/read.c               |  2 +-
 gdb/ravenscar-thread.c          |  2 +-
 gdb/remote.c                    | 14 +++++++++-----
 gdb/rs6000-tdep.c               |  3 ++-
 gdb/ui-out.h                    |  2 +-
 gdb/unittests/ptid-selftests.c  |  4 +++-
 gdbsupport/common-exceptions.h  |  4 +++-
 gdbsupport/default-init-alloc.h | 13 ++++++++++++-
 gdbsupport/poison.h             |  2 +-
 13 files changed, 39 insertions(+), 19 deletions(-)


base-commit: 2a3f442df9e9a71f9e3c4c5999a2c53bf93e488d
-- 
2.35.3


             reply	other threads:[~2023-08-15 18:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 18:13 Tom de Vries [this message]
2023-08-15 18:13 ` [PATCH 1/7] [gdb/build, c++20] Fix Wdeprecated-enum-enum-conversion Tom de Vries
2023-08-15 18:13 ` [PATCH 2/7] [gdb/build, c++20] Stop using deprecated is_pod Tom de Vries
2023-08-15 18:13 ` [PATCH 3/7] [gdb/build, c++20] Fix DISABLE_COPY_AND_ASSIGN use in ui_out_emit_type Tom de Vries
2023-08-15 18:13 ` [PATCH 4/7] [gdb/build, c++20] Fix deprecated implicit capture of this Tom de Vries
2023-08-15 18:13 ` [PATCH 5/7] [gdb/build, c++20] Fix invalid conversion in test_symbols Tom de Vries
2023-08-15 18:13 ` [PATCH 6/7] [gdb/build] Return reference in target_read_auxv Tom de Vries
2023-08-16 18:23   ` Tom Tromey
2023-08-15 18:13 ` [PATCH 7/7] [gdb/build, c++20] Handle deprecated std::allocator::construct Tom de Vries
2023-08-16 18:27 ` [PATCH 0/7] [gdb/build] Fix -std=c++20 issues Tom Tromey
2023-08-21 11:04   ` Tom de Vries

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=20230815181309.8595-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@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).