Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 06/12] [gdb] Convert function typedefs to using
Date: Tue, 16 Jun 2026 08:22:51 +0200	[thread overview]
Message-ID: <20260616062257.3164438-7-tdevries@suse.de> (raw)
In-Reply-To: <20260616062257.3164438-1-tdevries@suse.de>

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<ada_atr_ftype FUNC>
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<enum exp_opcode OP, binary_ftype FUNC>
 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<enum exp_opcode OP, unary_ftype FUNC>
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<exp_opcode OP, binary_kind_ftype FUNC>
@@ -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<exp_opcode OP, ternary_kind_ftype FUNC>
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<gdbarch_tdep_base>;
    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<gdbarch>::key<libunwind_descr> 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


  parent reply	other threads:[~2026-06-16  6:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16  6:22 [PATCH 00/12] [gdb] Use using instead of typedef some more Tom de Vries
2026-06-16  6:22 ` [PATCH 01/12] [gdb] Use using instead of typedef some more (part 1) Tom de Vries
2026-06-26 15:40   ` Tom Tromey
2026-06-16  6:22 ` [PATCH 02/12] [gdb] Use using instead of typedef some more (part 2) Tom de Vries
2026-06-16  6:22 ` [PATCH 03/12] [gdb] Use using instead of typedef some more (part 3) Tom de Vries
2026-06-26 15:49   ` Tom Tromey
2026-06-16  6:22 ` [PATCH 04/12] [gdb] Convert function pointer typedefs to using Tom de Vries
2026-06-16  6:22 ` [PATCH 05/12] [gdb] Convert template " Tom de Vries
2026-06-16  6:22 ` Tom de Vries [this message]
2026-06-16  6:22 ` [PATCH 07/12] [gdb] Fix redundant struct typedefs Tom de Vries
2026-06-16  6:22 ` [PATCH 08/12] [gdb] Convert anonymous " Tom de Vries
2026-06-16  6:22 ` [PATCH 09/12] [gdb] Convert typedef of named struct Tom de Vries
2026-06-26 16:04   ` Tom Tromey
2026-06-16  6:22 ` [PATCH 10/12] [gdb] convert struct pointer typedefs Tom de Vries
2026-06-16  6:22 ` [PATCH 11/12] [gdb] Convert typedef on separate line Tom de Vries
2026-06-16  6:22 ` [PATCH 12/12] [gdb] Use using in compat_x32_clock_t typedef Tom de Vries
2026-06-26 16:05 ` [PATCH 00/12] [gdb] Use using instead of typedef some more Tom Tromey
2026-07-13 13:07   ` 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=20260616062257.3164438-7-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