From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yUIgFivsMGq/pAkAWB0awg (envelope-from ) for ; Tue, 16 Jun 2026 02:24:43 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=E9/99sUg; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=7tATmz5p; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=E9/99sUg; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=7tATmz5p; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5511F1E098; Tue, 16 Jun 2026 02:24:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9DBC61E024 for ; Tue, 16 Jun 2026 02:24:41 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B1EF648FBCBB for ; Tue, 16 Jun 2026 06:24:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1EF648FBCBB Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=E9/99sUg; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=7tATmz5p; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=E9/99sUg; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=7tATmz5p Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 344FF48FDC80 for ; Tue, 16 Jun 2026 06:23:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 344FF48FDC80 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 344FF48FDC80 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781590994; cv=none; b=jltpqzrXkD+8/esOzCTiX4vVHW1YEvQ9Zsfwol0NRxqXGZY6xnQ8FGCj+MZjipjUJiuvFkaM8PVAsQ/uIWbi28cAZ0WlJctRwhZHfpMtNcyLwmZb/cfOpyJI1XzF3sOsmSj2+gaYSTcGBHy4H5sybbHiKqxXiJYJS+WZVsiOao0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781590994; c=relaxed/simple; bh=/FugK/Mt7cXSaVSlhXmxt3K883AfQLmjGg+rVwJoR88=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=TvpKHANaXJRndCpUQXWkHixXgULDiIWL6TKlMgvRJegaUvVyPzEg5SuiNLmoU2D60gTJ3xdC8+6klxlpZiHt4E24Li94V/HgW4lv4cuYC6+Hkc45ilISOwWpQE6AffPj2DJLCyxonaKQ2JCgm3PIfTCBDHFrR0pHX/a7eFKfO2c= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=E9/99sUg; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=7tATmz5p; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=E9/99sUg; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=7tATmz5p DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 344FF48FDC80 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DEDCF75FE5 for ; Tue, 16 Jun 2026 06:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1781590978; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6aL1zXHqjM1yzNyOg4NfkVI/3+GSmId7DukSWxDGdPM=; b=E9/99sUggcZF+qQr2ewizIrDYwiIbNG3UeAwh/TwHRM0B/+UubnvpfZqDJm5G71HlfDbA9 5aOzfGj3HL+L7KSx3/sqNIIM5y/I3OJ5G1url4i+UvPnLwhFXDUFTpsBnqD8o6NAYXGfJ7 lyJjITP8DTLLuIL0oVGyFsUY7LDNuW0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1781590978; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6aL1zXHqjM1yzNyOg4NfkVI/3+GSmId7DukSWxDGdPM=; b=7tATmz5pRgiaj4V4DgpwvWohn2sLmNtUkHso1fzymjA2VQaMCYqXSFZxPngGvVd+K2e22f JW27GXwfbXginjCg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="E9/99sUg"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=7tATmz5p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1781590978; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6aL1zXHqjM1yzNyOg4NfkVI/3+GSmId7DukSWxDGdPM=; b=E9/99sUggcZF+qQr2ewizIrDYwiIbNG3UeAwh/TwHRM0B/+UubnvpfZqDJm5G71HlfDbA9 5aOzfGj3HL+L7KSx3/sqNIIM5y/I3OJ5G1url4i+UvPnLwhFXDUFTpsBnqD8o6NAYXGfJ7 lyJjITP8DTLLuIL0oVGyFsUY7LDNuW0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1781590978; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6aL1zXHqjM1yzNyOg4NfkVI/3+GSmId7DukSWxDGdPM=; b=7tATmz5pRgiaj4V4DgpwvWohn2sLmNtUkHso1fzymjA2VQaMCYqXSFZxPngGvVd+K2e22f JW27GXwfbXginjCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C9241779AB for ; Tue, 16 Jun 2026 06:22:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4DvDL8LrMGr8fAAAD6G6ig (envelope-from ) for ; Tue, 16 Jun 2026 06:22:58 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 06/12] [gdb] Convert function typedefs to using Date: Tue, 16 Jun 2026 08:22:51 +0200 Message-ID: <20260616062257.3164438-7-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260616062257.3164438-1-tdevries@suse.de> References: <20260616062257.3164438-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid, suse.de:dkim, imap1.dmz-prg2.suse.org:helo, imap1.dmz-prg2.suse.org:rdns] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: DEDCF75FE5 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Convert "typedef void foo ()" to "using foo = void ()". Generated by a script written by Claude Code. --- gdb/ada-exp.h | 8 ++-- gdb/command.h | 18 ++++---- gdb/completer.h | 2 +- gdb/expop.h | 16 ++++---- gdb/extension.h | 14 +++---- gdb/f-exp.h | 12 +++--- gdb/frame-base.h | 12 +++--- gdb/frame-unwind.h | 21 +++++----- gdb/gdbarch.h | 6 +-- gdb/ia64-libunwind-tdep.c | 26 ++++++------ gdb/linux-tdep.c | 4 +- gdb/m32c-tdep.c | 12 +++--- gdb/macrotab.h | 8 ++-- gdb/mi/mi-cmds.h | 4 +- gdb/nat/gdb_thread_db.h | 52 +++++++++++------------ gdb/regset.h | 10 ++--- gdb/rs6000-tdep.c | 4 +- gdb/sol-thread.c | 86 +++++++++++++++++++-------------------- gdb/stap-probe.c | 2 +- gdb/svr4-tls-tdep.h | 12 +++--- gdb/symtab.h | 7 ++-- gdb/target.h | 5 +-- gdb/xml-support.h | 6 +-- gdbserver/server.cc | 4 +- 24 files changed, 175 insertions(+), 176 deletions(-) diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 134f767ae5e..be9b441d0c1 100644 --- a/gdb/ada-exp.h +++ b/gdb/ada-exp.h @@ -372,10 +372,10 @@ class ada_var_msym_value_operation using operation::do_generate_ax; }; -typedef struct value *ada_atr_ftype (struct expression *exp, - enum noside noside, - struct type *type, - struct value *arg); +using ada_atr_ftype = struct value * (struct expression *exp, + enum noside noside, + struct type *type, + struct value *arg); /* Implement several Ada attributes. */ template diff --git a/gdb/command.h b/gdb/command.h index 36287d657f9..7640bd33ca4 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -507,7 +507,7 @@ extern struct cmd_list_element *add_abbrev_prefix_cmd (const char *, struct cmd_list_element **); -typedef void cmd_func_ftype (const char *args, int from_tty, +using cmd_func_ftype = void (const char *args, int from_tty, cmd_list_element *c); /* A completion routine. Add possible completions to tracker. @@ -519,14 +519,14 @@ typedef void cmd_func_ftype (const char *args, int from_tty, relative to this position. For example, suppose TEXT is "foo" and we want to complete to "foobar". If WORD is "oo", return "oobar"; if WORD is "baz/foo", return "baz/foobar". */ -typedef void completer_ftype (struct cmd_list_element *, +using completer_ftype = void (struct cmd_list_element *, completion_tracker &tracker, const char *text, const char *word); /* Same, but for set_cmd_completer_handle_brkchars. */ -typedef void completer_handle_brkchars_ftype (struct cmd_list_element *, - completion_tracker &tracker, - const char *text, const char *word); +using completer_handle_brkchars_ftype + = void (struct cmd_list_element *, completion_tracker &tracker, + const char *text, const char *word); extern void set_cmd_completer (struct cmd_list_element *, completer_ftype *); @@ -668,10 +668,10 @@ extern void help_list (struct cmd_list_element *, const char *, command_classes, struct ui_file *); /* Method for show a set/show variable's VALUE on FILE. */ -typedef void (show_value_ftype) (struct ui_file *file, - int from_tty, - struct cmd_list_element *cmd, - const char *value); +using show_value_ftype = void (struct ui_file *file, + int from_tty, + struct cmd_list_element *cmd, + const char *value); /* Various sets of extra literals accepted. */ extern const literal_def integer_unlimited_literals[]; diff --git a/gdb/completer.h b/gdb/completer.h index c84ce3ec28a..6e8f5e62d86 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -26,7 +26,7 @@ struct match_list_displayer; using mld_crlf_ftype = void (const struct match_list_displayer *); using mld_putch_ftype = void (const struct match_list_displayer *, int); -typedef void mld_puts_ftype (const struct match_list_displayer *, +using mld_puts_ftype = void (const struct match_list_displayer *, const char *); using mld_flush_ftype = void (const struct match_list_displayer *); using mld_erase_entire_line_ftype = void (const struct match_list_displayer *); diff --git a/gdb/expop.h b/gdb/expop.h index 41331c4a780..6d6f4acdc24 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -1271,10 +1271,10 @@ class sub_operation } }; -typedef struct value *binary_ftype (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct value *arg2); +using binary_ftype = struct value * (struct type *expect_type, + struct expression *exp, + enum noside noside, enum exp_opcode op, + struct value *arg1, struct value *arg2); template class binop_operation @@ -1450,10 +1450,10 @@ class comma_operation override; }; -typedef struct value *unary_ftype (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1); +using unary_ftype = struct value * (struct type *expect_type, + struct expression *exp, + enum noside noside, enum exp_opcode op, + struct value *arg1); /* Base class for unary operations. */ template diff --git a/gdb/extension.h b/gdb/extension.h index b7bbf2a502d..38a2ca5f887 100644 --- a/gdb/extension.h +++ b/gdb/extension.h @@ -41,21 +41,21 @@ struct program_space; /* A function to load and process a script file. The file has been opened and is ready to be read from the beginning. Any exceptions are not caught, and are passed to the caller. */ -typedef void script_sourcer_func (const struct extension_language_defn *, +using script_sourcer_func = void (const struct extension_language_defn *, FILE *stream, const char *filename); /* A function to load and process a script for an objfile. The file has been opened and is ready to be read from the beginning. Any exceptions are not caught, and are passed to the caller. */ -typedef void objfile_script_sourcer_func - (const struct extension_language_defn *, - struct objfile *, FILE *stream, const char *filename); +using objfile_script_sourcer_func + = void (const struct extension_language_defn *, + struct objfile *, FILE *stream, const char *filename); /* A function to execute a script for an objfile. Any exceptions are not caught, and are passed to the caller. */ -typedef void objfile_script_executor_func - (const struct extension_language_defn *, - struct objfile *, const char *name, const char *script); +using objfile_script_executor_func + = void (const struct extension_language_defn *, + struct objfile *, const char *name, const char *script); /* Enum of each extension(/scripting) language. */ diff --git a/gdb/f-exp.h b/gdb/f-exp.h index 71ec3128515..1b2e75fb49e 100644 --- a/gdb/f-exp.h +++ b/gdb/f-exp.h @@ -198,9 +198,9 @@ namespace expr /* Function prototype for Fortran intrinsic functions taking one argument and one kind argument. */ -typedef value *binary_kind_ftype (type *expect_type, expression *exp, - noside noside, exp_opcode op, value *arg1, - type *kind_arg); +using binary_kind_ftype = value * (type *expect_type, expression *exp, + noside noside, exp_opcode op, value *arg1, + type *kind_arg); /* Two-argument operation with the second argument being a kind argument. */ template @@ -224,9 +224,9 @@ class fortran_kind_2arg /* Function prototype for Fortran intrinsic functions taking two arguments and one kind argument. */ -typedef value *ternary_kind_ftype (type *expect_type, expression *exp, - noside noside, exp_opcode op, value *arg1, - value *arg2, type *kind_arg); +using ternary_kind_ftype = value * (type *expect_type, expression *exp, + noside noside, exp_opcode op, value *arg1, + value *arg2, type *kind_arg); /* Three-argument operation with the third argument being a kind argument. */ template diff --git a/gdb/frame-base.h b/gdb/frame-base.h index 723d2ba56d3..d8cdc0a98b9 100644 --- a/gdb/frame-base.h +++ b/gdb/frame-base.h @@ -42,18 +42,18 @@ struct regcache; /* A generic base address. */ -typedef CORE_ADDR (frame_this_base_ftype) (const frame_info_ptr &this_frame, - void **this_base_cache); +using frame_this_base_ftype = CORE_ADDR (const frame_info_ptr &this_frame, + void **this_base_cache); /* The base address of the frame's local variables. */ -typedef CORE_ADDR (frame_this_locals_ftype) (const frame_info_ptr &this_frame, - void **this_base_cache); +using frame_this_locals_ftype = CORE_ADDR (const frame_info_ptr &this_frame, + void **this_base_cache); /* The base address of the frame's arguments / parameters. */ -typedef CORE_ADDR (frame_this_args_ftype) (const frame_info_ptr &this_frame, - void **this_base_cache); +using frame_this_args_ftype = CORE_ADDR (const frame_info_ptr &this_frame, + void **this_base_cache); struct frame_base { diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h index 3cff06b0ede..a1edb92a4ad 100644 --- a/gdb/frame-unwind.h +++ b/gdb/frame-unwind.h @@ -49,12 +49,13 @@ struct value; cases (0 return) is invalid. In case of exception, the caller has to set *THIS_PROLOGUE_CACHE to NULL. */ -typedef int (frame_sniffer_ftype) (const struct frame_unwind *self, - const frame_info_ptr &this_frame, - void **this_prologue_cache); +using frame_sniffer_ftype = int (const struct frame_unwind *self, + const frame_info_ptr &this_frame, + void **this_prologue_cache); -typedef unwind_stop_reason (frame_unwind_stop_reason_ftype) - (const frame_info_ptr &this_frame, void **this_prologue_cache); +using frame_unwind_stop_reason_ftype + = unwind_stop_reason (const frame_info_ptr &this_frame, + void **this_prologue_cache); /* A default frame sniffer which always accepts the frame. Used by fallback prologue unwinders. */ @@ -105,9 +106,9 @@ extern CORE_ADDR default_unwind_sp (struct gdbarch *gdbarch, with the other unwind methods. Memory for that cache should be allocated using frame_obstack_zalloc. */ -typedef void (frame_this_id_ftype) (const frame_info_ptr &this_frame, - void **this_prologue_cache, - struct frame_id *this_id); +using frame_this_id_ftype = void (const frame_info_ptr &this_frame, + void **this_prologue_cache, + struct frame_id *this_id); /* Assuming the frame chain: (outer) prev <-> this <-> next (inner); use THIS frame, and implicitly the NEXT frame's register unwind @@ -146,8 +147,8 @@ typedef value *(frame_prev_register_ftype) (const frame_info_ptr &this_frame, /* Deallocate extra memory associated with the frame cache if any. */ -typedef void (frame_dealloc_cache_ftype) (frame_info *self, - void *this_cache); +using frame_dealloc_cache_ftype = void (frame_info *self, + void *this_cache); /* Assuming the frame chain: (outer) prev <-> this <-> next (inner); use THIS frame, and implicitly the NEXT frame's register unwind diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 1e3270911dc..70a2c5a84aa 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -84,9 +84,9 @@ using gdbarch_tdep_up = std::unique_ptr; is used for diagnostic messages. CB_DATA should have been passed unchanged through the iterator. */ -typedef void (iterate_over_regset_sections_cb) - (const char *sect_name, int supply_size, int collect_size, - const struct regset *regset, const char *human_name, void *cb_data); +using iterate_over_regset_sections_cb + = void (const char *sect_name, int supply_size, int collect_size, + const struct regset *regset, const char *human_name, void *cb_data); /* For a function call, does the function return a value using a normal value return or a structure return - passing a hidden diff --git a/gdb/ia64-libunwind-tdep.c b/gdb/ia64-libunwind-tdep.c index d62ff195ff1..5911a8f8add 100644 --- a/gdb/ia64-libunwind-tdep.c +++ b/gdb/ia64-libunwind-tdep.c @@ -60,30 +60,30 @@ static const registry::key libunwind_descr_handle; /* Required function pointers from libunwind. */ using unw_get_reg_p_ftype = int (unw_cursor_t *, unw_regnum_t, unw_word_t *); static unw_get_reg_p_ftype *unw_get_reg_p; -typedef int (unw_get_fpreg_p_ftype) (unw_cursor_t *, unw_regnum_t, - unw_fpreg_t *); +using unw_get_fpreg_p_ftype = int (unw_cursor_t *, unw_regnum_t, + unw_fpreg_t *); static unw_get_fpreg_p_ftype *unw_get_fpreg_p; -typedef int (unw_get_saveloc_p_ftype) (unw_cursor_t *, unw_regnum_t, - unw_save_loc_t *); +using unw_get_saveloc_p_ftype = int (unw_cursor_t *, unw_regnum_t, + unw_save_loc_t *); static unw_get_saveloc_p_ftype *unw_get_saveloc_p; using unw_is_signal_frame_p_ftype = int (unw_cursor_t *); static unw_is_signal_frame_p_ftype *unw_is_signal_frame_p; using unw_step_p_ftype = int (unw_cursor_t *); static unw_step_p_ftype *unw_step_p; -typedef int (unw_init_remote_p_ftype) (unw_cursor_t *, unw_addr_space_t, - void *); +using unw_init_remote_p_ftype = int (unw_cursor_t *, unw_addr_space_t, + void *); static unw_init_remote_p_ftype *unw_init_remote_p; -typedef unw_addr_space_t (unw_create_addr_space_p_ftype) (unw_accessors_t *, - int); +using unw_create_addr_space_p_ftype + = unw_addr_space_t (unw_accessors_t *, int); static unw_create_addr_space_p_ftype *unw_create_addr_space_p; using unw_destroy_addr_space_p_ftype = void (unw_addr_space_t); static unw_destroy_addr_space_p_ftype *unw_destroy_addr_space_p; -typedef int (unw_search_unwind_table_p_ftype) (unw_addr_space_t, unw_word_t, - unw_dyn_info_t *, - unw_proc_info_t *, int, void *); +using unw_search_unwind_table_p_ftype + = int (unw_addr_space_t, unw_word_t, unw_dyn_info_t *, + unw_proc_info_t *, int, void *); static unw_search_unwind_table_p_ftype *unw_search_unwind_table_p; -typedef unw_word_t (unw_find_dyn_list_p_ftype) (unw_addr_space_t, - unw_dyn_info_t *, void *); +using unw_find_dyn_list_p_ftype = unw_word_t (unw_addr_space_t, + unw_dyn_info_t *, void *); static unw_find_dyn_list_p_ftype *unw_find_dyn_list_p; diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index a7381677498..61bcda60bd8 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -1439,8 +1439,8 @@ using linux_find_memory_region_ftype bool /* hole */, const std::string & /* filename */)>; -typedef bool linux_dump_mapping_p_ftype (filter_flags filterflags, - const smaps_data &map); +using linux_dump_mapping_p_ftype + = bool (filter_flags filterflags, const smaps_data &map); /* Parse a KEY value out of a /proc/pid/smaps line. KEYWORD is the keyword that was extracted out of the LINE we're considering. diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index a06a601dee3..5c828d1880b 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -39,13 +39,13 @@ static const reggroup *m32c_dma_reggroup; /* The type of a function that moves the value of REG between CACHE or BUF --- in either direction. */ -typedef enum register_status (m32c_write_reg_t) (struct m32c_reg *reg, - struct regcache *cache, - const gdb_byte *buf); +using m32c_write_reg_t = enum register_status (struct m32c_reg *reg, + struct regcache *cache, + const gdb_byte *buf); -typedef enum register_status (m32c_read_reg_t) (struct m32c_reg *reg, - readable_regcache *cache, - gdb_byte *buf); +using m32c_read_reg_t = enum register_status (struct m32c_reg *reg, + readable_regcache *cache, + gdb_byte *buf); struct m32c_reg { diff --git a/gdb/macrotab.h b/gdb/macrotab.h index 1a4c46a1cb1..47eb7890bf6 100644 --- a/gdb/macrotab.h +++ b/gdb/macrotab.h @@ -335,10 +335,10 @@ struct macro_source_file *macro_definition_location is the name of the macro, and DEFINITION is the definition. SOURCE is the file at the start of the include path, and LINE is the line number of the SOURCE file where the macro was defined. */ -typedef void (macro_callback_fn) (const char *name, - const struct macro_definition *definition, - struct macro_source_file *source, - int line); +using macro_callback_fn = void (const char *name, + const struct macro_definition *definition, + struct macro_source_file *source, + int line); /* Call the callable FN for each macro in the macro table TABLE. */ void macro_for_each (struct macro_table *table, diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 81c4f0b4e37..108ff645107 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -33,8 +33,8 @@ enum print_values { PRINT_SIMPLE_VALUES }; -typedef void (mi_cmd_argv_ftype) (const char *command, const char *const *argv, - int argc); +using mi_cmd_argv_ftype = void (const char *command, const char *const *argv, + int argc); /* Declarations of the functions implementing each command. */ diff --git a/gdb/nat/gdb_thread_db.h b/gdb/nat/gdb_thread_db.h index c40c1a407a0..5a3bb5f4389 100644 --- a/gdb/nat/gdb_thread_db.h +++ b/gdb/nat/gdb_thread_db.h @@ -39,36 +39,36 @@ using td_init_ftype = td_err_e (void); -typedef td_err_e (td_ta_new_ftype) (struct ps_prochandle * ps, - td_thragent_t **ta); +using td_ta_new_ftype = td_err_e (struct ps_prochandle * ps, + td_thragent_t **ta); using td_ta_delete_ftype = td_err_e (td_thragent_t *ta_p); -typedef td_err_e (td_ta_map_lwp2thr_ftype) (const td_thragent_t *ta, - lwpid_t lwpid, td_thrhandle_t *th); -typedef td_err_e (td_ta_thr_iter_ftype) (const td_thragent_t *ta, - td_thr_iter_f *callback, void *cbdata_p, - td_thr_state_e state, int ti_pri, - sigset_t *ti_sigmask_p, - unsigned int ti_user_flags); -typedef td_err_e (td_ta_event_addr_ftype) (const td_thragent_t *ta, - td_event_e event, td_notify_t *ptr); -typedef td_err_e (td_ta_set_event_ftype) (const td_thragent_t *ta, +using td_ta_map_lwp2thr_ftype = td_err_e (const td_thragent_t *ta, + lwpid_t lwpid, td_thrhandle_t *th); +using td_ta_thr_iter_ftype = td_err_e (const td_thragent_t *ta, + td_thr_iter_f *callback, void *cbdata_p, + td_thr_state_e state, int ti_pri, + sigset_t *ti_sigmask_p, + unsigned int ti_user_flags); +using td_ta_event_addr_ftype = td_err_e (const td_thragent_t *ta, + td_event_e event, td_notify_t *ptr); +using td_ta_set_event_ftype = td_err_e (const td_thragent_t *ta, + td_thr_events_t *event); +using td_ta_clear_event_ftype = td_err_e (const td_thragent_t *ta, td_thr_events_t *event); -typedef td_err_e (td_ta_clear_event_ftype) (const td_thragent_t *ta, - td_thr_events_t *event); -typedef td_err_e (td_ta_event_getmsg_ftype) (const td_thragent_t *ta, - td_event_msg_t *msg); +using td_ta_event_getmsg_ftype = td_err_e (const td_thragent_t *ta, + td_event_msg_t *msg); -typedef td_err_e (td_thr_get_info_ftype) (const td_thrhandle_t *th, - td_thrinfo_t *infop); -typedef td_err_e (td_thr_event_enable_ftype) (const td_thrhandle_t *th, - int event); +using td_thr_get_info_ftype = td_err_e (const td_thrhandle_t *th, + td_thrinfo_t *infop); +using td_thr_event_enable_ftype = td_err_e (const td_thrhandle_t *th, + int event); -typedef td_err_e (td_thr_tls_get_addr_ftype) (const td_thrhandle_t *th, - psaddr_t map_address, - size_t offset, psaddr_t *address); -typedef td_err_e (td_thr_tlsbase_ftype) (const td_thrhandle_t *th, - unsigned long int modid, - psaddr_t *base); +using td_thr_tls_get_addr_ftype = td_err_e (const td_thrhandle_t *th, + psaddr_t map_address, + size_t offset, psaddr_t *address); +using td_thr_tlsbase_ftype = td_err_e (const td_thrhandle_t *th, + unsigned long int modid, + psaddr_t *base); using td_symbol_list_ftype = const char ** (void); using td_ta_delete_ftype = td_err_e (td_thragent_t *); diff --git a/gdb/regset.h b/gdb/regset.h index 94fa74e9ec7..b63b026c756 100644 --- a/gdb/regset.h +++ b/gdb/regset.h @@ -25,11 +25,11 @@ struct regcache; /* Data structure describing a register set. */ -typedef void (supply_regset_ftype) (const struct regset *, struct regcache *, - int, const void *, size_t); -typedef void (collect_regset_ftype) (const struct regset *, - const struct regcache *, - int, void *, size_t); +using supply_regset_ftype = void (const struct regset *, struct regcache *, + int, const void *, size_t); +using collect_regset_ftype = void (const struct regset *, + const struct regcache *, + int, void *, size_t); struct regset { diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index a63f138047a..a248ec9b738 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -822,8 +822,8 @@ rs6000_fetch_pointer_argument (const frame_info_ptr &frame, int argi, constexpr gdb_byte big_breakpoint[] = { 0x7f, 0xe0, 0x00, 0x08 }; constexpr gdb_byte little_breakpoint[] = { 0x08, 0x00, 0xe0, 0x7f }; -typedef BP_MANIPULATION_ENDIAN (little_breakpoint, big_breakpoint) - rs6000_breakpoint; +using rs6000_breakpoint + = BP_MANIPULATION_ENDIAN (little_breakpoint, big_breakpoint); /* Instruction masks for displaced stepping. */ #define OP_MASK 0xfc000000 diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index e9dc48208bb..8151f7e3a56 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -133,53 +133,53 @@ static int sol_thread_active = 0; /* Types of the libthread_db functions. */ using td_log_ftype = void (const int on_off); -typedef td_err_e (td_ta_new_ftype)(const struct ps_prochandle *ph_p, - td_thragent_t **ta_pp); +using td_ta_new_ftype = td_err_e (const struct ps_prochandle *ph_p, + td_thragent_t **ta_pp); using td_ta_delete_ftype = td_err_e (td_thragent_t *ta_p); using td_init_ftype = td_err_e (void); -typedef td_err_e (td_ta_get_ph_ftype)(const td_thragent_t *ta_p, - struct ps_prochandle **ph_pp); -typedef td_err_e (td_ta_get_nthreads_ftype)(const td_thragent_t *ta_p, - int *nthread_p); -typedef td_err_e (td_ta_tsd_iter_ftype)(const td_thragent_t *ta_p, - td_key_iter_f *cb, void *cbdata_p); -typedef td_err_e (td_ta_thr_iter_ftype)(const td_thragent_t *ta_p, - td_thr_iter_f *cb, void *cbdata_p, - td_thr_state_e state, int ti_pri, - sigset_t *ti_sigmask_p, - unsigned ti_user_flags); +using td_ta_get_ph_ftype = td_err_e (const td_thragent_t *ta_p, + struct ps_prochandle **ph_pp); +using td_ta_get_nthreads_ftype = td_err_e (const td_thragent_t *ta_p, + int *nthread_p); +using td_ta_tsd_iter_ftype = td_err_e (const td_thragent_t *ta_p, + td_key_iter_f *cb, void *cbdata_p); +using td_ta_thr_iter_ftype = td_err_e (const td_thragent_t *ta_p, + td_thr_iter_f *cb, void *cbdata_p, + td_thr_state_e state, int ti_pri, + sigset_t *ti_sigmask_p, + unsigned ti_user_flags); using td_thr_validate_ftype = td_err_e (const td_thrhandle_t *th_p); -typedef td_err_e (td_thr_tsd_ftype)(const td_thrhandle_t * th_p, - const thread_key_t key, void **data_pp); -typedef td_err_e (td_thr_get_info_ftype)(const td_thrhandle_t *th_p, - td_thrinfo_t *ti_p); -typedef td_err_e (td_thr_getfpregs_ftype)(const td_thrhandle_t *th_p, - prfpregset_t *fpregset); -typedef td_err_e (td_thr_getxregsize_ftype)(const td_thrhandle_t *th_p, - int *xregsize); -typedef td_err_e (td_thr_getxregs_ftype)(const td_thrhandle_t *th_p, - const caddr_t xregset); -typedef td_err_e (td_thr_sigsetmask_ftype)(const td_thrhandle_t *th_p, - const sigset_t ti_sigmask); -typedef td_err_e (td_thr_setprio_ftype)(const td_thrhandle_t *th_p, - const int ti_pri); -typedef td_err_e (td_thr_setsigpending_ftype)(const td_thrhandle_t *th_p, - const uchar_t ti_pending_flag, - const sigset_t ti_pending); -typedef td_err_e (td_thr_setfpregs_ftype)(const td_thrhandle_t *th_p, - const prfpregset_t *fpregset); -typedef td_err_e (td_thr_setxregs_ftype)(const td_thrhandle_t *th_p, - const caddr_t xregset); -typedef td_err_e (td_ta_map_id2thr_ftype)(const td_thragent_t *ta_p, - thread_t tid, +using td_thr_tsd_ftype = td_err_e (const td_thrhandle_t * th_p, + const thread_key_t key, void **data_pp); +using td_thr_get_info_ftype = td_err_e (const td_thrhandle_t *th_p, + td_thrinfo_t *ti_p); +using td_thr_getfpregs_ftype = td_err_e (const td_thrhandle_t *th_p, + prfpregset_t *fpregset); +using td_thr_getxregsize_ftype = td_err_e (const td_thrhandle_t *th_p, + int *xregsize); +using td_thr_getxregs_ftype = td_err_e (const td_thrhandle_t *th_p, + const caddr_t xregset); +using td_thr_sigsetmask_ftype = td_err_e (const td_thrhandle_t *th_p, + const sigset_t ti_sigmask); +using td_thr_setprio_ftype = td_err_e (const td_thrhandle_t *th_p, + const int ti_pri); +using td_thr_setsigpending_ftype + = td_err_e (const td_thrhandle_t *th_p, const uchar_t ti_pending_flag, + const sigset_t ti_pending); +using td_thr_setfpregs_ftype = td_err_e (const td_thrhandle_t *th_p, + const prfpregset_t *fpregset); +using td_thr_setxregs_ftype = td_err_e (const td_thrhandle_t *th_p, + const caddr_t xregset); +using td_ta_map_id2thr_ftype = td_err_e (const td_thragent_t *ta_p, + thread_t tid, + td_thrhandle_t *th_p); +using td_ta_map_lwp2thr_ftype = td_err_e (const td_thragent_t *ta_p, + lwpid_t lwpid, td_thrhandle_t *th_p); -typedef td_err_e (td_ta_map_lwp2thr_ftype)(const td_thragent_t *ta_p, - lwpid_t lwpid, - td_thrhandle_t *th_p); -typedef td_err_e (td_thr_getgregs_ftype)(const td_thrhandle_t *th_p, - prgregset_t regset); -typedef td_err_e (td_thr_setgregs_ftype)(const td_thrhandle_t *th_p, - const prgregset_t regset); +using td_thr_getgregs_ftype = td_err_e (const td_thrhandle_t *th_p, + prgregset_t regset); +using td_thr_setgregs_ftype = td_err_e (const td_thrhandle_t *th_p, + const prgregset_t regset); /* Pointers to routines from libthread_db resolved by dlopen(). */ diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c index d28cee8168c..986ff38c586 100644 --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -429,7 +429,7 @@ stap_get_opcode (const char **s) return op; } -typedef expr::operation_up binop_maker_ftype (expr::operation_up &&, +using binop_maker_ftype = expr::operation_up (expr::operation_up &&, expr::operation_up &&); /* Map from an expression opcode to a function that can create a binary operation of that type. */ diff --git a/gdb/svr4-tls-tdep.h b/gdb/svr4-tls-tdep.h index 6c747218fc2..50a964b8f0e 100644 --- a/gdb/svr4-tls-tdep.h +++ b/gdb/svr4-tls-tdep.h @@ -31,15 +31,15 @@ enum svr4_tls_libc /* Function type for "get_tls_dtv_addr" method. */ -typedef CORE_ADDR (get_tls_dtv_addr_ftype) (struct gdbarch *gdbarch, - ptid_t ptid, - enum svr4_tls_libc libc); +using get_tls_dtv_addr_ftype = CORE_ADDR (struct gdbarch *gdbarch, + ptid_t ptid, + enum svr4_tls_libc libc); /* Function type for "get_tls_dtp_offset" method. */ -typedef CORE_ADDR (get_tls_dtp_offset_ftype) (struct gdbarch *gdbarch, - ptid_t ptid, - enum svr4_tls_libc libc); +using get_tls_dtp_offset_ftype = CORE_ADDR (struct gdbarch *gdbarch, + ptid_t ptid, + enum svr4_tls_libc libc); /* Register architecture specific methods for fetching the TLS DTV and TLS DTP, used by linux_get_thread_local_address. */ diff --git a/gdb/symtab.h b/gdb/symtab.h index b29b72aba00..a181e3175f2 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -391,10 +391,9 @@ class lookup_name_info final LOOKUP_NAME. E.g., in C++, in linespec/wild mode, if the symbol is "foo::function()" and LOOKUP_NAME is "function(", MATCH_FOR_LCD points to "function()" inside SYMBOL_SEARCH_NAME. */ -typedef bool (symbol_name_matcher_ftype) - (const char *symbol_search_name, - const lookup_name_info &lookup_name, - completion_match_result *comp_match_res); +using symbol_name_matcher_ftype + = bool (const char *symbol_search_name, const lookup_name_info &lookup_name, + completion_match_result *comp_match_res); /* Some of the structures in this file are space critical. The space-critical structures are: diff --git a/gdb/target.h b/gdb/target.h index 34f5e817635..6d1c21f29f6 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -237,9 +237,8 @@ enum target_xfer_status extern const char * target_xfer_status_to_string (enum target_xfer_status status); -typedef enum target_xfer_status - target_xfer_partial_ftype (struct target_ops *ops, - enum target_object object, +using target_xfer_partial_ftype + = enum target_xfer_status (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, diff --git a/gdb/xml-support.h b/gdb/xml-support.h index 95e21499345..a15b60689c0 100644 --- a/gdb/xml-support.h +++ b/gdb/xml-support.h @@ -152,9 +152,9 @@ using gdb_xml_element_start_handler is any accumulated body text inside the element, with leading and trailing whitespace removed. It will never be NULL. */ -typedef void (gdb_xml_element_end_handler) - (struct gdb_xml_parser *, const struct gdb_xml_element *, - void *user_data, const char *body_text); +using gdb_xml_element_end_handler + = void (struct gdb_xml_parser *, const struct gdb_xml_element *, + void *user_data, const char *body_text); /* An expected element and the handlers to call when it is encountered. Arrays of struct gdb_xml_element are terminated diff --git a/gdbserver/server.cc b/gdbserver/server.cc index baccdf00172..ba172b2f332 100644 --- a/gdbserver/server.cc +++ b/gdbserver/server.cc @@ -3129,8 +3129,8 @@ static void gdb_wants_all_threads_stopped (void); static void resume (struct thread_resume *actions, size_t n); /* The callback that is passed to visit_actioned_threads. */ -typedef int (visit_actioned_threads_callback_ftype) - (const struct thread_resume *, thread_info *); +using visit_actioned_threads_callback_ftype + = int (const struct thread_resume *, thread_info *); /* Call CALLBACK for any thread to which ACTIONS applies to. Returns true if CALLBACK returns true. Returns false if no matching thread -- 2.51.0