[binutils-gdb] [gdb] Use using instead of typedef some more (part 2)
Tom de Vries via Gdb-cvs <[email protected]> Mon, 13 Jul 2026 13:06:53 +0000 (GMT)
| Newsgroups | gmane.comp.gdb.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dbc7e910e10f8= d5072848344140f15a8bab89f069 commit bc7e910e10f8d5072848344140f15a8bab89f069 Author: Tom de Vries <[email protected]> Date: Mon Jul 13 15:06:35 2026 +0200 [gdb] Use using instead of typedef some more (part 2) =20 Result of: ... $ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \ | egrep -v /testsuite/ \ | xargs sed -i \ '/WINAPI/b l;s/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.()\* ]*\) \= ([a-zA-Z_0-9]*\) \((.*)\);/\1using \3 =3D \2 \4;/;:l' $ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \ | egrep -v /testsuite/ \ | xargs sed -i \ '/WINAPI/b l;s/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.()\* ]*\) (= \([a-zA-Z_0-9]*\)) \((.*)\);/\1using \3 =3D \2 \4;/;:l' $ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \ | egrep -v /testsuite/ \ | xargs sed -i \ '/WINAPI/b l;s/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.()\* ]*\) (= \([a-zA-Z_0-9]*\))\((.*)\);/\1using \3 =3D \2 \4;/;:l' $ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \ | egrep -v /testsuite/ \ | xargs sed -i \ '/WINAPI/b l;s/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.()\* ]*\) (= \*\([a-zA-Z_0-9]*\)) \((.*)\);/\1using \3 =3D \2 (*) \4;/;:l' ... and fixing up this incorrect rewrite: ... -typedef int td_key_iter_f (thread_key_t, void (*) (void *), void *); +using void =3D int td_key_iter_f (thread_key_t, (*) (void *), void *); ... =20 Approved-By: Tom Tromey <[email protected]> Diff: --- gdb/ada-lang.c | 2 +- gdb/arm-tdep.c | 2 +- gdb/async-event.h | 4 ++-- gdb/cli/cli-option.h | 2 +- gdb/command.h | 2 +- gdb/completer.c | 2 +- gdb/completer.h | 12 ++++++------ gdb/cp-support.h | 2 +- gdb/dcache.c | 2 +- gdb/dummy-frame.h | 2 +- gdb/event-top.h | 4 ++-- gdb/fbsd-nat.c | 2 +- gdb/frame-base.h | 2 +- gdb/gdbarch.h | 6 +++--- gdb/gnu-nat.h | 2 +- gdb/guile/guile-internal.h | 4 ++-- gdb/ia64-libunwind-tdep.c | 8 ++++---- gdb/inferior.h | 2 +- gdb/jit.c | 2 +- gdb/language.h | 2 +- gdb/main.c | 2 +- gdb/nat/gdb_thread_db.h | 8 ++++---- gdb/nat/glibc_thread_db.h | 4 ++-- gdb/nat/linux-procfs.h | 2 +- gdb/registry.h | 2 +- gdb/remote.c | 2 +- gdb/selftest-arch.h | 2 +- gdb/ser-go32.c | 2 +- gdb/serial.h | 2 +- gdb/sol-thread.c | 8 ++++---- gdb/stubs/sh-stub.c | 2 +- gdb/target.h | 2 +- gdb/unittests/function-view-selftests.c | 2 +- gdb/windows-nat.h | 2 +- gdbserver/linux-low.h | 4 ++-- gdbserver/tracepoint.cc | 8 ++++---- gdbsupport/event-loop.h | 4 ++-- gdbsupport/search.h | 2 +- 38 files changed, 63 insertions(+), 63 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 35ebd924021..42fdd97f12f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -11641,7 +11641,7 @@ static const char * const standard_exc[] =3D { "tasking_error" }; =20 -typedef CORE_ADDR (ada_unhandled_exception_name_addr_ftype) (void); +using ada_unhandled_exception_name_addr_ftype =3D CORE_ADDR (void); =20 /* A structure that describes how to support exception catchpoints for a given executable. */ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index db423c60b09..c51074c89ff 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -14537,7 +14537,7 @@ class instruction_reader : public abstract_instruct= ion_reader =20 } // namespace =20 -typedef int (*sti_arm_hdl_fp_t) (arm_insn_decode_record*); +using sti_arm_hdl_fp_t =3D int (*) (arm_insn_decode_record*); =20 /* Decode arm/thumb insn depending on condition cods and opcodes; and dispatch it. */ diff --git a/gdb/async-event.h b/gdb/async-event.h index 5b75f8b215c..0cc0e1fefb7 100644 --- a/gdb/async-event.h +++ b/gdb/async-event.h @@ -23,7 +23,7 @@ =20 struct async_signal_handler; struct async_event_handler; -typedef void (sig_handler_func) (gdb_client_data); +using sig_handler_func =3D void (gdb_client_data); =20 /* Type of async event handler callbacks. =20 @@ -33,7 +33,7 @@ typedef void (sig_handler_func) (gdb_client_data); is responsible for clearing the async event handler if it no longer nee= ds to be called. */ =20 -typedef void (async_event_handler_func) (gdb_client_data); +using async_event_handler_func =3D void (gdb_client_data); =20 extern struct async_signal_handler * create_async_signal_handler (sig_handler_func *proc, diff --git a/gdb/cli/cli-option.h b/gdb/cli/cli-option.h index 3e2fd4ec933..b3c051253b0 100644 --- a/gdb/cli/cli-option.h +++ b/gdb/cli/cli-option.h @@ -39,7 +39,7 @@ struct option_def /* The ctor is protected because you're supposed to construct using one of bool_option_def, etc. below. */ protected: - typedef void *(erased_get_var_address_ftype) (); + using erased_get_var_address_ftype =3D void * (); =20 /* Construct an option. NAME_ is the option's name. VAR_TYPE_ defines the option's type. ERASED_GET_VAR_ADDRESS_ is a pointer diff --git a/gdb/command.h b/gdb/command.h index 56a4e46b2f3..36287d657f9 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -396,7 +396,7 @@ struct cmd_list_element; /* The "simple" signature of command callbacks, which doesn't include a cmd_list_element parameter. */ =20 -typedef void cmd_simple_func_ftype (const char *args, int from_tty); +using cmd_simple_func_ftype =3D void (const char *args, int from_tty); =20 /* This structure specifies notifications to be suppressed by a cli command interpreter. */ diff --git a/gdb/completer.c b/gdb/completer.c index 0925891379a..09b1c8054d3 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -3271,7 +3271,7 @@ extern int _rl_completion_prefix_display_length; extern int _rl_print_completions_horizontally; =20 extern "C" int _rl_qsort_string_compare (const void *, const void *); -typedef int QSFUNC (const void *, const void *); +using QSFUNC =3D int (const void *, const void *); =20 /* GDB version of readline/complete.c:rl_display_match_list. See gdb_display_match_list for a description of MATCHES, LEN, MAX. diff --git a/gdb/completer.h b/gdb/completer.h index df247039c76..c84ce3ec28a 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -24,14 +24,14 @@ =20 struct match_list_displayer; =20 -typedef void mld_crlf_ftype (const struct match_list_displayer *); -typedef void mld_putch_ftype (const struct match_list_displayer *, int); +using mld_crlf_ftype =3D void (const struct match_list_displayer *); +using mld_putch_ftype =3D void (const struct match_list_displayer *, int); typedef void mld_puts_ftype (const struct match_list_displayer *, const char *); -typedef void mld_flush_ftype (const struct match_list_displayer *); -typedef void mld_erase_entire_line_ftype (const struct match_list_displaye= r *); -typedef void mld_beep_ftype (const struct match_list_displayer *); -typedef int mld_read_key_ftype (const struct match_list_displayer *); +using mld_flush_ftype =3D void (const struct match_list_displayer *); +using mld_erase_entire_line_ftype =3D void (const struct match_list_displa= yer *); +using mld_beep_ftype =3D void (const struct match_list_displayer *); +using mld_read_key_ftype =3D int (const struct match_list_displayer *); =20 /* Interface between CLI/TUI and gdb_match_list_displayer. */ =20 diff --git a/gdb/cp-support.h b/gdb/cp-support.h index fb41a3c15b2..2bd3430a7a8 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -81,7 +81,7 @@ extern gdb::unique_xmalloc_ptr<char> cp_canonicalize_stri= ng extern gdb::unique_xmalloc_ptr<char> cp_canonicalize_string_no_typedefs (const char *string); =20 -typedef const char *(canonicalization_ftype) (struct type *, void *); +using canonicalization_ftype =3D const char * (struct type *, void *); =20 extern gdb::unique_xmalloc_ptr<char> cp_canonicalize_string_full (const char *string, canonicalization_ftype *finder, void *data); diff --git a/gdb/dcache.c b/gdb/dcache.c index a85b1bf9b12..9c80bb47461 100644 --- a/gdb/dcache.c +++ b/gdb/dcache.c @@ -121,7 +121,7 @@ struct dcache_struct process_stratum_target *proc_target; }; =20 -typedef void (block_func) (struct dcache_block *block, void *param); +using block_func =3D void (struct dcache_block *block, void *param); =20 static struct dcache_block *dcache_hit (DCACHE *dcache, CORE_ADDR addr); =20 diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h index 0f71141786c..7ac12466580 100644 --- a/gdb/dummy-frame.h +++ b/gdb/dummy-frame.h @@ -58,7 +58,7 @@ extern const struct frame_unwind_legacy dummy_frame_unwin= d; =20 /* Destructor for dummy_frame. DATA is supplied by registrant. REGISTERS_VALID is 1 for dummy_frame_pop, 0 for dummy_frame_discard. */ -typedef void (dummy_frame_dtor_ftype) (void *data, int registers_valid); +using dummy_frame_dtor_ftype =3D void (void *data, int registers_valid); =20 /* Call DTOR with DTOR_DATA when DUMMY_ID frame of thread THREAD gets discarded. Dummy frame with DUMMY_ID must exist. Multiple diff --git a/gdb/event-top.h b/gdb/event-top.h index a7d31d56a5d..4b377f8780e 100644 --- a/gdb/event-top.h +++ b/gdb/event-top.h @@ -37,7 +37,7 @@ struct cmd_list_element; still want to intercept the Ctrl-C and offer to disconnect if the user presses Ctrl-C multiple times while the target is stuck waiting for the wedged remote stub. */ -typedef void (quit_handler_ftype) (); +using quit_handler_ftype =3D void (); extern quit_handler_ftype *quit_handler; =20 /* Exported functions from event-top.c. @@ -151,7 +151,7 @@ extern void gdb_rl_callback_handler_reinstall (void); handles the case where readline received EOF. */ extern void gdb_rl_deprep_term_function (void); =20 -typedef void (*segv_handler_t) (int); +using segv_handler_t =3D void (*) (int); =20 /* On construction, replaces the current thread's SIGSEGV handler with the provided one. On destruction, restores the handler to the diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index ecd0df95fc7..cf59ae21efc 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -1925,7 +1925,7 @@ fbsd_nat_target::detach_fork_children (inferior *inf) true to terminate the iteration early. This function returns true if the callback returned true, otherwise it returns false. */ =20 -typedef bool (ptrace_event_ftype) (const struct ptrace_lwpinfo &pl); +using ptrace_event_ftype =3D bool (const struct ptrace_lwpinfo &pl); =20 static bool iterate_other_ptrace_events (pid_t pid, diff --git a/gdb/frame-base.h b/gdb/frame-base.h index 7dcc3a3927d..723d2ba56d3 100644 --- a/gdb/frame-base.h +++ b/gdb/frame-base.h @@ -68,7 +68,7 @@ struct frame_base /* Given THIS frame, return the frame base methods for THIS frame, or NULL if it can't handle THIS frame. */ =20 -typedef const struct frame_base *(frame_base_sniffer_ftype) (const frame_i= nfo_ptr &this_frame); +using frame_base_sniffer_ftype =3D const struct frame_base * (const frame_= info_ptr &this_frame); =20 /* Append a frame base sniffer to the list. The sniffers are polled in the order that they are appended. */ diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 7077f9262e9..1e3270911dc 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -242,9 +242,9 @@ struct gdbarch_info const struct target_desc *target_desc =3D nullptr; }; =20 -typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, st= ruct gdbarch_list *arches); -typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui= _file *file); -typedef bool (gdbarch_supports_arch_info_ftype) (const struct bfd_arch_inf= o *); +using gdbarch_init_ftype =3D struct gdbarch * (struct gdbarch_info info, s= truct gdbarch_list *arches); +using gdbarch_dump_tdep_ftype =3D void (struct gdbarch *gdbarch, struct ui= _file *file); +using gdbarch_supports_arch_info_ftype =3D bool (const struct bfd_arch_inf= o *); =20 extern void gdbarch_register (enum bfd_architecture architecture, gdbarch_init_ftype *init, diff --git a/gdb/gnu-nat.h b/gdb/gnu-nat.h index 2ab06c8078e..93f5931fbfb 100644 --- a/gdb/gnu-nat.h +++ b/gdb/gnu-nat.h @@ -42,7 +42,7 @@ extern struct inf *gnu_current_inf; /* Converts a GDB pid to a struct proc. */ struct proc *inf_tid_to_thread (struct inf *inf, int tid); =20 -typedef void (inf_threads_ftype) (struct proc *thread, void *arg); +using inf_threads_ftype =3D void (struct proc *thread, void *arg); =20 /* Call F for every thread in inferior INF, passing ARG as second paramete= r. */ void inf_threads (struct inf *inf, inf_threads_ftype *f, void *arg); diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h index a86ad48eb12..20709e6a1d1 100644 --- a/gdb/guile/guile-internal.h +++ b/gdb/guile/guile-internal.h @@ -51,7 +51,7 @@ struct symbol; =20 /* A function to pass to the safe-call routines to ignore things like memory errors. */ -typedef int excp_matcher_func (SCM key); +using excp_matcher_func =3D int (SCM key); =20 /* Scheme variables to define during initialization. */ =20 @@ -278,7 +278,7 @@ struct objfile; =20 /* A predicate that returns non-zero if an object is a particular kind of gsmob. */ -typedef int (gsmob_pred_func) (SCM); +using gsmob_pred_func =3D int (SCM); =20 extern scm_t_bits gdbscm_make_smob_type (const char *name, size_t size); =20 diff --git a/gdb/ia64-libunwind-tdep.c b/gdb/ia64-libunwind-tdep.c index 52902dc17f2..d62ff195ff1 100644 --- a/gdb/ia64-libunwind-tdep.c +++ b/gdb/ia64-libunwind-tdep.c @@ -58,7 +58,7 @@ static int libunwind_initialized; static const registry<gdbarch>::key<libunwind_descr> libunwind_descr_handl= e; =20 /* Required function pointers from libunwind. */ -typedef int (unw_get_reg_p_ftype) (unw_cursor_t *, unw_regnum_t, unw_word_= t *); +using unw_get_reg_p_ftype =3D 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 *); @@ -66,9 +66,9 @@ 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 *); static unw_get_saveloc_p_ftype *unw_get_saveloc_p; -typedef int (unw_is_signal_frame_p_ftype) (unw_cursor_t *); +using unw_is_signal_frame_p_ftype =3D int (unw_cursor_t *); static unw_is_signal_frame_p_ftype *unw_is_signal_frame_p; -typedef int (unw_step_p_ftype) (unw_cursor_t *); +using unw_step_p_ftype =3D 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 *); @@ -76,7 +76,7 @@ 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); static unw_create_addr_space_p_ftype *unw_create_addr_space_p; -typedef void (unw_destroy_addr_space_p_ftype) (unw_addr_space_t); +using unw_destroy_addr_space_p_ftype =3D 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 *, diff --git a/gdb/inferior.h b/gdb/inferior.h index 9c031035a23..11f5b25ec26 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -173,7 +173,7 @@ extern tribool sharing_input_terminal (int pid); =20 /* The type of the function that is called when SIGINT is handled. */ =20 -typedef void c_c_handler_ftype (int); +using c_c_handler_ftype =3D void (int); =20 /* Install a new SIGINT handler in a host-dependent way. The previous handler is returned. It is fine to pass SIG_IGN for FN, but not diff --git a/gdb/jit.c b/gdb/jit.c index 251e8331c4a..c0aeb41e5aa 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -142,7 +142,7 @@ struct jit_reader =20 static struct jit_reader *loaded_jit_reader =3D NULL; =20 -typedef struct gdb_reader_funcs * (reader_init_fn_type) (void); +using reader_init_fn_type =3D struct gdb_reader_funcs * (void); static const char reader_init_fn_sym[] =3D "gdb_init_reader"; =20 /* Try to load FILE_NAME as a JIT debug info reader. */ diff --git a/gdb/language.h b/gdb/language.h index 75154d9c591..62827ffe02c 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -764,7 +764,7 @@ extern void language_info (); =20 extern void set_language (enum language lang); =20 -typedef void lazily_set_language_ftype (); +using lazily_set_language_ftype =3D void (); extern void lazily_set_language (lazily_set_language_ftype *fun); =0C =20 diff --git a/gdb/main.c b/gdb/main.c index 4a11b6c5f88..f49d5f48c9d 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -492,7 +492,7 @@ handle_command_errors (const struct gdb_exception &e) /* Type of the command callback passed to the const catch_command_errors. */ =20 -typedef void (catch_command_errors_const_ftype) (const char *, int); +using catch_command_errors_const_ftype =3D void (const char *, int); =20 /* Wrap calls to commands run before the event loop is started. */ =20 diff --git a/gdb/nat/gdb_thread_db.h b/gdb/nat/gdb_thread_db.h index 94dd69f373a..c40c1a407a0 100644 --- a/gdb/nat/gdb_thread_db.h +++ b/gdb/nat/gdb_thread_db.h @@ -37,11 +37,11 @@ =20 /* Types of the libthread_db functions. */ =20 -typedef td_err_e (td_init_ftype) (void); +using td_init_ftype =3D td_err_e (void); =20 typedef td_err_e (td_ta_new_ftype) (struct ps_prochandle * ps, td_thragent_t **ta); -typedef td_err_e (td_ta_delete_ftype) (td_thragent_t *ta_p); +using td_ta_delete_ftype =3D 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, @@ -70,7 +70,7 @@ typedef td_err_e (td_thr_tlsbase_ftype) (const td_thrhand= le_t *th, unsigned long int modid, psaddr_t *base); =20 -typedef const char ** (td_symbol_list_ftype) (void); -typedef td_err_e (td_ta_delete_ftype) (td_thragent_t *); +using td_symbol_list_ftype =3D const char ** (void); +using td_ta_delete_ftype =3D td_err_e (td_thragent_t *); =20 #endif /* GDB_NAT_GDB_THREAD_DB_H */ diff --git a/gdb/nat/glibc_thread_db.h b/gdb/nat/glibc_thread_db.h index 4e23de5641d..fc5e7db12da 100644 --- a/gdb/nat/glibc_thread_db.h +++ b/gdb/nat/glibc_thread_db.h @@ -244,10 +244,10 @@ using thread_key_t =3D pthread_key_t; =20 =20 /* Callback for iteration over threads. */ -typedef int td_thr_iter_f (const td_thrhandle_t *, void *); +using td_thr_iter_f =3D int (const td_thrhandle_t *, void *); =20 /* Callback for iteration over thread local data. */ -typedef int td_key_iter_f (thread_key_t, void (*) (void *), void *); +using td_key_iter_f =3D int (thread_key_t, void (*) (void *), void *); =20 =20 =20 diff --git a/gdb/nat/linux-procfs.h b/gdb/nat/linux-procfs.h index 3b1d58249f6..70d50eb7271 100644 --- a/gdb/nat/linux-procfs.h +++ b/gdb/nat/linux-procfs.h @@ -75,7 +75,7 @@ extern const char *linux_proc_tid_get_name (ptid_t ptid); /* Callback function for linux_proc_attach_tgid_threads. If the PTID thread is not yet known, try to attach to it and return true, otherwise return false. */ -typedef int (*linux_proc_attach_lwp_func) (ptid_t ptid); +using linux_proc_attach_lwp_func =3D int (*) (ptid_t ptid); =20 /* If PID is a tgid, scan the /proc/PID/task/ directory for existing threads, and call FUNC for each thread found. */ diff --git a/gdb/registry.h b/gdb/registry.h index d76d3a80be8..4f7d14b0fff 100644 --- a/gdb/registry.h +++ b/gdb/registry.h @@ -199,7 +199,7 @@ public: private: =20 /* Registry callbacks have this type. */ - typedef void (*registry_data_callback) (void *); + using registry_data_callback =3D void (*) (void *); =20 /* Get a new key for this particular registry. FREE is a callback. When the container object is destroyed, all FREE functions are diff --git a/gdb/remote.c b/gdb/remote.c index d66c15186ec..194c4cbd9bb 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -103,7 +103,7 @@ using threadref =3D unsigned char[OPAQUETHREADBYTES]; =20 struct gdb_ext_thread_info; struct threads_listing_context; -typedef int (*rmt_thread_action) (threadref *ref, void *context); +using rmt_thread_action =3D int (*) (threadref *ref, void *context); struct protocol_feature; struct packet_reg; =20 diff --git a/gdb/selftest-arch.h b/gdb/selftest-arch.h index 2e589bc587b..6e282c6f2f1 100644 --- a/gdb/selftest-arch.h +++ b/gdb/selftest-arch.h @@ -19,7 +19,7 @@ #ifndef GDB_SELFTEST_ARCH_H #define GDB_SELFTEST_ARCH_H =20 -typedef void self_test_foreach_arch_function (struct gdbarch *); +using self_test_foreach_arch_function =3D void (struct gdbarch *); =20 namespace selftests { diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index 85f5cd5fe0d..990aae6b954 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -353,7 +353,7 @@ dos_comisr (int irq) ISR (0) ISR (1) ISR (2) ISR (3) /* OK */ ISR (4) ISR (5) ISR (6) ISR (7) /* OK */ =20 -typedef void (*isr_t) (void); +using isr_t =3D void (*) (void); =20 static isr_t isrs[NINTR] =3D { diff --git a/gdb/serial.h b/gdb/serial.h index 0a87eabfa12..a170f01bc4e 100644 --- a/gdb/serial.h +++ b/gdb/serial.h @@ -214,7 +214,7 @@ extern int serial_is_async_p (struct serial *scb); asynchronous mode. To disable asynchronous mode, register a NULL callback. */ =20 -typedef void (serial_event_ftype) (struct serial *scb, void *context); +using serial_event_ftype =3D void (struct serial *scb, void *context); extern void serial_async (struct serial *scb, serial_event_ftype *handler, void *context); =20 diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index dc693c1854d..e9dc48208bb 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -132,11 +132,11 @@ static int sol_thread_active =3D 0; =20 /* Types of the libthread_db functions. */ =20 -typedef void (td_log_ftype)(const int on_off); +using td_log_ftype =3D void (const int on_off); typedef td_err_e (td_ta_new_ftype)(const struct ps_prochandle *ph_p, td_thragent_t **ta_pp); -typedef td_err_e (td_ta_delete_ftype)(td_thragent_t *ta_p); -typedef td_err_e (td_init_ftype)(void); +using td_ta_delete_ftype =3D td_err_e (td_thragent_t *ta_p); +using td_init_ftype =3D 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, @@ -148,7 +148,7 @@ typedef td_err_e (td_ta_thr_iter_ftype)(const td_thrage= nt_t *ta_p, td_thr_state_e state, int ti_pri, sigset_t *ti_sigmask_p, unsigned ti_user_flags); -typedef td_err_e (td_thr_validate_ftype)(const td_thrhandle_t *th_p); +using td_thr_validate_ftype =3D 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, diff --git a/gdb/stubs/sh-stub.c b/gdb/stubs/sh-stub.c index 3b0667e90e7..88509a85d78 100644 --- a/gdb/stubs/sh-stub.c +++ b/gdb/stubs/sh-stub.c @@ -189,7 +189,7 @@ /* * typedef */ -typedef void (*Function) (); +using Function =3D void (*) (); =20 /* * Forward declarations diff --git a/gdb/target.h b/gdb/target.h index 22653138491..34f5e817635 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -2473,7 +2473,7 @@ int target_verify_memory (const gdb_byte *data, "target TARGET_NAME". The callback routine takes the rest of the parameters from the command, and (if successful) pushes a new target onto the stack. */ -typedef void target_open_ftype (const char *args, int from_tty); +using target_open_ftype =3D void (const char *args, int from_tty); =20 /* Add the target described by INFO to the list of possible targets and add a new command 'target $(INFO->shortname)'. Set COMPLETER diff --git a/gdb/unittests/function-view-selftests.c b/gdb/unittests/functi= on-view-selftests.c index 9671efc0864..7a61465d440 100644 --- a/gdb/unittests/function-view-selftests.c +++ b/gdb/unittests/function-view-selftests.c @@ -213,7 +213,7 @@ test_make_function_view () SELF_CHECK (3 =3D=3D tmpl_func (1, gdb::make_function_view (&make_fv_tes= t_func))); =20 /* Reference to const and non-const function pointers. */ - typedef int (*func_ptr) (int); + using func_ptr =3D int (*) (int); func_ptr ptr =3D make_fv_test_func; const func_ptr cptr =3D make_fv_test_func; SELF_CHECK (3 =3D=3D tmpl_func (1, gdb::make_function_view (ptr))); diff --git a/gdb/windows-nat.h b/gdb/windows-nat.h index cbe5429fd84..3349755022b 100644 --- a/gdb/windows-nat.h +++ b/gdb/windows-nat.h @@ -47,7 +47,7 @@ using windows_nat::windows_thread_info; =20 /* A pointer to a function that should return non-zero iff REGNUM corresponds to one of the segment registers. */ -typedef int (segment_register_p_ftype) (int regnum); +using segment_register_p_ftype =3D int (int regnum); =20 /* Maintain a linked list of "so" information. */ struct windows_solib diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h index 03e11202955..60154240ddd 100644 --- a/gdbserver/linux-low.h +++ b/gdbserver/linux-low.h @@ -36,8 +36,8 @@ #define PTRACE_XFER_TYPE long =20 #ifdef HAVE_LINUX_REGSETS -typedef void (*regset_fill_func) (struct regcache *, void *); -typedef void (*regset_store_func) (struct regcache *, const void *); +using regset_fill_func =3D void (*) (struct regcache *, void *); +using regset_store_func =3D void (*) (struct regcache *, const void *); enum regset_type { GENERAL_REGS, FP_REGS, diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc index 1e1ca8b5e64..4f1a03237c9 100644 --- a/gdbserver/tracepoint.cc +++ b/gdbserver/tracepoint.cc @@ -5420,10 +5420,10 @@ gdb_collect (struct tracepoint *tpoint, unsigned ch= ar *regs) results in returning the actual code pointer, instead of the descriptor pointer. */ =20 -typedef void (*gdb_collect_ptr_type) (struct tracepoint *, unsigned char *= ); -typedef ULONGEST (*get_raw_reg_ptr_type) (const unsigned char *, int); -typedef LONGEST (*get_trace_state_variable_value_ptr_type) (int); -typedef void (*set_trace_state_variable_value_ptr_type) (int, LONGEST); +using gdb_collect_ptr_type =3D void (*) (struct tracepoint *, unsigned cha= r *); +using get_raw_reg_ptr_type =3D ULONGEST (*) (const unsigned char *, int); +using get_trace_state_variable_value_ptr_type =3D LONGEST (*) (int); +using set_trace_state_variable_value_ptr_type =3D void (*) (int, LONGEST); =20 extern "C" { IP_AGENT_EXPORT_VAR gdb_collect_ptr_type gdb_collect_ptr =3D gdb_collect; diff --git a/gdbsupport/event-loop.h b/gdbsupport/event-loop.h index 8c29f63a877..85cae592965 100644 --- a/gdbsupport/event-loop.h +++ b/gdbsupport/event-loop.h @@ -71,8 +71,8 @@ Corollary tasks are the creation and deletion of event sources. */ =20 using gdb_client_data =3D void *; -typedef void (handler_func) (int, gdb_client_data); -typedef void (timer_handler_func) (gdb_client_data); +using handler_func =3D void (int, gdb_client_data); +using timer_handler_func =3D void (gdb_client_data); =20 /* Exported functions from event-loop.c */ =20 diff --git a/gdbsupport/search.h b/gdbsupport/search.h index 88c31992ff5..8321f7c0550 100644 --- a/gdbsupport/search.h +++ b/gdbsupport/search.h @@ -28,7 +28,7 @@ wants to be able to examine trace data when searching, and target_read_memory does not do this. */ =20 -typedef bool target_read_memory_ftype (CORE_ADDR, gdb_byte *, size_t); +using target_read_memory_ftype =3D bool (CORE_ADDR, gdb_byte *, size_t); =20 /* Utility implementation of searching memory. */ extern int simple_search_memory