diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2024-07-16 16:02:12 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-07-16 18:30:45 -0400 |
commit | d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3 (patch) | |
tree | b8897a470d1270148fdee39e16f54baa3907a079 /gdb | |
parent | 9153eb8a7f5449c9baa67b2349cdfc0a47104c9a (diff) | |
download | gdb-d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3.zip gdb-d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3.tar.gz gdb-d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3.tar.bz2 |
gdb, gdbserver, gdbsupport: use [[noreturn]] instead of ATTRIBUTE_NORETURN
C++ 11 has a built-in attribute for this, no need to use a compat macro.
Change-Id: I90e4220d26e8f3949d91761f8a13cd9c37da3875
Reviewed-by: Lancelot Six <lancelot.six@amd.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/command.h | 2 | ||||
-rw-r--r-- | gdb/dwarf2/loc.c | 2 | ||||
-rw-r--r-- | gdb/event-top.c | 2 | ||||
-rw-r--r-- | gdb/guile/guile-internal.h | 28 | ||||
-rw-r--r-- | gdb/linespec.c | 8 | ||||
-rw-r--r-- | gdb/nat/aarch64-mte-linux-ptrace.c | 4 | ||||
-rw-r--r-- | gdb/nat/fork-inferior.h | 7 | ||||
-rw-r--r-- | gdb/nat/linux-namespaces.c | 2 | ||||
-rw-r--r-- | gdb/python/python-internal.h | 5 | ||||
-rw-r--r-- | gdb/remote-sim.c | 3 | ||||
-rw-r--r-- | gdb/remote.c | 4 | ||||
-rw-r--r-- | gdb/symtab.c | 2 | ||||
-rw-r--r-- | gdb/target.c | 4 | ||||
-rw-r--r-- | gdb/target.h | 2 | ||||
-rw-r--r-- | gdb/tid-parse.c | 2 | ||||
-rw-r--r-- | gdb/tid-parse.h | 2 | ||||
-rw-r--r-- | gdb/top.h | 2 | ||||
-rw-r--r-- | gdb/utils.c | 2 | ||||
-rw-r--r-- | gdb/xml-support.c | 4 | ||||
-rw-r--r-- | gdb/xml-support.h | 5 |
20 files changed, 45 insertions, 47 deletions
diff --git a/gdb/command.h b/gdb/command.h index 615f4e5..0ceaf3e 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -876,7 +876,7 @@ extern void cmd_show_list (struct cmd_list_element *, int); /* Used everywhere whenever at least one parameter is required and none is specified. */ -extern void error_no_arg (const char *) ATTRIBUTE_NORETURN; +[[noreturn]] extern void error_no_arg (const char *); /* Command line saving and repetition. diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 5fea668..637c81f 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -2253,7 +2253,7 @@ dwarf2_get_symbol_read_needs (gdb::array_view<const gdb_byte> expr, /* A helper function that throws an unimplemented error mentioning a given DWARF operator. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void unimplemented (unsigned int op) { const char *name = get_DW_OP_name (op); diff --git a/gdb/event-top.c b/gdb/event-top.c index b81970d..cdc7874 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -894,7 +894,7 @@ unblock_signal (int sig) /* Called to handle fatal signals. SIG is the signal number. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void handle_fatal_signal (int sig) { #ifdef TUI diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h index be16fee..dea7884 100644 --- a/gdb/guile/guile-internal.h +++ b/gdb/guile/guile-internal.h @@ -326,32 +326,32 @@ extern SCM gdbscm_make_type_error (const char *subr, int arg_pos, extern SCM gdbscm_make_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, const char *error); -extern void gdbscm_invalid_object_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) - ATTRIBUTE_NORETURN; +[[noreturn]] extern void gdbscm_invalid_object_error (const char *subr, + int arg_pos, + SCM bad_value, + const char *error); extern SCM gdbscm_make_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, const char *error); -extern void gdbscm_out_of_range_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) - ATTRIBUTE_NORETURN; +[[noreturn]] extern void gdbscm_out_of_range_error (const char *subr, + int arg_pos, SCM bad_value, + const char *error); extern SCM gdbscm_make_misc_error (const char *subr, int arg_pos, SCM bad_value, const char *error); -extern void gdbscm_misc_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) - ATTRIBUTE_NORETURN; +[[noreturn]] extern void gdbscm_misc_error (const char *subr, int arg_pos, + SCM bad_value, const char *error); -extern void gdbscm_throw (SCM exception) ATTRIBUTE_NORETURN; +[[noreturn]] extern void gdbscm_throw (SCM exception); struct gdbscm_gdb_exception; extern SCM gdbscm_scm_from_gdb_exception (const gdbscm_gdb_exception &exception); -extern void gdbscm_throw_gdb_exception (gdbscm_gdb_exception exception) - ATTRIBUTE_NORETURN; +[[noreturn]] extern void gdbscm_throw_gdb_exception + (gdbscm_gdb_exception exception); extern void gdbscm_print_exception_with_stack (SCM port, SCM stack, SCM key, SCM args); @@ -368,8 +368,8 @@ extern excp_matcher_func gdbscm_user_error_p; extern SCM gdbscm_make_memory_error (const char *subr, const char *msg, SCM args); -extern void gdbscm_memory_error (const char *subr, const char *msg, SCM args) - ATTRIBUTE_NORETURN; +[[noreturn]] extern void gdbscm_memory_error (const char *subr, + const char *msg, SCM args); /* scm-safe-call.c */ diff --git a/gdb/linespec.c b/gdb/linespec.c index eae4f9f..9b0652c 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1544,7 +1544,7 @@ decode_line_2 (struct linespec_state *self, /* Throw an appropriate error when SYMBOL is not found (optionally in FILENAME). */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void symbol_not_found_error (const char *symbol, const char *filename) { if (symbol == NULL) @@ -1586,7 +1586,7 @@ symbol_not_found_error (const char *symbol, const char *filename) /* Throw an appropriate error when an unexpected token is encountered in the input. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void unexpected_linespec_error (linespec_parser *parser) { linespec_token token; @@ -1613,7 +1613,7 @@ unexpected_linespec_error (linespec_parser *parser) /* Throw an undefined label error. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void undefined_label_error (const char *function, const char *label) { if (function != NULL) @@ -1628,7 +1628,7 @@ undefined_label_error (const char *function, const char *label) /* Throw a source file not found error. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void source_file_not_found_error (const char *name) { throw_error (NOT_FOUND_ERROR, _("No source file named %s."), name); diff --git a/gdb/nat/aarch64-mte-linux-ptrace.c b/gdb/nat/aarch64-mte-linux-ptrace.c index ace3e18..9e2a2ce 100644 --- a/gdb/nat/aarch64-mte-linux-ptrace.c +++ b/gdb/nat/aarch64-mte-linux-ptrace.c @@ -31,7 +31,7 @@ /* Helper function to display various possible errors when reading MTE tags. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void aarch64_mte_linux_peek_error (int error) { switch (error) @@ -53,7 +53,7 @@ aarch64_mte_linux_peek_error (int error) /* Helper function to display various possible errors when writing MTE tags. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void aarch64_mte_linux_poke_error (int error) { switch (error) diff --git a/gdb/nat/fork-inferior.h b/gdb/nat/fork-inferior.h index f3e2f54..0fd4218 100644 --- a/gdb/nat/fork-inferior.h +++ b/gdb/nat/fork-inferior.h @@ -84,13 +84,12 @@ extern void gdb_flush_out_err (); /* Report an error that happened when starting to trace the inferior (i.e., when the "traceme_fun" callback is called on fork_inferior) and bail out. This function does not return. */ -extern void trace_start_error (const char *fmt, ...) - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2); +[[noreturn]] extern void trace_start_error (const char *fmt, ...) + ATTRIBUTE_PRINTF (1, 2); /* Like "trace_start_error", but the error message is constructed by combining STRING with the system error message for errno. This function does not return. */ -extern void trace_start_error_with_name (const char *string) - ATTRIBUTE_NORETURN; +[[noreturn]] extern void trace_start_error_with_name (const char *string); #endif /* NAT_FORK_INFERIOR_H */ diff --git a/gdb/nat/linux-namespaces.c b/gdb/nat/linux-namespaces.c index 36a245c..9abd3d6 100644 --- a/gdb/nat/linux-namespaces.c +++ b/gdb/nat/linux-namespaces.c @@ -548,7 +548,7 @@ mnsh_handle_readlink (int sock, const char *filename) /* The helper process. Never returns. Must be async-signal-safe. */ -static void mnsh_main (int sock) ATTRIBUTE_NORETURN; +[[noreturn]] static void mnsh_main (int sock); static void mnsh_main (int sock) diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index f25cd3b..5db3088 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -948,7 +948,7 @@ private: int gdbpy_print_python_errors_p (void); void gdbpy_print_stack (void); void gdbpy_print_stack_or_quit (); -void gdbpy_handle_exception () ATTRIBUTE_NORETURN; +[[noreturn]] void gdbpy_handle_exception (); /* A wrapper around calling 'error'. Prefixes the error message with an 'Error occurred in Python' string. Use this in C++ code if we spot @@ -958,8 +958,7 @@ void gdbpy_handle_exception () ATTRIBUTE_NORETURN; This always calls error, and never returns. */ -void gdbpy_error (const char *fmt, ...) - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2); +[[noreturn]] void gdbpy_error (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2); gdbpy_ref<> python_string_to_unicode (PyObject *obj); gdb::unique_xmalloc_ptr<char> unicode_to_target_string (PyObject *unicode_str); diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index f92de61..67d3f4c 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -69,8 +69,7 @@ static void gdb_os_vprintf_filtered (host_callback *, const char *, va_list); static void gdb_os_evprintf_filtered (host_callback *, const char *, va_list); -static void gdb_os_error (host_callback *, const char *, ...) - ATTRIBUTE_NORETURN; +[[noreturn]] static void gdb_os_error (host_callback *, const char *, ...); /* Naming convention: diff --git a/gdb/remote.c b/gdb/remote.c index 5d2e251..a3617e8 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1539,7 +1539,7 @@ static void remote_console_output (const char *msg, ui_file *stream); static void remote_btrace_reset (remote_state *rs); -static void remote_unpush_and_throw (remote_target *target); +[[noreturn]] static void remote_unpush_and_throw (remote_target *target); /* For "remote". */ @@ -6150,7 +6150,7 @@ remote_unpush_target (remote_target *target) fileio_handles_invalidate_target (target); } -static void ATTRIBUTE_NORETURN +[[noreturn]] static void remote_unpush_and_throw (remote_target *target) { remote_unpush_target (target); diff --git a/gdb/symtab.c b/gdb/symtab.c index bb2fc04..9d11703 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2439,7 +2439,7 @@ lookup_symbol_in_objfile_from_linkage_name (struct objfile *objfile, /* A helper function that throws an exception when a symbol was found in a psymtab but not in a symtab. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void error_in_psymtab_expansion (enum block_enum block_index, const char *name, struct compunit_symtab *cust) { diff --git a/gdb/target.c b/gdb/target.c index 1802703..d237437 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -56,7 +56,7 @@ #include "cli/cli-decode.h" #include "cli/cli-style.h" -static void generic_tls_error (void) ATTRIBUTE_NORETURN; +[[noreturn]] static void generic_tls_error (void); static void default_rcmd (struct target_ops *, const char *, struct ui_file *); @@ -64,7 +64,7 @@ static int default_verify_memory (struct target_ops *self, const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size); -static void tcomplain (void) ATTRIBUTE_NORETURN; +[[noreturn]] static void tcomplain (void); /* Mapping between target_info objects (which have address identity) and corresponding open/factory function/callback. Each add_target diff --git a/gdb/target.h b/gdb/target.h index d0af584..f1b97cf 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -2490,7 +2490,7 @@ extern int default_memory_insert_breakpoint (struct gdbarch *, extern void initialize_targets (void); -extern void noprocess (void) ATTRIBUTE_NORETURN; +[[noreturn]] extern void noprocess (void); extern void target_require_runnable (void); diff --git a/gdb/tid-parse.c b/gdb/tid-parse.c index 623f55e..1b8f343 100644 --- a/gdb/tid-parse.c +++ b/gdb/tid-parse.c @@ -24,7 +24,7 @@ /* See tid-parse.h. */ -void ATTRIBUTE_NORETURN +[[noreturn]] void invalid_thread_id_error (const char *string) { error (_("Invalid thread ID: %s"), string); diff --git a/gdb/tid-parse.h b/gdb/tid-parse.h index b7bd920..7bbdeab 100644 --- a/gdb/tid-parse.h +++ b/gdb/tid-parse.h @@ -26,7 +26,7 @@ struct thread_info; /* Issue an invalid thread ID error, pointing at STRING, the invalid ID. */ -extern void ATTRIBUTE_NORETURN invalid_thread_id_error (const char *string); +[[noreturn]] extern void invalid_thread_id_error (const char *string); /* Parse TIDSTR as a per-inferior thread ID, in either INF_NUM.THR_NUM or THR_NUM form. In the latter case, the missing INF_NUM is filled @@ -42,7 +42,7 @@ extern void read_command_file (FILE *); extern void init_history (void); extern void command_loop (void); extern int quit_confirm (void); -extern void quit_force (int *, int) ATTRIBUTE_NORETURN; +[[noreturn]] extern void quit_force (int *, int); extern void quit_command (const char *, int); extern void quit_cover (void); extern void execute_command (const char *, int); diff --git a/gdb/utils.c b/gdb/utils.c index 17498e0..9431030 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -192,7 +192,7 @@ verror (const char *string, va_list args) /* Emit a message and abort. */ -static void ATTRIBUTE_NORETURN +[[noreturn]] static void abort_with_message (const char *msg) { if (current_ui == NULL) diff --git a/gdb/xml-support.c b/gdb/xml-support.c index b60b2c5..33c8e41 100644 --- a/gdb/xml-support.c +++ b/gdb/xml-support.c @@ -93,8 +93,8 @@ struct gdb_xml_parser ATTRIBUTE_PRINTF (2, 0); /* Issue an error message, and stop parsing. */ - void verror (const char *format, va_list ap) - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 0); + [[noreturn]] void verror (const char *format, va_list ap) + ATTRIBUTE_PRINTF (2, 0); void body_text (const XML_Char *text, int length); void start_element (const XML_Char *name, const XML_Char **attrs); diff --git a/gdb/xml-support.h b/gdb/xml-support.h index b9bac7a..2ff0e3c 100644 --- a/gdb/xml-support.h +++ b/gdb/xml-support.h @@ -191,8 +191,9 @@ void gdb_xml_debug (struct gdb_xml_parser *parser, const char *format, ...) /* Issue an error message from one of PARSER's handlers, and stop parsing. */ -void gdb_xml_error (struct gdb_xml_parser *parser, const char *format, ...) - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3); +[[noreturn]] void gdb_xml_error (struct gdb_xml_parser *parser, + const char *format, ...) + ATTRIBUTE_PRINTF (2, 3); /* Find the attribute named NAME in the set of parsed attributes ATTRIBUTES. Returns NULL if not found. */ |