]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb] Convert typedef of named struct
authorTom de Vries <tdevries@suse.de>
Mon, 13 Jul 2026 13:06:35 +0000 (15:06 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 13 Jul 2026 13:06:35 +0000 (15:06 +0200)
Convert "typedef struct foo { ... } bar" to "using bar = struct foo { ...}".

Generated by a script written by Claude Code.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/guile/scm-breakpoint.c
gdb/nat/aarch64-linux.h
gdb/nat/glibc_thread_db.h
gdb/windows-tdep.c
gdb/xtensa-tdep.c

index 62256ee53bf8cf1244e3a24364d0693882b09b0b..5df2c00f5d3fb7015f67d061c795112306e29843 100644 (file)
@@ -42,7 +42,7 @@
    any side-effects.  This means that the smob needs to store everything
    that was passed to make-breakpoint.  */
 
-typedef struct gdbscm_breakpoint_object
+using breakpoint_smob = struct gdbscm_breakpoint_object
 {
   /* This always appears first.  */
   gdb_smob base;
@@ -90,7 +90,7 @@ typedef struct gdbscm_breakpoint_object
 
   /* A stop condition or #f.  */
   SCM stop;
-} breakpoint_smob;
+};
 
 static const char breakpoint_smob_name[] = "gdb:breakpoint";
 
index 5f699e1f351a946e78916a656f1a55ca6c9d5885..67107855d7abe59b61f44aa60fa263aebe76cdf4 100644 (file)
@@ -37,13 +37,13 @@ struct compat_timeval
   int tv_usec;
 };
 
-typedef union compat_sigval
+using compat_sigval_t = union compat_sigval
 {
   compat_int_t sival_int;
   compat_uptr_t sival_ptr;
-} compat_sigval_t;
+};
 
-typedef struct compat_siginfo
+using compat_siginfo_t = struct compat_siginfo
 {
   int si_signo;
   int si_errno;
@@ -99,7 +99,7 @@ typedef struct compat_siginfo
       int _fd;
     } _sigpoll;
   } _sifields;
-} compat_siginfo_t;
+};
 
 #define cpt_si_pid _sifields._kill._pid
 #define cpt_si_uid _sifields._kill._uid
index 0831537146cd22d23e4c639c64f80107a2669bba..6695bf599e26d9f71b59f3059eefd503e282e544 100644 (file)
@@ -89,11 +89,11 @@ enum td_thr_type_e
 using td_thragent_t = struct td_thragent;
 
 /* The actual thread handle type.  This is also opaque.  */
-typedef struct td_thrhandle
+using td_thrhandle_t = struct td_thrhandle
 {
   td_thragent_t *th_ta_p;
   psaddr_t th_unique;
-} td_thrhandle_t;
+};
 
 
 /* Forward declaration of a type defined by and for the dynamic linker.  */
@@ -112,10 +112,10 @@ struct link_map;
 #define BT_UIMASK      (BT_NBIPUI - 1)         /* to extract bit index */
 
 /* Bitmask of enabled events. */
-typedef struct td_thr_events
+using td_thr_events_t = struct td_thr_events
 {
   uint32_t event_bits[TD_EVENTSIZE];
-} td_thr_events_t;
+};
 
 /* Event set manipulation macros. */
 #define __td_eventmask(n) \
@@ -184,7 +184,7 @@ enum td_notify_e
 };
 
 /* Description how event type is reported.  */
-typedef struct td_notify
+using td_notify_t = struct td_notify
 {
   td_notify_e type;            /* Way the event is reported.  */
   union
@@ -192,10 +192,10 @@ typedef struct td_notify
     psaddr_t bptaddr;          /* Address of breakpoint.  */
     int syscallno;             /* Number of system call used.  */
   } u;
-} td_notify_t;
+};
 
 /* Structure used to report event.  */
-typedef struct td_event_msg
+using td_event_msg_t = struct td_event_msg
 {
   td_event_e event;            /* Event type being reported.  */
   const td_thrhandle_t *th_p;  /* Thread reporting the event.  */
@@ -206,7 +206,7 @@ typedef struct td_event_msg
 #endif
     uintptr_t data;            /* Event specific data.  */
   } msg;
-} td_event_msg_t;
+};
 
 /* Structure containing event data available in each thread structure.  */
 struct td_eventbuf_t
@@ -218,7 +218,7 @@ struct td_eventbuf_t
 
 
 /* Gathered statistics about the process.  */
-typedef struct td_ta_stats
+using td_ta_stats_t = struct td_ta_stats
 {
   int nthreads;                /* Total number of threads in use.  */
   int r_concurrency;           /* Concurrency level requested by user.  */
@@ -234,7 +234,7 @@ typedef struct td_ta_stats
                                   numerator.  */
   int nidle_den;               /* Average number of idling processes,
                                   denominator.  */
-} td_ta_stats_t;
+};
 
 
 /* Since Sun's library is based on Solaris threads we have to define a few
@@ -256,7 +256,7 @@ struct ps_prochandle;
 
 
 /* Information about the thread.  */
-typedef struct td_thrinfo
+using td_thrinfo_t = struct td_thrinfo
 {
   td_thragent_t *ti_ta_p;              /* Process handle.  */
   unsigned int ti_user_flags;          /* Unused.  */
@@ -285,7 +285,7 @@ typedef struct td_thrinfo
   unsigned char ti_pirecflag;          /* Unused.  */
   sigset_t ti_pending;                 /* Set of pending signals.  */
   td_thr_events_t ti_events;           /* Set of enabled events.  */
-} td_thrinfo_t;
+};
 
 
 
index 78bf49b9c81f4e02304a3e62c1425e474c070dd6..c0a743914b1c74c202dfeea0cfca2a93dc048385 100644 (file)
@@ -110,7 +110,7 @@ static constexpr unsigned int NOTE_INFO_MODULE64 = 4;
 
 struct cmd_list_element *info_w32_cmdlist;
 
-typedef struct thread_information_block_32
+using thread_information_32 = struct thread_information_block_32
   {
     uint32_t current_seh;                      /* %fs:0x0000 */
     uint32_t current_top_of_stack;             /* %fs:0x0004 */
@@ -126,10 +126,9 @@ typedef struct thread_information_block_32
     uint32_t thread_local_storage;             /* %fs:0x002c */
     uint32_t process_environment_block;                /* %fs:0x0030 */
     uint32_t last_error_number;                        /* %fs:0x0034 */
-  }
-thread_information_32;
+  };
 
-typedef struct thread_information_block_64
+using thread_information_64 = struct thread_information_block_64
   {
     uint64_t current_seh;                      /* %gs:0x0000 */
     uint64_t current_top_of_stack;             /* %gs:0x0008 */
@@ -145,8 +144,7 @@ typedef struct thread_information_block_64
     uint64_t thread_local_storage;             /* %gs:0x0058 */
     uint64_t process_environment_block;                /* %gs:0x0060 */
     uint64_t last_error_number;                        /* %gs:0x0068 */
-  }
-thread_information_64;
+  };
 
 
 static const char* TIB_NAME[] =
index 8641915e8aa100550db492c73ddd8e404980dfe6..9af18a857bac131c8c63da3d251b5b1cde327734 100644 (file)
@@ -890,7 +890,7 @@ xtensa_iterate_over_regset_sections (struct gdbarch *gdbarch,
 #define XTENSA_NUM_SAVED_AREGS         12
 
 /* Frame cache part for Windowed ABI.  */
-typedef struct xtensa_windowed_frame_cache
+using xtensa_windowed_frame_cache_t = struct xtensa_windowed_frame_cache
 {
   int wb;              /* WINDOWBASE of the previous frame.  */
   int callsize;                /* Call size of this frame.  */
@@ -902,7 +902,7 @@ typedef struct xtensa_windowed_frame_cache
    /* Addresses of spilled A-registers.
       AREGS[i] == -1, if corresponding AR is alive.  */
   CORE_ADDR aregs[XTENSA_NUM_SAVED_AREGS];
-} xtensa_windowed_frame_cache_t;
+};
 
 /* Call0 ABI Definitions.  */
 
@@ -928,17 +928,17 @@ typedef struct xtensa_windowed_frame_cache
 
 extern xtensa_isa xtensa_default_isa;
 
-typedef struct xtensa_c0reg
+using xtensa_c0reg_t = struct xtensa_c0reg
 {
   int fr_reg;  /* original register from which register content
                  is derived, or C0_CONST, or C0_INEXP.  */
   int fr_ofs;  /* constant offset from reg, or immediate value.  */
   int to_stk;  /* offset from original SP to register (4-byte aligned),
                  or C0_NOSTK if register has not been saved.  */
-} xtensa_c0reg_t;
+};
 
 /* Frame cache part for Call0 ABI.  */
-typedef struct xtensa_call0_frame_cache
+using xtensa_call0_frame_cache_t = struct xtensa_call0_frame_cache
 {
   int c0_frmsz;                           /* Stack frame size.  */
   int c0_hasfp;                           /* Current frame uses frame pointer.  */
@@ -954,9 +954,9 @@ typedef struct xtensa_call0_frame_cache
                                      stack offset. C0_NOSTK otherwise.  */
 
   xtensa_c0reg_t c0_rt[C0_NREGS];  /* Register tracking information.  */
-} xtensa_call0_frame_cache_t;
+};
 
-typedef struct xtensa_frame_cache
+using xtensa_frame_cache_t = struct xtensa_frame_cache
 {
   CORE_ADDR base;      /* Stack pointer of this frame.  */
   CORE_ADDR pc;                /* PC of this frame at the function entry point.  */
@@ -969,7 +969,7 @@ typedef struct xtensa_frame_cache
       xtensa_windowed_frame_cache_t    wd;     /* call0 == false.  */
       xtensa_call0_frame_cache_t               c0;     /* call0 == true.  */
     };
-} xtensa_frame_cache_t;
+};
 
 
 static struct xtensa_frame_cache *