[gdb] Use using instead of typedef

After commit 1eed06ae51 ("[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.
This commit is contained in:
Tom de Vries 2026-06-11 08:54:34 +02:00
parent 2eea7bca0c
commit 6c85ef111b
115 changed files with 209 additions and 209 deletions

View file

@ -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

View file

@ -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. */

View file

@ -627,7 +627,7 @@ protected:
};
/* Unique pointer specialization for Ada assignment components. */
typedef std::unique_ptr<ada_component> ada_component_up;
using ada_component_up = std::unique_ptr<ada_component>;
/* 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> ada_association_up;
using ada_association_up = std::unique_ptr<ada_association>;
/* A component that holds a vector of associations and an operation.
The operation is re-evaluated for each choice. */

View file

@ -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.

View file

@ -23,7 +23,7 @@
/* Xtensa ELF core file register set representation ('.reg' section).
Copied from target-side ELF header <xtensa/elf.h>. */
typedef uint32_t xtensa_elf_greg_t;
using xtensa_elf_greg_t = uint32_t;
typedef struct
{

View file

@ -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

View file

@ -95,7 +95,7 @@ struct arm_mapping_symbol
{ return this->value < other.value; }
};
typedef std::vector<arm_mapping_symbol> arm_mapping_symbol_vec;
using arm_mapping_symbol_vec = std::vector<arm_mapping_symbol>;
struct arm_per_bfd
{

View file

@ -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,

View file

@ -144,7 +144,7 @@ struct agent_expr
};
/* An agent_expr owning pointer. */
typedef std::unique_ptr<agent_expr> agent_expr_up;
using agent_expr_up = std::unique_ptr<agent_expr>;
/* The actual values of the various bytecode operations. */

View file

@ -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)

View file

@ -1535,7 +1535,7 @@ struct breakpoint_deleter
}
};
typedef std::unique_ptr<struct breakpoint, breakpoint_deleter> breakpoint_up;
using breakpoint_up = std::unique_ptr<struct breakpoint, breakpoint_deleter>;
extern breakpoint_up set_momentary_breakpoint
(struct gdbarch *, struct symtab_and_line, struct frame_id, enum bptype);

View file

@ -65,10 +65,10 @@ struct command_lines_deleter
};
/* A reference-counted struct command_line. */
typedef std::shared_ptr<command_line> counted_command_line;
using counted_command_line = std::shared_ptr<command_line>;
/* A unique_ptr specialization for command_line. */
typedef std::unique_ptr<command_line, command_lines_deleter> command_line_up;
using command_line_up = std::unique_ptr<command_line, command_lines_deleter>;
/* Structure for saved commands lines (for breakpoints, defined
commands, etc). */

View file

@ -89,7 +89,7 @@ struct compile_module
};
/* A unique pointer for a compile_module. */
typedef std::unique_ptr<compile_module> compile_module_up;
using compile_module_up = std::unique_ptr<compile_module>;
extern compile_module_up compile_object_load
(const compile_file_names &fnames,

View file

@ -58,7 +58,7 @@ extern void clear_complaints ();
/* Type of collected complaints. */
typedef gdb::unordered_set<std::string> complaint_collection;
using complaint_collection = gdb::unordered_set<std::string>;
/* A class that can handle calls to complaint from multiple threads.
When this is instantiated, it hooks into the complaint mechanism,

View file

@ -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<gdb::unique_xmalloc_ptr<char>> completion_list;
using completion_list = std::vector<gdb::unique_xmalloc_ptr<char>>;
/* The result of a successful completion match. When doing symbol
comparison, we use the symbol search name for the symbol name match

View file

@ -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 */

View file

@ -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. */

View file

@ -23,7 +23,7 @@
#include "target.h"
typedef struct dcache_struct DCACHE;
using DCACHE = struct dcache_struct;
/* Invalidate DCACHE. */
void dcache_invalidate (DCACHE *dcache);

View file

@ -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))

View file

@ -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

View file

@ -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;

View file

@ -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 ()

View file

@ -78,7 +78,7 @@ struct elfinfo
/* Type for per-BFD data. */
typedef std::vector<std::unique_ptr<probe>> elfread_data;
using elfread_data = std::vector<std::unique_ptr<probe>>;
/* Per-BFD data for probe info. */

View file

@ -565,7 +565,7 @@ private:
/* A floating-point constant. The constant is encoded in the target
format. */
typedef std::array<gdb_byte, 16> float_data;
using float_data = std::array<gdb_byte, 16>;
/* An operation that holds a floating-point constant of a given
type.

View file

@ -79,7 +79,7 @@ namespace expr
{
class operation;
typedef std::unique_ptr<operation> operation_up;
using operation_up = std::unique_ptr<operation>;
/* 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> expression_up;
using expression_up = std::unique_ptr<expression>;
/* When parsing expressions we track the innermost block that was
referenced. */

View file

@ -232,7 +232,7 @@ private:
const extension_language_defn *m_extlang;
};
typedef std::unique_ptr<xmethod_worker> xmethod_worker_up;
using xmethod_worker_up = std::unique_ptr<xmethod_worker>;
/* The interface for gdb's own extension(/scripting) language. */
extern const struct extension_language_defn extension_language_gdb;

View file

@ -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). */

View file

@ -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. */

View file

@ -83,7 +83,7 @@ struct gdb_bfd_ref_policy
};
/* A gdb::ref_ptr that has been specialized for BFD objects. */
typedef gdb::ref_ptr<struct bfd, gdb_bfd_ref_policy> gdb_bfd_ref_ptr;
using gdb_bfd_ref_ptr = gdb::ref_ptr<struct bfd, gdb_bfd_ref_policy>;
/* Open a read-only (FOPEN_RB) BFD given arguments like bfd_fopen.
If NAME starts with TARGET_SYSROOT_PREFIX then the BFD will be

View file

@ -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

View file

@ -1798,7 +1798,7 @@ struct rank
/* Used for ranking a function for overload resolution. */
typedef std::vector<rank> badness_vector;
using badness_vector = std::vector<rank>;
/* GNAT Ada-specific information for various Ada types. */

View file

@ -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;

View file

@ -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)

View file

@ -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. */

View file

@ -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. */

View file

@ -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,

View file

@ -500,7 +500,7 @@ struct lwp_deleter
/* A unique_ptr specialisation for lwp_info. */
typedef std::unique_ptr<struct lwp_info, lwp_deleter> lwp_info_up;
using lwp_info_up = std::unique_ptr<struct lwp_info, lwp_deleter>;
/* Target hook for follow_fork. */

View file

@ -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

View file

@ -68,7 +68,7 @@ enum location_spec_type
};
/* A unique pointer for location_spec. */
typedef std::unique_ptr<location_spec> location_spec_up;
using location_spec_up = std::unique_ptr<location_spec>;
/* The base class for all location specs used to resolve actual
locations in the inferior. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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
{

View file

@ -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. */

View file

@ -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. */

View file

@ -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)

View file

@ -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. */

View file

@ -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,

View file

@ -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. */

View file

@ -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_iterator> separate_debug_range;
using separate_debug_range = iterator_range<separate_debug_iterator>;
/* 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<minimal_symbol_iterator> msymbols_range;
using msymbols_range = iterator_range<minimal_symbol_iterator>;
/* 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<objfile, objfile_unlinker> scoped_objfile_unlinker;
using scoped_objfile_unlinker = std::unique_ptr<objfile, objfile_unlinker>;
/* Relocation offset applied to the section. */
inline CORE_ADDR

View file

@ -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)

View file

@ -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 */

View file

@ -542,7 +542,7 @@ struct procinfo_deleter
}
};
typedef std::unique_ptr<procinfo, procinfo_deleter> procinfo_up;
using procinfo_up = std::unique_ptr<procinfo, procinfo_deleter>;
enum { NOKILL, KILL };

View file

@ -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, ?, ? }. */

View file

@ -25,7 +25,7 @@
#include "gdbsupport/unordered_map.h"
/* Per-gdbarch data type. */
typedef std::vector<gdbpy_ref<>> gdbpy_register_type;
using gdbpy_register_type = std::vector<gdbpy_ref<>>;
/* Token to access per-gdbarch data related to register descriptors. */
static const registry<gdbarch>::key<gdbpy_register_type>

View file

@ -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, Py_buffer_deleter> Py_buffer_up;
using Py_buffer_up = std::unique_ptr<Py_buffer, Py_buffer_deleter>;
/* Parse a register number from PYO_REG_ID and place the register number
into *REG_NUM. The register is a register for GDBARCH.

View file

@ -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);

View file

@ -202,6 +202,6 @@ struct quick_symbol_functions
}
};
typedef std::unique_ptr<quick_symbol_functions> quick_symbol_functions_up;
using quick_symbol_functions_up = std::unique_ptr<quick_symbol_functions>;
#endif /* GDB_QUICK_SYMBOL_H */

View file

@ -34,7 +34,7 @@ struct notif_event
/* A unique pointer holding a notif_event. */
typedef std::unique_ptr<notif_event> notif_event_up;
using notif_event_up = std::unique_ptr<notif_event>;
/* ID of the notif_client. */

View file

@ -108,7 +108,7 @@ struct protocol_feature;
struct packet_reg;
struct stop_reply;
typedef std::unique_ptr<stop_reply> stop_reply_up;
using stop_reply_up = std::unique_ptr<stop_reply>;
/* 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. */

View file

@ -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. */

View file

@ -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. */

View file

@ -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
{

View file

@ -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. */

View file

@ -126,7 +126,7 @@
#include <dos.h>
#include <go32.h>
#include <dpmi.h>
typedef unsigned long u_long;
using u_long = unsigned long;
/* 16550 rx fifo trigger point */
#define FIFO_TRIGGER FIFO_TRIGGER_4

View file

@ -853,7 +853,7 @@ struct pipe_state_destroyer
}
};
typedef std::unique_ptr<pipe_state, pipe_state_destroyer> pipe_state_up;
using pipe_state_up = std::unique_ptr<pipe_state, pipe_state_destroyer>;
static void
pipe_windows_open (struct serial *scb, const char *name)

View file

@ -61,7 +61,7 @@
#include <algorithm>
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
using socklen_t = int;
#endif
/* For "set tcp" and "show tcp". */

View file

@ -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;

View file

@ -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

View file

@ -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. */

View file

@ -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

View file

@ -69,7 +69,7 @@ struct other_sections
to communicate the section addresses in shared objects to
symbol_file_add (). */
typedef std::vector<other_sections> section_addr_info;
using section_addr_info = std::vector<other_sections>;
/* A table listing the load segments in a symfile, and which segment
each BFD section belongs to. */

View file

@ -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<symbol_search, symbol_search> module_symbol_search;
using module_symbol_search = std::pair<symbol_search, symbol_search>;
/* Searches the symbols to find function and variables symbols (depending
on KIND) within Fortran modules. The MODULE_REGEXP matches against the

View file

@ -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, target_ops_deleter> target_ops_up;
using target_ops_up = std::unique_ptr<target_ops, target_ops_deleter>;
/* 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<struct target_ops, target_unpusher> target_unpush_up;
using target_unpush_up = std::unique_ptr<struct target_ops, target_unpusher>;
extern void target_pre_inferior ();

View file

@ -34,12 +34,12 @@ using inf_threads_iterator = intrusive_list<thread_info>::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. */

View file

@ -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. */

View file

@ -36,7 +36,7 @@ struct traceframe_info
std::vector<int> tvars;
};
typedef std::unique_ptr<traceframe_info> traceframe_info_up;
using traceframe_info_up = std::unique_ptr<traceframe_info>;
/* A trace state variable is a value managed by a target being
traced. A trace state variable (or tsv for short) can be accessed

View file

@ -367,7 +367,7 @@ typedef std::function<tui_win_info * (const char *name)> 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_factory> window_types_map;
using window_types_map = gdb::unordered_string_map<window_factory>;
/* 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

View file

@ -270,12 +270,12 @@ public:
typedef std::vector<tui_win_info *>::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)

View file

@ -147,7 +147,7 @@ private:
void printchar (int c, int quoter, bool async_safe);
};
typedef std::unique_ptr<ui_file> ui_file_up;
using ui_file_up = std::unique_ptr<ui_file>;
/* A ui_file that writes to nowhere. */
@ -295,7 +295,7 @@ private:
bool m_close_p;
};
typedef std::unique_ptr<stdio_file> stdio_file_up;
using stdio_file_up = std::unique_ptr<stdio_file>;
/* Like stdio_file, but specifically for stderr.

View file

@ -439,8 +439,8 @@ private:
struct ui_out *m_uiout;
};
typedef ui_out_emit_type<ui_out_type_tuple> ui_out_emit_tuple;
typedef ui_out_emit_type<ui_out_type_list> ui_out_emit_list;
using ui_out_emit_tuple = ui_out_emit_type<ui_out_type_tuple>;
using ui_out_emit_list = ui_out_emit_type<ui_out_type_list>;
/* Start a new table on construction, and end the table on
destruction. */

View file

@ -58,7 +58,7 @@ CHECK_TRAIT (is_trivially_move_assignable);
static void
run_tests ()
{
typedef packed<unsigned int, 2> packed_2;
using packed_2 = packed<unsigned int, 2>;
packed_2 p1;
packed_2 p2 (0x0102);

View file

@ -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. */

View file

@ -121,7 +121,7 @@ struct value_ref_policy
/* A gdb:;ref_ptr pointer to a struct value. */
typedef gdb::ref_ptr<struct value, value_ref_policy> value_ref_ptr;
using value_ref_ptr = gdb::ref_ptr<struct value, value_ref_policy>;
/* Note that the fields in this structure are arranged to save a bit
of memory. */

View file

@ -37,7 +37,7 @@
#include "python/python.h"
#include "python/python-internal.h"
#else
typedef int PyObject;
using PyObject = int;
#endif
/* See varobj.h. */

View file

@ -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. */

View file

@ -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)

View file

@ -112,7 +112,7 @@ struct syscall_desc
std::string alias;
};
typedef std::unique_ptr<syscall_desc> syscall_desc_up;
using syscall_desc_up = std::unique_ptr<syscall_desc>;
/* Structure of a syscall group. */
struct syscall_group_desc
@ -131,7 +131,7 @@ struct syscall_group_desc
std::vector<syscall_desc *> syscalls;
};
typedef std::unique_ptr<syscall_group_desc> syscall_group_desc_up;
using syscall_group_desc_up = std::unique_ptr<syscall_group_desc>;
/* 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> syscalls_info_up;
using syscalls_info_up = std::unique_ptr<syscalls_info>;
/* Callback data for syscall information parsing. */
struct syscall_parsing_data

View file

@ -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. */

View file

@ -59,7 +59,7 @@
#include "getopt.h"
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
using socklen_t = int;
#endif
/* Sort of a hack... */

View file

@ -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

View file

@ -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

View file

@ -69,7 +69,7 @@
#endif
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
using socklen_t = int;
#endif
#ifndef IN_PROCESS_AGENT

Some files were not shown because too many files have changed in this diff Show more