From 6c85ef111b0430493792cde3b0fd572f1c78e732 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 11 Jun 2026 08:54:34 +0200 Subject: [PATCH] [gdb] Use using instead of typedef After commit 1eed06ae51d ("[gdbsupport] Use using instead of typedef in next_iterator") I wondered if I could do something similar using sed. Result of: ... $ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \ | egrep -v /testsuite/ \ | xargs sed -i \ 's/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.() ]*\) \([\*&][\*&]*\)\([a-zA-Z_0-9]*\);/\1using \4 = \2 \3;/' $ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \ | egrep -v /testsuite/ \ | xargs sed -i \ 's/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.() ]*\) \([a-zA-Z_0-9]*\);/\1using \3 = \2;/' ... Tested on x86_64-linux. --- gdb/aarch64-tdep.c | 2 +- gdb/aarch64-windows-tdep.c | 2 +- gdb/ada-exp.h | 4 ++-- gdb/alpha-tdep.c | 2 +- gdb/arch/xtensa.h | 2 +- gdb/arm-linux-nat.c | 2 +- gdb/arm-tdep.c | 2 +- gdb/avr-tdep.c | 2 +- gdb/ax.h | 2 +- gdb/block.h | 4 ++-- gdb/breakpoint.h | 2 +- gdb/cli/cli-script.h | 4 ++-- gdb/compile/compile-object-load.h | 2 +- gdb/complaints.h | 2 +- gdb/completer.h | 2 +- gdb/config/djgpp/nl_types.h | 2 +- gdb/darwin-nat.h | 2 +- gdb/dcache.h | 2 +- gdb/dictionary.h | 4 ++-- gdb/dwarf2/index-common.h | 2 +- gdb/dwarf2/line-header.h | 4 ++-- gdb/dwarf2/read.c | 2 +- gdb/elfread.c | 2 +- gdb/expop.h | 2 +- gdb/expression.h | 4 ++-- gdb/extension.h | 2 +- gdb/frv-tdep.c | 2 +- gdb/ft32-tdep.c | 2 +- gdb/gdb_bfd.h | 2 +- gdb/gdb_wchar.h | 8 ++++---- gdb/gdbtypes.h | 2 +- gdb/gregset.h | 4 ++-- gdb/h8300-tdep.c | 2 +- gdb/hppa-tdep.c | 2 +- gdb/i386-tdep.c | 2 +- gdb/inferior-iter.h | 12 ++++++------ gdb/linux-nat.c | 2 +- gdb/lm32-tdep.c | 2 +- gdb/location.h | 2 +- gdb/loongarch-tdep.c | 2 +- gdb/m32c-tdep.c | 2 +- gdb/m68hc11-tdep.c | 2 +- gdb/m68k-tdep.c | 2 +- gdb/mep-tdep.c | 2 +- gdb/microblaze-tdep.c | 2 +- gdb/mn10300-tdep.c | 2 +- gdb/moxie-tdep.c | 2 +- gdb/msp430-tdep.c | 2 +- gdb/nat/aarch64-linux-hw-point.h | 2 +- gdb/nat/aarch64-linux.h | 10 +++++----- gdb/nat/amd64-linux-siginfo.c | 26 ++++++++++++------------- gdb/nat/glibc_thread_db.h | 6 +++--- gdb/nat/linux-osdata.c | 4 ++-- gdb/nat/loongarch-linux-hw-point.h | 2 +- gdb/nat/windows-nat.h | 2 +- gdb/nds32-tdep.c | 2 +- gdb/objfiles.h | 18 ++++++++--------- gdb/or1k-tdep.c | 2 +- gdb/proc-utils.h | 2 +- gdb/procfs.c | 2 +- gdb/prologue-value.h | 2 +- gdb/python/py-registers.c | 2 +- gdb/python/python-internal.h | 14 ++++++------- gdb/python/python-limited-api-missing.h | 2 +- gdb/quick-symbol.h | 2 +- gdb/remote-notif.h | 2 +- gdb/remote.c | 4 ++-- gdb/rl78-tdep.c | 2 +- gdb/rx-tdep.c | 2 +- gdb/s12z-tdep.c | 2 +- gdb/s390-tdep.c | 2 +- gdb/ser-go32.c | 2 +- gdb/ser-mingw.c | 2 +- gdb/ser-tcp.c | 2 +- gdb/serial.h | 2 +- gdb/sparc-nat.c | 8 ++++---- gdb/sparc-tdep.c | 2 +- gdb/stubs/z80-stub.c | 4 ++-- gdb/symfile.h | 2 +- gdb/symtab.h | 2 +- gdb/target.h | 6 +++--- gdb/thread-iter.h | 24 +++++++++++------------ gdb/tilegx-tdep.c | 2 +- gdb/tracepoint.h | 2 +- gdb/tui/tui-layout.h | 2 +- gdb/tui/tui-winsource.h | 12 ++++++------ gdb/ui-file.h | 4 ++-- gdb/ui-out.h | 4 ++-- gdb/unittests/packed-selftests.c | 2 +- gdb/utils.h | 2 +- gdb/value.h | 2 +- gdb/varobj.c | 2 +- gdb/vax-tdep.c | 2 +- gdb/windows-nat.h | 12 ++++++------ gdb/xml-syscall.c | 6 +++--- gdb/xstormy16-tdep.c | 2 +- gdbserver/gdbreplay.cc | 2 +- gdbserver/linux-arm-low.cc | 2 +- gdbserver/proc-service.cc | 8 ++++---- gdbserver/remote-utils.cc | 2 +- gdbsupport/buildargv.h | 2 +- gdbsupport/common-types.h | 8 ++++---- gdbsupport/default-init-alloc.h | 6 +++--- gdbsupport/event-loop.h | 2 +- gdbsupport/filestuff.h | 2 +- gdbsupport/format.h | 2 +- gdbsupport/gdb-dlfcn.h | 2 +- gdbsupport/gdb-hashtab.h | 2 +- gdbsupport/gdb_file.h | 2 +- gdbsupport/gdb_proc_service.h | 8 ++++---- gdbsupport/observable.h | 2 +- gdbsupport/safe-iterator.h | 2 +- gdbsupport/scoped_restore.h | 2 +- gdbsupport/tdesc.h | 8 ++++---- gdbsupport/thread-pool.h | 2 +- 115 files changed, 209 insertions(+), 209 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 0cce4072ac7..886e7ce1e7b 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2581,7 +2581,7 @@ aarch64_gdb_print_insn (bfd_vma memaddr, disassemble_info *info) 1101.0100.0010.0000.0000.0000.0000.0000 = 0xd4200000. */ constexpr gdb_byte aarch64_default_breakpoint[] = {0x00, 0x00, 0x20, 0xd4}; -typedef BP_MANIPULATION (aarch64_default_breakpoint) aarch64_breakpoint; +using aarch64_breakpoint = BP_MANIPULATION (aarch64_default_breakpoint); /* Extract from an array REGS containing the (raw) register state a function return value of type TYPE, and copy that, in virtual diff --git a/gdb/aarch64-windows-tdep.c b/gdb/aarch64-windows-tdep.c index e7312d296ae..7932f27b83b 100644 --- a/gdb/aarch64-windows-tdep.c +++ b/gdb/aarch64-windows-tdep.c @@ -27,7 +27,7 @@ and BRK #0xf000 triggers a breakpoint exception in the debugger. */ constexpr gdb_byte aarch64_windows_breakpoint[] = {0x00, 0x00, 0x3e, 0xd4}; -typedef BP_MANIPULATION (aarch64_windows_breakpoint) aarch64_w_breakpoint; +using aarch64_w_breakpoint = BP_MANIPULATION (aarch64_windows_breakpoint); /* gdbarch initialization for Windows on AArch64. */ diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 05124ebdd3e..134f767ae5e 100644 --- a/gdb/ada-exp.h +++ b/gdb/ada-exp.h @@ -627,7 +627,7 @@ protected: }; /* Unique pointer specialization for Ada assignment components. */ -typedef std::unique_ptr ada_component_up; +using ada_component_up = std::unique_ptr; /* An operation that holds a single component. */ class ada_aggregate_operation @@ -760,7 +760,7 @@ protected: }; /* Unique pointer specialization for Ada assignment associations. */ -typedef std::unique_ptr ada_association_up; +using ada_association_up = std::unique_ptr; /* A component that holds a vector of associations and an operation. The operation is re-evaluated for each choice. */ diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 9687c152026..e68d5aee553 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -622,7 +622,7 @@ alpha_return_in_memory_always (struct type *type) constexpr gdb_byte alpha_break_insn[] = { 0x80, 0, 0, 0 }; /* call_pal bpt */ -typedef BP_MANIPULATION (alpha_break_insn) alpha_breakpoint; +using alpha_breakpoint = BP_MANIPULATION (alpha_break_insn); /* This returns the PC of the first insn after the prologue. diff --git a/gdb/arch/xtensa.h b/gdb/arch/xtensa.h index f9190cfbb6b..079a4515fef 100644 --- a/gdb/arch/xtensa.h +++ b/gdb/arch/xtensa.h @@ -23,7 +23,7 @@ /* Xtensa ELF core file register set representation ('.reg' section). Copied from target-side ELF header . */ -typedef uint32_t xtensa_elf_greg_t; +using xtensa_elf_greg_t = uint32_t; typedef struct { diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index b3d4ce1ec37..007d8d74eb6 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -696,7 +696,7 @@ typedef enum } arm_hwbp_type; /* Type describing an ARM Hardware Breakpoint Control register value. */ -typedef unsigned int arm_hwbp_control_t; +using arm_hwbp_control_t = unsigned int; /* Structure used to keep track of hardware break-/watch-points. */ struct arm_linux_hw_breakpoint diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 08cce9dbad8..7f2ddb31a64 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -95,7 +95,7 @@ struct arm_mapping_symbol { return this->value < other.value; } }; -typedef std::vector arm_mapping_symbol_vec; +using arm_mapping_symbol_vec = std::vector; struct arm_per_bfd { diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index f445a2db6ba..72151df7a49 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -922,7 +922,7 @@ avr_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) constexpr gdb_byte avr_break_insn [] = { 0x98, 0x95 }; -typedef BP_MANIPULATION (avr_break_insn) avr_breakpoint; +using avr_breakpoint = BP_MANIPULATION (avr_break_insn); /* Determine, for architecture GDBARCH, how a return value of TYPE should be returned. If it is supposed to be returned in registers, diff --git a/gdb/ax.h b/gdb/ax.h index ccfc7a47d14..8e481886b76 100644 --- a/gdb/ax.h +++ b/gdb/ax.h @@ -144,7 +144,7 @@ struct agent_expr }; /* An agent_expr owning pointer. */ -typedef std::unique_ptr agent_expr_up; +using agent_expr_up = std::unique_ptr; /* The actual values of the various bytecode operations. */ diff --git a/gdb/block.h b/gdb/block.h index cd02006f860..8e87f9b8b23 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -607,8 +607,8 @@ extern struct symbol *block_iterator_next (struct block_iterator *iterator); C++. */ struct block_iterator_wrapper { - typedef block_iterator_wrapper self_type; - typedef struct symbol *value_type; + using self_type = block_iterator_wrapper; + using value_type = struct symbol *; explicit block_iterator_wrapper (const struct block *block, const lookup_name_info *name = nullptr) diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 3e84f1c99ab..7149211a055 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1535,7 +1535,7 @@ struct breakpoint_deleter } }; -typedef std::unique_ptr breakpoint_up; +using breakpoint_up = std::unique_ptr; extern breakpoint_up set_momentary_breakpoint (struct gdbarch *, struct symtab_and_line, struct frame_id, enum bptype); diff --git a/gdb/cli/cli-script.h b/gdb/cli/cli-script.h index 4937ba0456e..e78d7a65a14 100644 --- a/gdb/cli/cli-script.h +++ b/gdb/cli/cli-script.h @@ -65,10 +65,10 @@ struct command_lines_deleter }; /* A reference-counted struct command_line. */ -typedef std::shared_ptr counted_command_line; +using counted_command_line = std::shared_ptr; /* A unique_ptr specialization for command_line. */ -typedef std::unique_ptr command_line_up; +using command_line_up = std::unique_ptr; /* Structure for saved commands lines (for breakpoints, defined commands, etc). */ diff --git a/gdb/compile/compile-object-load.h b/gdb/compile/compile-object-load.h index af4e2db27f1..571a1774bdf 100644 --- a/gdb/compile/compile-object-load.h +++ b/gdb/compile/compile-object-load.h @@ -89,7 +89,7 @@ struct compile_module }; /* A unique pointer for a compile_module. */ -typedef std::unique_ptr compile_module_up; +using compile_module_up = std::unique_ptr; extern compile_module_up compile_object_load (const compile_file_names &fnames, diff --git a/gdb/complaints.h b/gdb/complaints.h index 8f5cf24c1c9..2bcd4074b75 100644 --- a/gdb/complaints.h +++ b/gdb/complaints.h @@ -58,7 +58,7 @@ extern void clear_complaints (); /* Type of collected complaints. */ -typedef gdb::unordered_set complaint_collection; +using complaint_collection = gdb::unordered_set; /* A class that can handle calls to complaint from multiple threads. When this is instantiated, it hooks into the complaint mechanism, diff --git a/gdb/completer.h b/gdb/completer.h index be8f4814158..8e924a1da6e 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -66,7 +66,7 @@ struct match_list_displayer /* A list of completion candidates. Each element is a malloc string, because ownership of the strings is transferred to readline, which calls free on each element. */ -typedef std::vector> completion_list; +using completion_list = std::vector>; /* The result of a successful completion match. When doing symbol comparison, we use the symbol search name for the symbol name match diff --git a/gdb/config/djgpp/nl_types.h b/gdb/config/djgpp/nl_types.h index e24864413c9..69e4395b047 100644 --- a/gdb/config/djgpp/nl_types.h +++ b/gdb/config/djgpp/nl_types.h @@ -20,6 +20,6 @@ #ifndef GDB_CONFIG_DJGPP_NL_TYPES_H #define GDB_CONFIG_DJGPP_NL_TYPES_H -typedef int nl_item; +using nl_item = int; #endif /* GDB_CONFIG_DJGPP_NL_TYPES_H */ diff --git a/gdb/darwin-nat.h b/gdb/darwin-nat.h index 18e9da5ac7c..60c3adf0e67 100644 --- a/gdb/darwin-nat.h +++ b/gdb/darwin-nat.h @@ -72,7 +72,7 @@ struct darwin_thread_info : public private_thread_info /* The last exception received. */ struct darwin_exception_msg event {}; }; -typedef struct darwin_thread_info darwin_thread_t; +using darwin_thread_t = struct darwin_thread_info; /* This needs to be overridden by the platform specific nat code. */ diff --git a/gdb/dcache.h b/gdb/dcache.h index f39ef75c5a7..7085fb975fe 100644 --- a/gdb/dcache.h +++ b/gdb/dcache.h @@ -23,7 +23,7 @@ #include "target.h" -typedef struct dcache_struct DCACHE; +using DCACHE = struct dcache_struct; /* Invalidate DCACHE. */ void dcache_invalidate (DCACHE *dcache); diff --git a/gdb/dictionary.h b/gdb/dictionary.h index d4ed8ae744d..d28d50d3d35 100644 --- a/gdb/dictionary.h +++ b/gdb/dictionary.h @@ -167,8 +167,8 @@ extern int mdict_size (const struct multidictionary *mdict); C++. */ struct mdict_iterator_wrapper { - typedef mdict_iterator_wrapper self_type; - typedef struct symbol *value_type; + using self_type = mdict_iterator_wrapper; + using value_type = struct symbol *; explicit mdict_iterator_wrapper (const struct multidictionary *mdict) : m_sym (mdict_iterator_first (mdict, &m_iter)) diff --git a/gdb/dwarf2/index-common.h b/gdb/dwarf2/index-common.h index 121f7061f16..f2862bbf806 100644 --- a/gdb/dwarf2/index-common.h +++ b/gdb/dwarf2/index-common.h @@ -29,7 +29,7 @@ /* All offsets in the index are of this type. It must be architecture-independent. */ -typedef uint32_t offset_type; +using offset_type = uint32_t; /* The hash function for strings in the mapped index. This is the same as SYMBOL_HASH_NEXT, but we keep a separate copy to maintain control over the diff --git a/gdb/dwarf2/line-header.h b/gdb/dwarf2/line-header.h index 06ce5f0e124..1d09824ff5c 100644 --- a/gdb/dwarf2/line-header.h +++ b/gdb/dwarf2/line-header.h @@ -27,11 +27,11 @@ struct dwarf2_cu; /* dir_index is 1-based in DWARF 4 and before, and is 0-based in DWARF 5 and later. */ -typedef int dir_index; +using dir_index = int; /* file_name_index is 1-based in DWARF 4 and before, and is 0-based in DWARF 5 and later. */ -typedef int file_name_index; +using file_name_index = int; struct line_header; diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 742be7656b1..84b1480dbcb 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -5455,7 +5455,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) The import in the following code: namespace A { - typedef int B; + using B = int; } int main () diff --git a/gdb/elfread.c b/gdb/elfread.c index fd4d045d27a..e3890ae0270 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -78,7 +78,7 @@ struct elfinfo /* Type for per-BFD data. */ -typedef std::vector> elfread_data; +using elfread_data = std::vector>; /* Per-BFD data for probe info. */ diff --git a/gdb/expop.h b/gdb/expop.h index c58a8d7ac37..fb4139d3b33 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -565,7 +565,7 @@ private: /* A floating-point constant. The constant is encoded in the target format. */ -typedef std::array float_data; +using float_data = std::array; /* An operation that holds a floating-point constant of a given type. diff --git a/gdb/expression.h b/gdb/expression.h index 3bba692ae81..ce8abb4380e 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -79,7 +79,7 @@ namespace expr { class operation; -typedef std::unique_ptr operation_up; +using operation_up = std::unique_ptr; /* Base class for an operation. An operation is a single component of an expression. */ @@ -248,7 +248,7 @@ struct expression expr::operation_up op; }; -typedef std::unique_ptr expression_up; +using expression_up = std::unique_ptr; /* When parsing expressions we track the innermost block that was referenced. */ diff --git a/gdb/extension.h b/gdb/extension.h index e351b5b672e..b7bbf2a502d 100644 --- a/gdb/extension.h +++ b/gdb/extension.h @@ -232,7 +232,7 @@ private: const extension_language_defn *m_extlang; }; -typedef std::unique_ptr xmethod_worker_up; +using xmethod_worker_up = std::unique_ptr; /* The interface for gdb's own extension(/scripting) language. */ extern const struct extension_language_defn extension_language_gdb; diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 33a270497f3..2df41557148 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -422,7 +422,7 @@ frv_register_sim_regno (struct gdbarch *gdbarch, int reg) constexpr gdb_byte frv_break_insn[] = {0xc0, 0x70, 0x00, 0x01}; -typedef BP_MANIPULATION (frv_break_insn) frv_breakpoint; +using frv_breakpoint = BP_MANIPULATION (frv_break_insn); /* Define the maximum number of instructions which may be packed into a bundle (VLIW instruction). */ diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c index ba0a0882a0a..45afebb18e9 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -77,7 +77,7 @@ ft32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) constexpr gdb_byte ft32_break_insn[] = { 0x02, 0x00, 0x34, 0x00 }; -typedef BP_MANIPULATION (ft32_break_insn) ft32_breakpoint; +using ft32_breakpoint = BP_MANIPULATION (ft32_break_insn); /* FT32 register names. */ diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h index 09b544b3b26..b1b295f22e0 100644 --- a/gdb/gdb_bfd.h +++ b/gdb/gdb_bfd.h @@ -83,7 +83,7 @@ struct gdb_bfd_ref_policy }; /* A gdb::ref_ptr that has been specialized for BFD objects. */ -typedef gdb::ref_ptr gdb_bfd_ref_ptr; +using gdb_bfd_ref_ptr = gdb::ref_ptr; /* Open a read-only (FOPEN_RB) BFD given arguments like bfd_fopen. If NAME starts with TARGET_SYSROOT_PREFIX then the BFD will be diff --git a/gdb/gdb_wchar.h b/gdb/gdb_wchar.h index 5f51ddc4dcf..8f27f3ba3ce 100644 --- a/gdb/gdb_wchar.h +++ b/gdb/gdb_wchar.h @@ -61,8 +61,8 @@ && (defined (__STDC_ISO_10646__) \ || (defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108)) -typedef wchar_t gdb_wchar_t; -typedef wint_t gdb_wint_t; +using gdb_wchar_t = wchar_t; +using gdb_wint_t = wint_t; #define gdb_wcslen wcslen #define gdb_iswprint iswprint @@ -109,8 +109,8 @@ const char *intermediate_encoding (void); #define PHONY_ICONV #endif -typedef char gdb_wchar_t; -typedef int gdb_wint_t; +using gdb_wchar_t = char; +using gdb_wint_t = int; #define gdb_wcslen strlen #define gdb_iswprint c_isprint diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 97adbe61db8..572bf6d3d6f 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1798,7 +1798,7 @@ struct rank /* Used for ranking a function for overload resolution. */ -typedef std::vector badness_vector; +using badness_vector = std::vector; /* GNAT Ada-specific information for various Ada types. */ diff --git a/gdb/gregset.h b/gdb/gregset.h index 27733e3a23f..a3629e35389 100644 --- a/gdb/gregset.h +++ b/gdb/gregset.h @@ -31,8 +31,8 @@ #define GDB_FPREGSET_T fpregset_t #endif -typedef GDB_GREGSET_T gdb_gregset_t; -typedef GDB_FPREGSET_T gdb_fpregset_t; +using gdb_gregset_t = GDB_GREGSET_T; +using gdb_fpregset_t = GDB_FPREGSET_T; struct regcache; diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 086bf69b0ed..ca9c326d752 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -1228,7 +1228,7 @@ h8300s_dbg_reg_to_regnum (struct gdbarch *gdbarch, int regno) /*static unsigned char breakpoint[] = { 0x7A, 0xFF }; *//* ??? */ constexpr gdb_byte h8300_break_insn[] = { 0x01, 0x80 }; /* Sleep */ -typedef BP_MANIPULATION (h8300_break_insn) h8300_breakpoint; +using h8300_breakpoint = BP_MANIPULATION (h8300_break_insn); static struct gdbarch * h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index a2df05b4d29..8f4e88df318 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -593,7 +593,7 @@ hppa_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) constexpr gdb_byte hppa_break_insn[] = {0x00, 0x01, 0x00, 0x04}; -typedef BP_MANIPULATION (hppa_break_insn) hppa_breakpoint; +using hppa_breakpoint = BP_MANIPULATION (hppa_break_insn); /* Return the name of a register. */ diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index fa935b5fcdb..c21e19d1576 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -515,7 +515,7 @@ static const char *disassembly_flavor = att_flavor; constexpr gdb_byte i386_break_insn[] = { 0xcc }; /* int 3 */ -typedef BP_MANIPULATION (i386_break_insn) i386_breakpoint; +using i386_breakpoint = BP_MANIPULATION (i386_break_insn); /* Displaced instruction handling. */ diff --git a/gdb/inferior-iter.h b/gdb/inferior-iter.h index aa3d0957a1d..b2d3862cc98 100644 --- a/gdb/inferior-iter.h +++ b/gdb/inferior-iter.h @@ -28,12 +28,12 @@ class all_inferiors_iterator { public: - typedef all_inferiors_iterator self_type; - typedef struct inferior *value_type; - typedef struct inferior *&reference; - typedef struct inferior **pointer; - typedef std::forward_iterator_tag iterator_category; - typedef int difference_type; + using self_type = all_inferiors_iterator; + using value_type = struct inferior *; + using reference = struct inferior *&; + using pointer = struct inferior **; + using iterator_category = std::forward_iterator_tag; + using difference_type = int; /* Create an iterator pointing at HEAD. */ all_inferiors_iterator (process_stratum_target *proc_target, diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 868f08e18fb..8840dbe3f75 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -500,7 +500,7 @@ struct lwp_deleter /* A unique_ptr specialisation for lwp_info. */ -typedef std::unique_ptr lwp_info_up; +using lwp_info_up = std::unique_ptr; /* Target hook for follow_fork. */ diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index 77989fe1c7f..2e2ca4d21d3 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -207,7 +207,7 @@ lm32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) /* Create a breakpoint instruction. */ constexpr gdb_byte lm32_break_insn[4] = { OP_RAISE << 2, 0, 0, 2 }; -typedef BP_MANIPULATION (lm32_break_insn) lm32_breakpoint; +using lm32_breakpoint = BP_MANIPULATION (lm32_break_insn); /* Setup registers and stack for faking a call to a function in the diff --git a/gdb/location.h b/gdb/location.h index 6d2f0ce8644..f97a8672a92 100644 --- a/gdb/location.h +++ b/gdb/location.h @@ -68,7 +68,7 @@ enum location_spec_type }; /* A unique pointer for location_spec. */ -typedef std::unique_ptr location_spec_up; +using location_spec_up = std::unique_ptr; /* The base class for all location specs used to resolve actual locations in the inferior. */ diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c index 225b1abb703..999fd6a864d 100644 --- a/gdb/loongarch-tdep.c +++ b/gdb/loongarch-tdep.c @@ -1905,7 +1905,7 @@ loongarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int regnum) } static constexpr gdb_byte loongarch_default_breakpoint[] = {0x05, 0x00, 0x2a, 0x00}; -typedef BP_MANIPULATION (loongarch_default_breakpoint) loongarch_breakpoint; +using loongarch_breakpoint = BP_MANIPULATION (loongarch_default_breakpoint); /* Extract a set of required target features out of ABFD. If ABFD is nullptr then a LOONGARCH_GDBARCH_FEATURES is returned in its default state. */ diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index f9d46c00b9c..a06a601dee3 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -991,7 +991,7 @@ make_regs (struct gdbarch *arch) /* Breakpoints. */ constexpr gdb_byte m32c_break_insn[] = { 0x00 }; /* brk */ -typedef BP_MANIPULATION (m32c_break_insn) m32c_breakpoint; +using m32c_breakpoint = BP_MANIPULATION (m32c_break_insn); /* Prologue analysis. */ diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index a036dc26eb6..9ec8cebd9f4 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -403,7 +403,7 @@ m68hc11_register_name (struct gdbarch *gdbarch, int reg_nr) constexpr gdb_byte m68hc11_break_insn[] = {0x0}; -typedef BP_MANIPULATION (m68hc11_break_insn) m68hc11_breakpoint; +using m68hc11_breakpoint = BP_MANIPULATION (m68hc11_break_insn); /* 68HC11 & 68HC12 prologue analysis. */ diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 72b1a7a5187..c23e3a48f92 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -63,7 +63,7 @@ constexpr gdb_byte m68k_break_insn[] = {0x4e, (0x40 | BPT_VECTOR)}; -typedef BP_MANIPULATION (m68k_break_insn) m68k_breakpoint; +using m68k_breakpoint = BP_MANIPULATION (m68k_break_insn); /* Construct types for ISA-specific registers. */ diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 9f8e8ebca38..954dc07ec51 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -1906,7 +1906,7 @@ mep_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) /* Breakpoints. */ constexpr gdb_byte mep_break_insn[] = { 0x70, 0x32 }; -typedef BP_MANIPULATION (mep_break_insn) mep_breakpoint; +using mep_breakpoint = BP_MANIPULATION (mep_break_insn); /* Frames and frame unwinding. */ diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 352d6c17105..93b81fe6f7c 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -127,7 +127,7 @@ microblaze_fetch_instruction (CORE_ADDR pc) constexpr gdb_byte microblaze_break_insn[] = MICROBLAZE_BREAKPOINT; -typedef BP_MANIPULATION (microblaze_break_insn) microblaze_breakpoint; +using microblaze_breakpoint = BP_MANIPULATION (microblaze_break_insn); /* Allocate and initialize a frame cache. */ diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index ee80bddaeee..5e78d59620c 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -308,7 +308,7 @@ mn10300_register_type (struct gdbarch *gdbarch, int reg) one, so we defined it ourselves. */ constexpr gdb_byte mn10300_break_insn[] = {0xff}; -typedef BP_MANIPULATION (mn10300_break_insn) mn10300_breakpoint; +using mn10300_breakpoint = BP_MANIPULATION (mn10300_break_insn); /* Model the semantics of pushing a register onto the stack. This is a helper function for mn10300_analyze_prologue, below. */ diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index c8a04d21f59..f99ad44df72 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -66,7 +66,7 @@ moxie_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) constexpr gdb_byte moxie_break_insn[] = { 0x35, 0x00 }; -typedef BP_MANIPULATION (moxie_break_insn) moxie_breakpoint; +using moxie_breakpoint = BP_MANIPULATION (moxie_break_insn); /* Moxie register names. */ diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index a1c885497c0..92f548653af 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -281,7 +281,7 @@ msp430_register_sim_regno (struct gdbarch *gdbarch, int regnum) constexpr gdb_byte msp430_break_insn[] = { 0x43, 0x43 }; -typedef BP_MANIPULATION (msp430_break_insn) msp430_breakpoint; +using msp430_breakpoint = BP_MANIPULATION (msp430_break_insn); /* Define a "handle" struct for fetching the next opcode. */ diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h index 3ce8674ab95..814449bd4cb 100644 --- a/gdb/nat/aarch64-linux-hw-point.h +++ b/gdb/nat/aarch64-linux-hw-point.h @@ -56,7 +56,7 @@ ptrace calls to the kernel, i.e. avoid asking the kernel to write to the debug registers with unchanged values. */ -typedef ULONGEST dr_changed_t; +using dr_changed_t = ULONGEST; /* Set each of the lower M bits of X to 1; assert X is wide enough. */ diff --git a/gdb/nat/aarch64-linux.h b/gdb/nat/aarch64-linux.h index bb5381eba3e..5f699e1f351 100644 --- a/gdb/nat/aarch64-linux.h +++ b/gdb/nat/aarch64-linux.h @@ -24,12 +24,12 @@ /* Defines ps_err_e, struct ps_prochandle. */ #include "gdb_proc_service.h" -typedef int compat_int_t; -typedef unsigned int compat_uptr_t; +using compat_int_t = int; +using compat_uptr_t = unsigned int; -typedef int compat_time_t; -typedef int compat_timer_t; -typedef int compat_clock_t; +using compat_time_t = int; +using compat_timer_t = int; +using compat_clock_t = int; struct compat_timeval { diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c index 195e1cd6c21..8f1e4acc47e 100644 --- a/gdb/nat/amd64-linux-siginfo.c +++ b/gdb/nat/amd64-linux-siginfo.c @@ -35,14 +35,14 @@ #ifndef __ILP32__ -typedef int nat_int_t; -typedef unsigned long nat_uptr_t; +using nat_int_t = int; +using nat_uptr_t = unsigned long; -typedef int nat_time_t; -typedef int nat_timer_t; +using nat_time_t = int; +using nat_timer_t = int; /* For native 64-bit, clock_t in _sigchld is 64-bit. */ -typedef long nat_clock_t; +using nat_clock_t = long; union nat_sigval_t { @@ -119,12 +119,12 @@ struct nat_siginfo_t compatible with the siginfo type exported by the 32-bit userspace support. */ -typedef int compat_int_t; -typedef unsigned int compat_uptr_t; +using compat_int_t = int; +using compat_uptr_t = unsigned int; -typedef int compat_time_t; -typedef int compat_timer_t; -typedef int compat_clock_t; +using compat_time_t = int; +using compat_timer_t = int; +using compat_clock_t = int; struct compat_timeval { @@ -203,7 +203,7 @@ struct compat_siginfo_t }; /* For x32, clock_t in _sigchld is 64bit aligned at 4 bytes. */ -typedef long __attribute__ ((__aligned__ (4))) compat_x32_clock_t; +using compat_x32_clock_t = long __attribute__ ((__aligned__ (4))); struct __attribute__ ((__aligned__ (8))) compat_x32_siginfo_t { @@ -299,9 +299,9 @@ struct __attribute__ ((__aligned__ (8))) compat_x32_siginfo_t PTRACE_GETSIGINFO. If gdb is built as a x32 program, we get a x32 siginfo. */ #ifdef __ILP32__ -typedef compat_x32_siginfo_t ptrace_siginfo_t; +using ptrace_siginfo_t = compat_x32_siginfo_t; #else -typedef nat_siginfo_t ptrace_siginfo_t; +using ptrace_siginfo_t = nat_siginfo_t; #endif /* Convert the system provided siginfo into compatible siginfo. */ diff --git a/gdb/nat/glibc_thread_db.h b/gdb/nat/glibc_thread_db.h index 87eb62b3efe..4e23de5641d 100644 --- a/gdb/nat/glibc_thread_db.h +++ b/gdb/nat/glibc_thread_db.h @@ -86,7 +86,7 @@ typedef enum /* Types of the debugging library. */ /* Handle for a process. This type is opaque. */ -typedef struct td_thragent td_thragent_t; +using td_thragent_t = struct td_thragent; /* The actual thread handle type. This is also opaque. */ typedef struct td_thrhandle @@ -239,8 +239,8 @@ typedef struct td_ta_stats /* Since Sun's library is based on Solaris threads we have to define a few types to map them to POSIX threads. */ -typedef pthread_t thread_t; -typedef pthread_key_t thread_key_t; +using thread_t = pthread_t; +using thread_key_t = pthread_key_t; /* Callback for iteration over threads. */ diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c index 248dbab9428..a2cadb43d59 100644 --- a/gdb/nat/linux-osdata.c +++ b/gdb/nat/linux-osdata.c @@ -43,12 +43,12 @@ so that reading pid values embedded in /proc works consistently. */ -typedef long long PID_T; +using PID_T = long long ; /* Define TIME_T to be at least as large as time_t, so that reading time values embedded in /proc works consistently. */ -typedef long long TIME_T; +using TIME_T = long long; #define MAX_PID_T_STRLEN (sizeof ("-9223372036854775808") - 1) diff --git a/gdb/nat/loongarch-linux-hw-point.h b/gdb/nat/loongarch-linux-hw-point.h index 766f62ce0d0..9a3d8877dee 100644 --- a/gdb/nat/loongarch-linux-hw-point.h +++ b/gdb/nat/loongarch-linux-hw-point.h @@ -60,7 +60,7 @@ struct loongarch_user_watch_state { ptrace calls to the kernel, i.e. avoid asking the kernel to write to the debug registers with unchanged values. */ -typedef ULONGEST dr_changed_t; +using dr_changed_t = ULONGEST; /* Set each of the lower M bits of X to 1; assert X is wide enough. */ diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 52378765438..2b239787126 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -485,7 +485,7 @@ extern GenerateConsoleCtrlEvent_ftype *GenerateConsoleCtrlEvent; /* We use a local typedef for this type to avoid depending on Windows 8. */ -typedef void *gdb_lpproc_thread_attribute_list; +using gdb_lpproc_thread_attribute_list = void *; typedef BOOL WINAPI (InitializeProcThreadAttributeList_ftype) (gdb_lpproc_thread_attribute_list lpAttributeList, diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c index 3640b31ec27..820aa9b5913 100644 --- a/gdb/nds32-tdep.c +++ b/gdb/nds32-tdep.c @@ -283,7 +283,7 @@ nds32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) /* The same insn machine code is used for little-endian and big-endian. */ constexpr gdb_byte nds32_break_insn[] = { 0xEA, 0x00 }; -typedef BP_MANIPULATION (nds32_break_insn) nds32_breakpoint; +using nds32_breakpoint = BP_MANIPULATION (nds32_break_insn); /* Implement the "dwarf2_reg_to_regnum" gdbarch method. */ diff --git a/gdb/objfiles.h b/gdb/objfiles.h index c8b989911e5..406ab36b39d 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -151,12 +151,12 @@ extern void print_objfile_statistics (void); struct minimal_symbol_iterator { - typedef minimal_symbol_iterator self_type; - typedef struct minimal_symbol *value_type; - typedef struct minimal_symbol *&reference; - typedef struct minimal_symbol **pointer; - typedef std::forward_iterator_tag iterator_category; - typedef int difference_type; + using self_type = minimal_symbol_iterator; + using value_type = struct minimal_symbol *; + using reference = struct minimal_symbol *&; + using pointer = struct minimal_symbol **; + using iterator_category = std::forward_iterator_tag; + using difference_type = int; explicit minimal_symbol_iterator (struct minimal_symbol *msym) : m_msym (msym) @@ -342,7 +342,7 @@ private: /* A range adapter wrapping separate_debug_iterator. */ -typedef iterator_range separate_debug_range; +using separate_debug_range = iterator_range; /* Sections in an objfile. The section offsets are stored in the OBJFILE. */ @@ -467,7 +467,7 @@ public: /* A range adapter that makes it possible to iterate over all minimal symbols of an objfile. */ - typedef iterator_range msymbols_range; + using msymbols_range = iterator_range; /* Return a range adapter for iterating over all minimal symbols. */ @@ -875,7 +875,7 @@ struct objfile_unlinker /* A unique pointer that holds an objfile. */ -typedef std::unique_ptr scoped_objfile_unlinker; +using scoped_objfile_unlinker = std::unique_ptr; /* Relocation offset applied to the section. */ inline CORE_ADDR diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c index 55efa76234c..32fef65dc37 100644 --- a/gdb/or1k-tdep.c +++ b/gdb/or1k-tdep.c @@ -344,7 +344,7 @@ or1k_return_value (struct gdbarch *gdbarch, struct value *functype, constexpr gdb_byte or1k_break_insn[] = {0x21, 0x00, 0x00, 0x01}; -typedef BP_MANIPULATION (or1k_break_insn) or1k_breakpoint; +using or1k_breakpoint = BP_MANIPULATION (or1k_break_insn); static bool or1k_delay_slot_p (struct gdbarch *gdbarch, CORE_ADDR pc) diff --git a/gdb/proc-utils.h b/gdb/proc-utils.h index ccca9afaefe..9f44e9b0a37 100644 --- a/gdb/proc-utils.h +++ b/gdb/proc-utils.h @@ -115,6 +115,6 @@ extern void procfs_note (const char *, const char *, int); /* Define the type (and more importantly the width) of the control word used to write to the /proc/PID/ctl file. */ -typedef long procfs_ctl_t; +using procfs_ctl_t = long; #endif /* GDB_PROC_UTILS_H */ diff --git a/gdb/procfs.c b/gdb/procfs.c index 25319464bc8..64a71ea2883 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -542,7 +542,7 @@ struct procinfo_deleter } }; -typedef std::unique_ptr procinfo_up; +using procinfo_up = std::unique_ptr; enum { NOKILL, KILL }; diff --git a/gdb/prologue-value.h b/gdb/prologue-value.h index bd8adddac17..87c23de397a 100644 --- a/gdb/prologue-value.h +++ b/gdb/prologue-value.h @@ -149,7 +149,7 @@ struct prologue_value { CORE_ADDR k; }; -typedef struct prologue_value pv_t; +using pv_t = struct prologue_value; /* Return the unknown prologue value --- { pvk_unknown, ?, ? }. */ diff --git a/gdb/python/py-registers.c b/gdb/python/py-registers.c index cc7b09079da..e0180660715 100644 --- a/gdb/python/py-registers.c +++ b/gdb/python/py-registers.c @@ -25,7 +25,7 @@ #include "gdbsupport/unordered_map.h" /* Per-gdbarch data type. */ -typedef std::vector> gdbpy_register_type; +using gdbpy_register_type = std::vector>; /* Token to access per-gdbarch data related to register descriptors. */ static const registry::key diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 0cc5fc4ac06..4ca28bb6957 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -91,11 +91,11 @@ static_assert (PY_VERSION_HEX >= 0x03040000); #define GDB_PY_LL_ARG "L" #define GDB_PY_LLU_ARG "K" #if PY_VERSION_HEX >= 0x03060000 -typedef long long gdb_py_longest; -typedef unsigned long long gdb_py_ulongest; +using gdb_py_longest = long long; +using gdb_py_ulongest = unsigned long long; #else -typedef PY_LONG_LONG gdb_py_longest; -typedef unsigned PY_LONG_LONG gdb_py_ulongest; +using gdb_py_longest = PY_LONG_LONG; +using gdb_py_ulongest = unsigned PY_LONG_LONG; #endif #define gdb_py_long_as_ulongest PyLong_AsUnsignedLongLong #define gdb_py_long_as_long_and_overflow PyLong_AsLongLongAndOverflow @@ -104,8 +104,8 @@ typedef unsigned PY_LONG_LONG gdb_py_ulongest; #define GDB_PY_LL_ARG "l" #define GDB_PY_LLU_ARG "k" -typedef long gdb_py_longest; -typedef unsigned long gdb_py_ulongest; +using gdb_py_longest = long; +using gdb_py_ulongest = unsigned long; #define gdb_py_long_as_ulongest PyLong_AsUnsignedLong #define gdb_py_long_as_long_and_overflow PyLong_AsLongAndOverflow @@ -1047,7 +1047,7 @@ struct Py_buffer_deleter }; /* A unique_ptr specialization for Py_buffer. */ -typedef std::unique_ptr Py_buffer_up; +using Py_buffer_up = std::unique_ptr; /* Parse a register number from PYO_REG_ID and place the register number into *REG_NUM. The register is a register for GDBARCH. diff --git a/gdb/python/python-limited-api-missing.h b/gdb/python/python-limited-api-missing.h index 40359abf337..3ff2b4bf935 100644 --- a/gdb/python/python-limited-api-missing.h +++ b/gdb/python/python-limited-api-missing.h @@ -29,7 +29,7 @@ extern "C" /* Symbols belonging to the configuration API introduced in PEP-741, and required in gdb_PyInitializer. */ -typedef struct PyInitConfig PyInitConfig; +using PyInitConfig = struct PyInitConfig; PyAPI_FUNC(PyInitConfig*) PyInitConfig_Create (void); PyAPI_FUNC(void) PyInitConfig_Free (PyInitConfig *config); diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h index 2d1ca78293d..c548f956df9 100644 --- a/gdb/quick-symbol.h +++ b/gdb/quick-symbol.h @@ -202,6 +202,6 @@ struct quick_symbol_functions } }; -typedef std::unique_ptr quick_symbol_functions_up; +using quick_symbol_functions_up = std::unique_ptr; #endif /* GDB_QUICK_SYMBOL_H */ diff --git a/gdb/remote-notif.h b/gdb/remote-notif.h index c2d37cba59b..cec7db8025b 100644 --- a/gdb/remote-notif.h +++ b/gdb/remote-notif.h @@ -34,7 +34,7 @@ struct notif_event /* A unique pointer holding a notif_event. */ -typedef std::unique_ptr notif_event_up; +using notif_event_up = std::unique_ptr; /* ID of the notif_client. */ diff --git a/gdb/remote.c b/gdb/remote.c index 2961664cf33..5443864ced7 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -108,7 +108,7 @@ struct protocol_feature; struct packet_reg; struct stop_reply; -typedef std::unique_ptr stop_reply_up; +using stop_reply_up = std::unique_ptr; /* Generic configuration support for packets the stub optionally supports. Allows the user to specify the use of the packet as well @@ -3633,7 +3633,7 @@ remote_target::thread_name (struct thread_info *info) /* Right now, the internal structure is int. We want it to be bigger. Plan to fix this. */ -typedef int gdb_threadref; /* Internal GDB thread reference. */ +using gdb_threadref = int; /* Internal GDB thread reference. */ /* gdb_ext_thread_info is an internal GDB data structure which is equivalent to the reply of the remote threadinfo packet. */ diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index 4c938333e06..0de2fceb795 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -799,7 +799,7 @@ rl78_pseudo_register_write (struct gdbarch *gdbarch, 0xff is used when a one byte breakpoint instruction is required. */ constexpr gdb_byte rl78_break_insn[] = { 0xff }; -typedef BP_MANIPULATION (rl78_break_insn) rl78_breakpoint; +using rl78_breakpoint = BP_MANIPULATION (rl78_break_insn); /* Define a "handle" struct for fetching the next opcode. */ diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 96e2c5b1a75..eb974b36b65 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -926,7 +926,7 @@ rx_return_value (struct gdbarch *gdbarch, constexpr gdb_byte rx_break_insn[] = { 0x00 }; -typedef BP_MANIPULATION (rx_break_insn) rx_breakpoint; +using rx_breakpoint = BP_MANIPULATION (rx_break_insn); /* Implement the dwarf_reg_to_regnum" gdbarch method. */ diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c index 6ac0930e5b0..5d9cbe8254c 100644 --- a/gdb/s12z-tdep.c +++ b/gdb/s12z-tdep.c @@ -456,7 +456,7 @@ static const struct frame_unwind_legacy s12z_frame_unwind ( constexpr gdb_byte s12z_break_insn[] = {0x00}; -typedef BP_MANIPULATION (s12z_break_insn) s12z_breakpoint; +using s12z_breakpoint = BP_MANIPULATION (s12z_break_insn); struct s12z_gdbarch_tdep : gdbarch_tdep_base { diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 72ff92055bf..3e364fe371c 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -54,7 +54,7 @@ static std::string s390_disassembler_options; constexpr gdb_byte s390_break_insn[] = { 0x0, 0x1 }; -typedef BP_MANIPULATION (s390_break_insn) s390_breakpoint; +using s390_breakpoint = BP_MANIPULATION (s390_break_insn); /* Types. */ diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index 95801924fa9..85f5cd5fe0d 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -126,7 +126,7 @@ #include #include #include -typedef unsigned long u_long; +using u_long = unsigned long; /* 16550 rx fifo trigger point */ #define FIFO_TRIGGER FIFO_TRIGGER_4 diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c index 91209913ccc..26c162ddf8f 100644 --- a/gdb/ser-mingw.c +++ b/gdb/ser-mingw.c @@ -853,7 +853,7 @@ struct pipe_state_destroyer } }; -typedef std::unique_ptr pipe_state_up; +using pipe_state_up = std::unique_ptr; static void pipe_windows_open (struct serial *scb, const char *name) diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index f70a788e001..c6a864c71e9 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -61,7 +61,7 @@ #include #ifndef HAVE_SOCKLEN_T -typedef int socklen_t; +using socklen_t = int; #endif /* For "set tcp" and "show tcp". */ diff --git a/gdb/serial.h b/gdb/serial.h index ffe52ae064c..0a87eabfa12 100644 --- a/gdb/serial.h +++ b/gdb/serial.h @@ -32,7 +32,7 @@ struct ui_file; /* Terminal state pointer. This is specific to each type of interface. */ -typedef void *serial_ttystate; +using serial_ttystate = void *; struct serial; struct serial_ops; diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index f9bad2851c6..df6725e7930 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -50,11 +50,11 @@ #ifdef HAVE_MACHINE_REG_H #ifdef HAVE_STRUCT_REG -typedef struct reg gregset_t; -typedef struct fpreg fpregset_t; +using gregset_t = struct reg; +using fpregset_t = struct fpreg; #else -typedef struct regs gregset_t; -typedef struct fp_status fpregset_t; +using gregset_t = struct regs; +using fpregset_t = struct fp_status; #endif #endif diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index b16af5953f7..573a9824724 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -743,7 +743,7 @@ sparc32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, location for inserting the breakpoint. */ constexpr gdb_byte sparc_break_insn[] = { 0x91, 0xd0, 0x20, 0x01 }; -typedef BP_MANIPULATION (sparc_break_insn) sparc_breakpoint; +using sparc_breakpoint = BP_MANIPULATION (sparc_break_insn); /* Allocate and initialize a frame cache. */ diff --git a/gdb/stubs/z80-stub.c b/gdb/stubs/z80-stub.c index 71f1554f8aa..08a70e78b80 100644 --- a/gdb/stubs/z80-stub.c +++ b/gdb/stubs/z80-stub.c @@ -239,8 +239,8 @@ extern int DBG_AWATCH(int set, void *addr, unsigned size); # define NULL (void*)0 #endif -typedef unsigned char byte; -typedef unsigned short word; +using byte = unsigned char; +using word = unsigned short; /* CPU state */ #ifdef __SDCC_ez80_adl diff --git a/gdb/symfile.h b/gdb/symfile.h index 62859a1b0c6..770bd291ab1 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -69,7 +69,7 @@ struct other_sections to communicate the section addresses in shared objects to symbol_file_add (). */ -typedef std::vector section_addr_info; +using section_addr_info = std::vector; /* A table listing the load segments in a symfile, and which segment each BFD section belongs to. */ diff --git a/gdb/symtab.h b/gdb/symtab.h index 0a7ad3668b4..b29b72aba00 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2698,7 +2698,7 @@ private: we return a vector of this type. The first item in the pair is the module symbol, and the second item is the symbol for the function or variable we found. */ -typedef std::pair module_symbol_search; +using module_symbol_search = std::pair; /* Searches the symbols to find function and variables symbols (depending on KIND) within Fortran modules. The MODULE_REGEXP matches against the diff --git a/gdb/target.h b/gdb/target.h index 81726849d1e..22653138491 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -63,7 +63,7 @@ struct inferior; /* Define const gdb_byte using one identifier, to make it easy for make-target-delegates.py to parse. */ -typedef const gdb_byte const_gdb_byte; +using const_gdb_byte = const gdb_byte; #include "infrun.h" #include "breakpoint.h" @@ -1425,7 +1425,7 @@ struct target_ops_deleter }; /* A unique pointer for target_ops. */ -typedef std::unique_ptr target_ops_up; +using target_ops_up = std::unique_ptr; /* A policy class to interface gdb::ref_ptr with target_ops. */ @@ -2499,7 +2499,7 @@ struct target_unpusher /* A unique_ptr that unpushes a target on destruction. */ -typedef std::unique_ptr target_unpush_up; +using target_unpush_up = std::unique_ptr; extern void target_pre_inferior (); diff --git a/gdb/thread-iter.h b/gdb/thread-iter.h index 4e7e9ba9634..c649560c0e1 100644 --- a/gdb/thread-iter.h +++ b/gdb/thread-iter.h @@ -34,12 +34,12 @@ using inf_threads_iterator = intrusive_list::iterator; class all_threads_iterator { public: - typedef all_threads_iterator self_type; - typedef struct thread_info value_type; - typedef struct thread_info &reference; - typedef struct thread_info *pointer; - typedef std::forward_iterator_tag iterator_category; - typedef int difference_type; + using self_type = all_threads_iterator; + using value_type = struct thread_info; + using reference = struct thread_info &; + using pointer = struct thread_info *; + using iterator_category = std::forward_iterator_tag; + using difference_type = int; /* Tag type. */ struct begin_t {}; @@ -83,12 +83,12 @@ private: class all_matching_threads_iterator { public: - typedef all_matching_threads_iterator self_type; - typedef struct thread_info value_type; - typedef struct thread_info &reference; - typedef struct thread_info *pointer; - typedef std::forward_iterator_tag iterator_category; - typedef int difference_type; + using self_type = all_matching_threads_iterator; + using value_type = struct thread_info; + using reference = struct thread_info &; + using pointer = struct thread_info *; + using iterator_category = std::forward_iterator_tag; + using difference_type = int; /* Creates an iterator that iterates over all threads that match FILTER_PTID. */ diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c index c9458fd526b..0d1421f8758 100644 --- a/gdb/tilegx-tdep.c +++ b/gdb/tilegx-tdep.c @@ -828,7 +828,7 @@ tilegx_write_pc (struct regcache *regcache, CORE_ADDR pc) constexpr gdb_byte tilegx_break_insn[] = { 0x00, 0x50, 0x48, 0x51, 0xae, 0x44, 0x6a, 0x28 }; -typedef BP_MANIPULATION (tilegx_break_insn) tilegx_breakpoint; +using tilegx_breakpoint = BP_MANIPULATION (tilegx_break_insn); /* Normal frames. */ diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h index 19742c9c235..0aab46e0e47 100644 --- a/gdb/tracepoint.h +++ b/gdb/tracepoint.h @@ -36,7 +36,7 @@ struct traceframe_info std::vector tvars; }; -typedef std::unique_ptr traceframe_info_up; +using traceframe_info_up = std::unique_ptr; /* A trace state variable is a value managed by a target being traced. A trace state variable (or tsv for short) can be accessed diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h index 536174c784d..0d39e0ffa48 100644 --- a/gdb/tui/tui-layout.h +++ b/gdb/tui/tui-layout.h @@ -367,7 +367,7 @@ typedef std::function window_factory; /* The type for a data structure that maps a window name to that window's factory function. */ -typedef gdb::unordered_string_map window_types_map; +using window_types_map = gdb::unordered_string_map; /* Register a new TUI window type. NAME is the name of the window type. FACTORY is a function that can be called to instantiate the diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index d4b25cbf9cd..9f94a453749 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -270,12 +270,12 @@ public: typedef std::vector::iterator inner_iterator; - typedef tui_source_window_iterator self_type; - typedef struct tui_source_window_base *value_type; - typedef struct tui_source_window_base *&reference; - typedef struct tui_source_window_base **pointer; - typedef std::forward_iterator_tag iterator_category; - typedef int difference_type; + using self_type = tui_source_window_iterator; + using value_type = struct tui_source_window_base *; + using reference = struct tui_source_window_base *&; + using pointer = struct tui_source_window_base **; + using iterator_category = std::forward_iterator_tag; + using difference_type = int; explicit tui_source_window_iterator (const inner_iterator &it, const inner_iterator &end) diff --git a/gdb/ui-file.h b/gdb/ui-file.h index 6a1d3964335..76185bbedf0 100644 --- a/gdb/ui-file.h +++ b/gdb/ui-file.h @@ -147,7 +147,7 @@ private: void printchar (int c, int quoter, bool async_safe); }; -typedef std::unique_ptr ui_file_up; +using ui_file_up = std::unique_ptr; /* A ui_file that writes to nowhere. */ @@ -295,7 +295,7 @@ private: bool m_close_p; }; -typedef std::unique_ptr stdio_file_up; +using stdio_file_up = std::unique_ptr; /* Like stdio_file, but specifically for stderr. diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 28af8d521e7..d59e58631e9 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -439,8 +439,8 @@ private: struct ui_out *m_uiout; }; -typedef ui_out_emit_type ui_out_emit_tuple; -typedef ui_out_emit_type ui_out_emit_list; +using ui_out_emit_tuple = ui_out_emit_type; +using ui_out_emit_list = ui_out_emit_type; /* Start a new table on construction, and end the table on destruction. */ diff --git a/gdb/unittests/packed-selftests.c b/gdb/unittests/packed-selftests.c index cef0baaa1d2..c089bf5d7d0 100644 --- a/gdb/unittests/packed-selftests.c +++ b/gdb/unittests/packed-selftests.c @@ -58,7 +58,7 @@ CHECK_TRAIT (is_trivially_move_assignable); static void run_tests () { - typedef packed packed_2; + using packed_2 = packed; packed_2 p1; packed_2 p2 (0x0102); diff --git a/gdb/utils.h b/gdb/utils.h index ecef7d13c20..07d707ce9cf 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -429,7 +429,7 @@ struct warning_hook_handler_type = 0; }; -typedef warning_hook_handler_type *warning_hook_handler; +using warning_hook_handler = warning_hook_handler_type *; /* Set the thread-local warning hook, and restore the old value when finished. */ diff --git a/gdb/value.h b/gdb/value.h index 0267ee804e1..e94c69e49d3 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -121,7 +121,7 @@ struct value_ref_policy /* A gdb:;ref_ptr pointer to a struct value. */ -typedef gdb::ref_ptr value_ref_ptr; +using value_ref_ptr = gdb::ref_ptr; /* Note that the fields in this structure are arranged to save a bit of memory. */ diff --git a/gdb/varobj.c b/gdb/varobj.c index 0cd3ba90a91..a55c2c6dd2b 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -37,7 +37,7 @@ #include "python/python.h" #include "python/python-internal.h" #else -typedef int PyObject; +using PyObject = int; #endif /* See varobj.h. */ diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 48a38df7480..2eddb5a9bab 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -252,7 +252,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, constexpr gdb_byte vax_break_insn[] = { 3 }; -typedef BP_MANIPULATION (vax_break_insn) vax_breakpoint; +using vax_breakpoint = BP_MANIPULATION (vax_break_insn); /* Advance PC across any function entry prologue instructions to reach some "real" code. */ diff --git a/gdb/windows-nat.h b/gdb/windows-nat.h index 8e6e79a8160..cbfe026b230 100644 --- a/gdb/windows-nat.h +++ b/gdb/windows-nat.h @@ -425,12 +425,12 @@ extern const int amd64_mappings[]; class all_windows_threads_iterator { public: - typedef all_windows_threads_iterator self_type; - typedef windows_thread_info value_type; - typedef windows_thread_info *&reference; - typedef windows_thread_info **pointer; - typedef std::forward_iterator_tag iterator_category; - typedef int difference_type; + using self_type = all_windows_threads_iterator; + using value_type = windows_thread_info; + using reference = windows_thread_info *&; + using pointer = windows_thread_info **; + using iterator_category = std::forward_iterator_tag; + using difference_type = int; explicit all_windows_threads_iterator (all_non_exited_threads_iterator base_iter) : m_base_iter (base_iter) diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c index 56fb7cff57a..43305a10446 100644 --- a/gdb/xml-syscall.c +++ b/gdb/xml-syscall.c @@ -112,7 +112,7 @@ struct syscall_desc std::string alias; }; -typedef std::unique_ptr syscall_desc_up; +using syscall_desc_up = std::unique_ptr; /* Structure of a syscall group. */ struct syscall_group_desc @@ -131,7 +131,7 @@ struct syscall_group_desc std::vector syscalls; }; -typedef std::unique_ptr syscall_group_desc_up; +using syscall_group_desc_up = std::unique_ptr; /* Structure that represents syscalls information. */ struct syscalls_info @@ -151,7 +151,7 @@ struct syscalls_info std::string my_gdb_datadir; }; -typedef std::unique_ptr syscalls_info_up; +using syscalls_info_up = std::unique_ptr; /* Callback data for syscall information parsing. */ struct syscall_parsing_data diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 20cb849f1f1..56521aab213 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -499,7 +499,7 @@ xstormy16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) constexpr gdb_byte xstormy16_break_insn[] = { 0x06, 0x0 }; -typedef BP_MANIPULATION (xstormy16_break_insn) xstormy16_breakpoint; +using xstormy16_breakpoint = BP_MANIPULATION (xstormy16_break_insn); /* Given a pointer to a jump table entry, return the address of the function it jumps to. Return 0 if not found. */ diff --git a/gdbserver/gdbreplay.cc b/gdbserver/gdbreplay.cc index 50ad3be34b0..4426dc316ec 100644 --- a/gdbserver/gdbreplay.cc +++ b/gdbserver/gdbreplay.cc @@ -59,7 +59,7 @@ #include "getopt.h" #ifndef HAVE_SOCKLEN_T -typedef int socklen_t; +using socklen_t = int; #endif /* Sort of a hack... */ diff --git a/gdbserver/linux-arm-low.cc b/gdbserver/linux-arm-low.cc index fa8f50aba14..c0705588d60 100644 --- a/gdbserver/linux-arm-low.cc +++ b/gdbserver/linux-arm-low.cc @@ -184,7 +184,7 @@ typedef enum } arm_hwbp_type; /* Type describing an ARM Hardware Breakpoint Control register value. */ -typedef unsigned int arm_hwbp_control_t; +using arm_hwbp_control_t = unsigned int; /* Structure used to keep track of hardware break-/watch-points. */ struct arm_linux_hw_breakpoint diff --git a/gdbserver/proc-service.cc b/gdbserver/proc-service.cc index 3d4e4c69dd6..5abd58725b7 100644 --- a/gdbserver/proc-service.cc +++ b/gdbserver/proc-service.cc @@ -27,10 +27,10 @@ #include "gdb_proc_service.h" -typedef struct ps_prochandle *gdb_ps_prochandle_t; -typedef void *gdb_ps_read_buf_t; -typedef const void *gdb_ps_write_buf_t; -typedef size_t gdb_ps_size_t; +using gdb_ps_prochandle_t = struct ps_prochandle *; +using gdb_ps_read_buf_t = void *; +using gdb_ps_write_buf_t = const void *; +using gdb_ps_size_t = size_t; #ifdef HAVE_LINUX_REGSETS #define HAVE_REGSETS diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc index 4a35e5c41b6..e99f34dfc6d 100644 --- a/gdbserver/remote-utils.cc +++ b/gdbserver/remote-utils.cc @@ -69,7 +69,7 @@ #endif #ifndef HAVE_SOCKLEN_T -typedef int socklen_t; +using socklen_t = int; #endif #ifndef IN_PROCESS_AGENT diff --git a/gdbsupport/buildargv.h b/gdbsupport/buildargv.h index e7484b27dbb..788c1e38730 100644 --- a/gdbsupport/buildargv.h +++ b/gdbsupport/buildargv.h @@ -167,7 +167,7 @@ public: /* The iterator type. */ - typedef char **iterator; + using iterator = char **; /* Return an iterator pointing to the start of the array. */ diff --git a/gdbsupport/common-types.h b/gdbsupport/common-types.h index bd05604dd23..c5c9c52b38d 100644 --- a/gdbsupport/common-types.h +++ b/gdbsupport/common-types.h @@ -24,10 +24,10 @@ #include "gdbsupport/offset-type.h" /* A byte from the program being debugged. */ -typedef unsigned char gdb_byte; +using gdb_byte = unsigned char; /* An address in the program being debugged. Host byte order. */ -typedef uint64_t CORE_ADDR; +using CORE_ADDR = uint64_t; /* Like a CORE_ADDR, but not directly convertible. This is used to represent an unrelocated CORE_ADDR. */ @@ -35,8 +35,8 @@ DEFINE_OFFSET_TYPE (unrelocated_addr, CORE_ADDR); /* LONGEST must be at least as big as CORE_ADDR. */ -typedef int64_t LONGEST; -typedef uint64_t ULONGEST; +using LONGEST = int64_t; +using ULONGEST = uint64_t; /* The largest CORE_ADDR value. */ #define CORE_ADDR_MAX (~(CORE_ADDR) 0) diff --git a/gdbsupport/default-init-alloc.h b/gdbsupport/default-init-alloc.h index ded7631ef1c..4021b475e73 100644 --- a/gdbsupport/default-init-alloc.h +++ b/gdbsupport/default-init-alloc.h @@ -52,11 +52,11 @@ public: struct rebind { /* A couple helpers just to make it a bit more readable. */ - typedef std::allocator_traits traits_; - typedef typename traits_::template rebind_alloc alloc_; + using traits_ = std::allocator_traits; + using alloc_ = typename traits_::template rebind_alloc; /* This is what we're after. */ - typedef default_init_allocator other; + using other = default_init_allocator; }; /* Make the base allocator's construct method(s) visible. */ diff --git a/gdbsupport/event-loop.h b/gdbsupport/event-loop.h index 4ae42d3a592..8c29f63a877 100644 --- a/gdbsupport/event-loop.h +++ b/gdbsupport/event-loop.h @@ -70,7 +70,7 @@ Corollary tasks are the creation and deletion of event sources. */ -typedef void *gdb_client_data; +using gdb_client_data = void *; typedef void (handler_func) (int, gdb_client_data); typedef void (timer_handler_func) (gdb_client_data); diff --git a/gdbsupport/filestuff.h b/gdbsupport/filestuff.h index 899fa48b9ef..0680c920be3 100644 --- a/gdbsupport/filestuff.h +++ b/gdbsupport/filestuff.h @@ -112,7 +112,7 @@ struct gdb_dir_deleter /* A unique pointer to a DIR. */ -typedef std::unique_ptr gdb_dir_up; +using gdb_dir_up = std::unique_ptr; /* Return true if the file NAME exists and is a regular file. If the result is false then *ERRNO_PTR is set to a useful value assuming diff --git a/gdbsupport/format.h b/gdbsupport/format.h index ced10e46a71..70ac753fba3 100644 --- a/gdbsupport/format.h +++ b/gdbsupport/format.h @@ -75,7 +75,7 @@ public: DISABLE_COPY_AND_ASSIGN (format_pieces); - typedef std::vector::iterator iterator; + using iterator = std::vector::iterator; iterator begin () { diff --git a/gdbsupport/gdb-dlfcn.h b/gdbsupport/gdb-dlfcn.h index 00d2e26b63f..a211693017b 100644 --- a/gdbsupport/gdb-dlfcn.h +++ b/gdbsupport/gdb-dlfcn.h @@ -29,7 +29,7 @@ struct dlclose_deleter /* A unique pointer that points to a dynamic library. */ -typedef std::unique_ptr gdb_dlhandle_up; +using gdb_dlhandle_up = std::unique_ptr; /* Load the dynamic library file named FILENAME, and return a handle for that dynamic library. Throw an error if the loading fails for diff --git a/gdbsupport/gdb-hashtab.h b/gdbsupport/gdb-hashtab.h index 75313ea92de..c8a25d30ecf 100644 --- a/gdbsupport/gdb-hashtab.h +++ b/gdbsupport/gdb-hashtab.h @@ -31,7 +31,7 @@ struct htab_deleter }; /* A unique_ptr wrapper for htab_t. */ -typedef std::unique_ptr htab_up; +using htab_up = std::unique_ptr; /* A wrapper for 'delete' that can used as a hash table entry deletion function. */ diff --git a/gdbsupport/gdb_file.h b/gdbsupport/gdb_file.h index ccd1e3e92e7..988655ff3b4 100644 --- a/gdbsupport/gdb_file.h +++ b/gdbsupport/gdb_file.h @@ -32,6 +32,6 @@ struct gdb_file_deleter /* A unique pointer to a FILE. */ -typedef std::unique_ptr gdb_file_up; +using gdb_file_up = std::unique_ptr; #endif /* GDBSUPPORT_GDB_FILE_H */ diff --git a/gdbsupport/gdb_proc_service.h b/gdbsupport/gdb_proc_service.h index 8622de727ea..c7a240306b5 100644 --- a/gdbsupport/gdb_proc_service.h +++ b/gdbsupport/gdb_proc_service.h @@ -84,19 +84,19 @@ typedef enum } ps_err_e; #ifndef HAVE_LWPID_T -typedef unsigned int lwpid_t; +using lwpid_t = unsigned int; #endif #ifndef HAVE_PSADDR_T -typedef void *psaddr_t; +using psaddr_t = void *; #endif #ifndef HAVE_PRGREGSET_T -typedef elf_gregset_t prgregset_t; +using prgregset_t = elf_gregset_t; #endif #ifndef HAVE_PRFPREGSET_T -typedef elf_fpregset_t prfpregset_t; +using prfpregset_t = elf_fpregset_t; #endif /* This type is opaque in this interface. It's defined by the user of diff --git a/gdbsupport/observable.h b/gdbsupport/observable.h index 7669fa5a9f7..6a230f22a91 100644 --- a/gdbsupport/observable.h +++ b/gdbsupport/observable.h @@ -82,7 +82,7 @@ template class observable { public: - typedef std::function func_type; + using func_type = std::function; private: struct observer diff --git a/gdbsupport/safe-iterator.h b/gdbsupport/safe-iterator.h index 6c5a2901c7e..e580ade00c0 100644 --- a/gdbsupport/safe-iterator.h +++ b/gdbsupport/safe-iterator.h @@ -108,7 +108,7 @@ class basic_safe_range { public: - typedef basic_safe_iterator iterator; + using iterator = basic_safe_iterator; explicit basic_safe_range (Range range) : m_range (range) diff --git a/gdbsupport/scoped_restore.h b/gdbsupport/scoped_restore.h index e42c6d93bf4..6fd8de53376 100644 --- a/gdbsupport/scoped_restore.h +++ b/gdbsupport/scoped_restore.h @@ -42,7 +42,7 @@ protected: /* A convenience typedef. Users of make_scoped_restore declare the local RAII object as having this type. */ -typedef const scoped_restore_base &scoped_restore; +using scoped_restore = const scoped_restore_base &; /* An RAII-based object that saves a variable's value, and then restores it again when this object is destroyed. */ diff --git a/gdbsupport/tdesc.h b/gdbsupport/tdesc.h index b3ff01e37d0..a2ef21987bf 100644 --- a/gdbsupport/tdesc.h +++ b/gdbsupport/tdesc.h @@ -131,7 +131,7 @@ struct tdesc_reg : tdesc_element } }; -typedef std::unique_ptr tdesc_reg_up; +using tdesc_reg_up = std::unique_ptr; /* Declaration of a structure that holds information about one "compatibility" entry within a target description. */ @@ -140,7 +140,7 @@ struct tdesc_compatible_info; /* A pointer to a single piece of compatibility information. */ -typedef std::unique_ptr tdesc_compatible_info_up; +using tdesc_compatible_info_up = std::unique_ptr; /* Return a vector of compatibility information pointers from the target description TARGET_DESC. */ @@ -212,7 +212,7 @@ struct tdesc_type : tdesc_element } }; -typedef std::unique_ptr tdesc_type_up; +using tdesc_type_up = std::unique_ptr; struct tdesc_type_builtin : tdesc_type { @@ -313,7 +313,7 @@ struct tdesc_feature : tdesc_element } }; -typedef std::unique_ptr tdesc_feature_up; +using tdesc_feature_up = std::unique_ptr; /* A deleter adapter for a target_desc. There are different implementations of this deleter class in gdb and gdbserver because even diff --git a/gdbsupport/thread-pool.h b/gdbsupport/thread-pool.h index a9188d1e107..638d3e2d08e 100644 --- a/gdbsupport/thread-pool.h +++ b/gdbsupport/thread-pool.h @@ -98,7 +98,7 @@ private: size_t m_thread_count = 0; /* A convenience typedef for the type of a task. */ - typedef std::packaged_task task_t; + using task_t = std::packaged_task; /* The tasks that have not been processed yet. An optional is used to represent a task. If the optional is empty, then this means -- 2.47.3