[binutils-gdb] [gdb] Convert typedef of named struct
Tom de Vries via Gdb-cvs <[email protected]> Mon, 13 Jul 2026 13:07:28 +0000 (GMT)
| Newsgroups | gmane.comp.gdb.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Ddc11540eda51= c88b54bde9cc1e9b616f0e94769d commit dc11540eda51c88b54bde9cc1e9b616f0e94769d Author: Tom de Vries <[email protected]> Date: Mon Jul 13 15:06:35 2026 +0200 [gdb] Convert typedef of named struct =20 Convert "typedef struct foo { ... } bar" to "using bar =3D struct foo {= ...}". =20 Generated by a script written by Claude Code. =20 Approved-By: Tom Tromey <[email protected]> Diff: --- gdb/guile/scm-breakpoint.c | 4 ++-- gdb/nat/aarch64-linux.h | 8 ++++---- gdb/nat/glibc_thread_db.h | 24 ++++++++++++------------ gdb/windows-tdep.c | 10 ++++------ gdb/xtensa-tdep.c | 16 ++++++++-------- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c index 62256ee53bf..5df2c00f5d3 100644 --- a/gdb/guile/scm-breakpoint.c +++ b/gdb/guile/scm-breakpoint.c @@ -42,7 +42,7 @@ any side-effects. This means that the smob needs to store everything that was passed to make-breakpoint. */ =20 -typedef struct gdbscm_breakpoint_object +using breakpoint_smob =3D struct gdbscm_breakpoint_object { /* This always appears first. */ gdb_smob base; @@ -90,7 +90,7 @@ typedef struct gdbscm_breakpoint_object =20 /* A stop condition or #f. */ SCM stop; -} breakpoint_smob; +}; =20 static const char breakpoint_smob_name[] =3D "gdb:breakpoint"; =20 diff --git a/gdb/nat/aarch64-linux.h b/gdb/nat/aarch64-linux.h index 5f699e1f351..67107855d7a 100644 --- a/gdb/nat/aarch64-linux.h +++ b/gdb/nat/aarch64-linux.h @@ -37,13 +37,13 @@ struct compat_timeval int tv_usec; }; =20 -typedef union compat_sigval +using compat_sigval_t =3D union compat_sigval { compat_int_t sival_int; compat_uptr_t sival_ptr; -} compat_sigval_t; +}; =20 -typedef struct compat_siginfo +using compat_siginfo_t =3D struct compat_siginfo { int si_signo; int si_errno; @@ -99,7 +99,7 @@ typedef struct compat_siginfo int _fd; } _sigpoll; } _sifields; -} compat_siginfo_t; +}; =20 #define cpt_si_pid _sifields._kill._pid #define cpt_si_uid _sifields._kill._uid diff --git a/gdb/nat/glibc_thread_db.h b/gdb/nat/glibc_thread_db.h index 0831537146c..6695bf599e2 100644 --- a/gdb/nat/glibc_thread_db.h +++ b/gdb/nat/glibc_thread_db.h @@ -89,11 +89,11 @@ enum td_thr_type_e using td_thragent_t =3D struct td_thragent; =20 /* The actual thread handle type. This is also opaque. */ -typedef struct td_thrhandle +using td_thrhandle_t =3D struct td_thrhandle { td_thragent_t *th_ta_p; psaddr_t th_unique; -} td_thrhandle_t; +}; =20 =20 /* 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 */ =20 /* Bitmask of enabled events. */ -typedef struct td_thr_events +using td_thr_events_t =3D struct td_thr_events { uint32_t event_bits[TD_EVENTSIZE]; -} td_thr_events_t; +}; =20 /* Event set manipulation macros. */ #define __td_eventmask(n) \ @@ -184,7 +184,7 @@ enum td_notify_e }; =20 /* Description how event type is reported. */ -typedef struct td_notify +using td_notify_t =3D 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; +}; =20 /* Structure used to report event. */ -typedef struct td_event_msg +using td_event_msg_t =3D 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; +}; =20 /* Structure containing event data available in each thread structure. */ struct td_eventbuf_t @@ -218,7 +218,7 @@ struct td_eventbuf_t =20 =20 /* Gathered statistics about the process. */ -typedef struct td_ta_stats +using td_ta_stats_t =3D 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; +}; =20 =20 /* Since Sun's library is based on Solaris threads we have to define a few @@ -256,7 +256,7 @@ struct ps_prochandle; =20 =20 /* Information about the thread. */ -typedef struct td_thrinfo +using td_thrinfo_t =3D 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; +}; =20 =20 =20 diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index 78bf49b9c81..c0a743914b1 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -110,7 +110,7 @@ static constexpr unsigned int NOTE_INFO_MODULE64 =3D 4; =20 struct cmd_list_element *info_w32_cmdlist; =20 -typedef struct thread_information_block_32 +using thread_information_32 =3D 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; + }; =20 -typedef struct thread_information_block_64 +using thread_information_64 =3D 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; + }; =20 =20 static const char* TIB_NAME[] =3D diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 8641915e8aa..9af18a857ba 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -890,7 +890,7 @@ xtensa_iterate_over_regset_sections (struct gdbarch *gd= barch, #define XTENSA_NUM_SAVED_AREGS 12 =20 /* Frame cache part for Windowed ABI. */ -typedef struct xtensa_windowed_frame_cache +using xtensa_windowed_frame_cache_t =3D 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] =3D=3D -1, if corresponding AR is alive. */ CORE_ADDR aregs[XTENSA_NUM_SAVED_AREGS]; -} xtensa_windowed_frame_cache_t; +}; =20 /* Call0 ABI Definitions. */ =20 @@ -928,17 +928,17 @@ typedef struct xtensa_windowed_frame_cache =20 extern xtensa_isa xtensa_default_isa; =20 -typedef struct xtensa_c0reg +using xtensa_c0reg_t =3D 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; +}; =20 /* Frame cache part for Call0 ABI. */ -typedef struct xtensa_call0_frame_cache +using xtensa_call0_frame_cache_t =3D 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. */ =20 xtensa_c0reg_t c0_rt[C0_NREGS]; /* Register tracking information. */ -} xtensa_call0_frame_cache_t; +}; =20 -typedef struct xtensa_frame_cache +using xtensa_frame_cache_t =3D 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 =3D=3D false. */ xtensa_call0_frame_cache_t c0; /* call0 =3D=3D true. */ }; -} xtensa_frame_cache_t; +}; =20 =20 static struct xtensa_frame_cache *