From: Lancelot Six <lancelot.six@amd.com>
To: <gdb-patches@sourceware.org>
Cc: <pedro@palves.net>, <tom@tromey.com>,
Lancelot Six <lancelot.six@amd.com>
Subject: [COMMITTED PATCH v2 8/9] gdb/disasm.h: Mark callbacks noexcept unconditionally
Date: Tue, 21 Nov 2023 12:04:59 +0000 [thread overview]
Message-ID: <20231121120500.1394523-9-lancelot.six@amd.com> (raw)
In-Reply-To: <20231028204821.fp5hh7bahrmrnpjl@hpe6u-23>
Given that C++17 is now a requirement for GDB, update gdb/disasm.h to
define callback function types noexcept unconditionally. The pre-C++17
configuration is not supported anymore.
Change-Id: I0a38e22b7912c70a11425363a991f0b01614343e
Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
---
gdb/disasm.h | 27 ++++++---------------------
1 file changed, 6 insertions(+), 21 deletions(-)
diff --git a/gdb/disasm.h b/gdb/disasm.h
index 5596bd62a10..90fa1dfc02b 100644
--- a/gdb/disasm.h
+++ b/gdb/disasm.h
@@ -26,12 +26,6 @@ struct gdbarch;
struct ui_out;
struct ui_file;
-#if __cplusplus >= 201703L
-#define LIBOPCODE_CALLBACK_NOEXCEPT noexcept
-#else
-#define LIBOPCODE_CALLBACK_NOEXCEPT
-#endif
-
/* A wrapper around a disassemble_info and a gdbarch. This is the core
set of data that all disassembler sub-classes will need. This class
doesn't actually implement the disassembling process, that is something
@@ -58,27 +52,18 @@ struct gdb_disassemble_info
protected:
/* Types for the function callbacks within m_di. The actual function
- signatures here are taken from include/dis-asm.h. The noexcept macro
- expands to 'noexcept' for C++17 and later, otherwise, it expands to
- nothing. This is because including noexcept was ignored for function
- types before C++17, but both GCC and Clang warn that the noexcept
- will become relevant when you switch to C++17, and this warning
- causes the build to fail. */
+ signatures here are taken from include/dis-asm.h. */
using read_memory_ftype
= int (*) (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *)
- LIBOPCODE_CALLBACK_NOEXCEPT;
+ noexcept;
using memory_error_ftype
- = void (*) (int, bfd_vma, struct disassemble_info *)
- LIBOPCODE_CALLBACK_NOEXCEPT;
+ = void (*) (int, bfd_vma, struct disassemble_info *) noexcept;
using print_address_ftype
- = void (*) (bfd_vma, struct disassemble_info *)
- LIBOPCODE_CALLBACK_NOEXCEPT;
+ = void (*) (bfd_vma, struct disassemble_info *) noexcept;
using fprintf_ftype
- = int (*) (void *, const char *, ...)
- LIBOPCODE_CALLBACK_NOEXCEPT;
+ = int (*) (void *, const char *, ...) noexcept;
using fprintf_styled_ftype
- = int (*) (void *, enum disassembler_style, const char *, ...)
- LIBOPCODE_CALLBACK_NOEXCEPT;
+ = int (*) (void *, enum disassembler_style, const char *, ...) noexcept;
/* Constructor, many fields in m_di are initialized from GDBARCH. The
remaining arguments are function callbacks that are written into m_di.
--
2.34.1
next prev parent reply other threads:[~2023-11-21 12:05 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-13 14:44 [PATCH 00/11] GDB: Require C++17 Lancelot Six
2023-10-13 14:44 ` [PATCH 01/11] gdb/ax_cxx_compile_stdcxx.m4: upgrade Lancelot Six
2023-10-13 14:44 ` [PATCH 02/11] gdb/gdbsupport/gdbserver: Require c++17 Lancelot Six
2023-10-13 15:21 ` Eli Zaretskii
2023-10-16 21:50 ` Pedro Alves
2023-10-13 14:44 ` [PATCH 03/11] gdb: Use C++17's std::make_unique instead of gdb::make_unique Lancelot Six
2023-10-16 19:14 ` Tom Tromey
2023-10-17 14:02 ` Lancelot SIX
2023-10-13 14:44 ` [PATCH 04/11] gdb: Replace gdb::optional with std::optional Lancelot Six
2023-10-13 14:44 ` [PATCH 05/11] gdbsupport: remove gdb::optional Lancelot Six
2023-10-13 14:44 ` [PATCH 06/11] gdb: Use std::string_view instead of gdb::string_view Lancelot Six
2023-10-14 21:50 ` Tom Tromey
2023-10-14 23:58 ` Six, Lancelot
2023-10-16 15:06 ` Lancelot SIX
2023-10-16 19:35 ` Tom Tromey
2023-10-16 21:51 ` Pedro Alves
2023-10-17 14:13 ` Lancelot SIX
2023-10-17 14:20 ` Simon Marchi
2023-10-13 14:44 ` [PATCH 07/11] gdb: Remove uses of gdb::to_string (const std::string_view &) Lancelot Six
2023-10-13 14:44 ` [PATCH 08/11] gdbsupport: Remove gdb::string_view Lancelot Six
2023-10-16 19:38 ` Tom Tromey
2023-10-13 14:44 ` [PATCH 09/11] gdbsupport: Replace gdb::invoke_result with std::invoke_result Lancelot Six
2023-10-13 14:44 ` [PATCH 10/11] gdb/disasm.h: Mark callbacks noexcept unconditionally Lancelot Six
2023-10-16 21:51 ` Pedro Alves
2023-10-13 14:44 ` [PATCH 11/11] gdb: Use initializers in lambda captures unconditionally Lancelot Six
2023-10-16 19:43 ` [PATCH 00/11] GDB: Require C++17 Tom Tromey
2023-10-16 21:53 ` Pedro Alves
2023-10-23 13:42 ` Lancelot SIX
2023-10-28 20:48 ` Lancelot SIX
2023-11-21 12:04 ` [COMMITTED PATCH v2 0/9] " Lancelot Six
2023-11-21 12:04 ` [COMMITTED PATCH v2 1/9] gdb: Use C++17's std::make_unique instead of gdb::make_unique Lancelot Six
2023-11-21 12:04 ` [COMMITTED PATCH v2 2/9] gdb: Replace gdb::optional with std::optional Lancelot Six
2023-11-21 12:04 ` [COMMITTED PATCH v2 3/9] gdbsupport: remove gdb::optional Lancelot Six
2023-11-21 12:04 ` [COMMITTED PATCH v2 4/9] gdb: Use std::string_view instead of gdb::string_view Lancelot Six
2023-11-21 12:04 ` [COMMITTED PATCH v2 5/9] gdb: Remove uses of gdb::to_string (const std::string_view &) Lancelot Six
2023-11-21 12:04 ` [COMMITTED PATCH v2 6/9] gdbsupport: Remove gdb::string_view Lancelot Six
2023-11-21 12:04 ` [COMMITTED PATCH v2 7/9] gdbsupport: Replace gdb::invoke_result with std::invoke_result Lancelot Six
2023-11-21 12:04 ` Lancelot Six [this message]
2023-11-21 12:05 ` [COMMITTED PATCH v2 9/9] gdb: Use initializers in lambda captures unconditionally Lancelot Six
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=20231121120500.1394523-9-lancelot.six@amd.com \
--to=lancelot.six@amd.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
--cc=tom@tromey.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).