[gdb] Convert anonymous struct typedefs

Convert "typedef struct { ... } foo" into "struct foo { ... }".

Generated by a script written by Claude Code.

Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
Tom de Vries 2026-07-13 15:06:35 +02:00
parent c3ea9a009d
commit 496c2954e6
14 changed files with 50 additions and 54 deletions

View file

@ -25,7 +25,7 @@
using xtensa_elf_greg_t = uint32_t;
typedef struct
struct xtensa_elf_gregset_t
{
xtensa_elf_greg_t pc;
xtensa_elf_greg_t ps;
@ -38,7 +38,7 @@ typedef struct
xtensa_elf_greg_t threadptr;
xtensa_elf_greg_t reserved[7+48];
xtensa_elf_greg_t ar[64];
} xtensa_elf_gregset_t;
};
#define XTENSA_ELF_NGREG (sizeof (xtensa_elf_gregset_t) \
/ sizeof (xtensa_elf_greg_t))

View file

@ -687,13 +687,13 @@ arm_linux_nat_target::can_use_hw_breakpoint (enum bptype type,
}
/* Enum describing the different types of ARM hardware break-/watch-points. */
typedef enum
enum arm_hwbp_type
{
arm_hwbp_break = 0,
arm_hwbp_load = 1,
arm_hwbp_store = 2,
arm_hwbp_access = 3
} arm_hwbp_type;
};
/* Type describing an ARM Hardware Breakpoint Control register value. */
using arm_hwbp_control_t = unsigned int;

View file

@ -350,7 +350,7 @@ using frv_elf_greg_t = unsigned char[4];
using frv_elf_gregset_t = struct { frv_elf_greg_t reg[FRV_ELF_NGREG]; };
using frv_elf_fpreg_t = unsigned char[4];
typedef struct
struct frv_elf_fpregset_t
{
frv_elf_fpreg_t fr[64];
frv_elf_fpreg_t fner[2];
@ -358,7 +358,7 @@ typedef struct
frv_elf_fpreg_t acc[8];
unsigned char accg[8];
frv_elf_fpreg_t fsr[1];
} frv_elf_fpregset_t;
};
/* Register maps. */

View file

@ -121,7 +121,7 @@
#if __DJGPP_MINOR__ < 3
/* This code will be provided from DJGPP 2.03 on. Until then I code it
here. */
typedef struct
struct NPXREG
{
unsigned short sig0;
unsigned short sig1;
@ -129,10 +129,9 @@ typedef struct
unsigned short sig3;
unsigned short exponent:15;
unsigned short sign:1;
}
NPXREG;
};
typedef struct
struct NPX
{
unsigned int control;
unsigned int status;
@ -142,8 +141,7 @@ typedef struct
unsigned int dataptr;
unsigned int datasel;
NPXREG reg[8];
}
NPX;
};
static NPX npx;
@ -184,10 +182,10 @@ load_npx (void)
}
/* ------------------------------------------------------------------------- */
/* Stubs for the missing redirection functions. */
typedef struct {
struct cmdline_t {
char *command;
int redirected;
} cmdline_t;
};
void
redir_cmdline_delete (cmdline_t *ptr)

View file

@ -40,11 +40,11 @@ using mn10300_elf_greg_t = gdb_byte [4];
using mn10300_elf_gregset_t = mn10300_elf_greg_t[MN10300_ELF_NGREG];
using mn10300_elf_fpreg_t = gdb_byte [4];
typedef struct
struct mn10300_elf_fpregset_t
{
mn10300_elf_fpreg_t fpregs[MN10300_ELF_NFPREG];
gdb_byte fpcr[4];
} mn10300_elf_fpregset_t;
};
/* elf_gregset_t register indices stolen from include/asm-mn10300/ptrace.h. */
#define MN10300_ELF_GREGSET_T_REG_INDEX_A3 0

View file

@ -29,7 +29,7 @@
/* Error codes of the library. */
typedef enum
enum td_err_e
{
TD_OK, /* No error. */
TD_ERR, /* No further specified error. */
@ -56,12 +56,12 @@ typedef enum
TD_NOTALLOC = TD_TLSDEFER,
TD_VERSION, /* Version if libpthread and libthread_db do not match. */
TD_NOTLS /* There is no TLS segment in the given module. */
} td_err_e;
};
/* Possible thread states. TD_THR_ANY_STATE is a pseudo-state used to
select threads regardless of state in td_ta_thr_iter(). */
typedef enum
enum td_thr_state_e
{
TD_THR_ANY_STATE,
TD_THR_UNKNOWN,
@ -71,16 +71,16 @@ typedef enum
TD_THR_ZOMBIE,
TD_THR_SLEEP,
TD_THR_STOPPED_ASLEEP
} td_thr_state_e;
};
/* Thread type: user or system. TD_THR_ANY_TYPE is a pseudo-type used
to select threads regardless of type in td_ta_thr_iter(). */
typedef enum
enum td_thr_type_e
{
TD_THR_ANY_TYPE,
TD_THR_USER,
TD_THR_SYSTEM
} td_thr_type_e;
};
/* Types of the debugging library. */
@ -151,7 +151,7 @@ typedef struct td_thr_events
#endif
/* Events reportable by the thread implementation. */
typedef enum
enum td_event_e
{
TD_ALL_EVENTS, /* Pseudo-event number. */
TD_EVENT_NONE = TD_ALL_EVENTS, /* Depends on context. */
@ -172,16 +172,16 @@ typedef enum
TD_MIN_EVENT_NUM = TD_READY,
TD_MAX_EVENT_NUM = TD_TIMEOUT,
TD_EVENTS_ENABLE = 31 /* Event reporting enabled. */
} td_event_e;
};
/* Values representing the different ways events are reported. */
typedef enum
enum td_notify_e
{
NOTIFY_BPT, /* User must insert breakpoint at u.bptaddr. */
NOTIFY_AUTOBPT, /* Breakpoint at u.bptaddr is automatically
inserted. */
NOTIFY_SYSCALL /* System call u.syscallno will be invoked. */
} td_notify_e;
};
/* Description how event type is reported. */
typedef struct td_notify
@ -209,12 +209,12 @@ typedef struct td_event_msg
} td_event_msg_t;
/* Structure containing event data available in each thread structure. */
typedef struct
struct td_eventbuf_t
{
td_thr_events_t eventmask; /* Mask of enabled events. */
td_event_e eventnum; /* Number of last event. */
void *eventdata; /* Data associated with event. */
} td_eventbuf_t;
};
/* Gathered statistics about the process. */

View file

@ -266,12 +266,11 @@ enum regnames
TICKS, STALLS, CYCLES, INSTS, PLR
};
typedef struct
struct stepData
{
short *memAddr;
short oldInstr;
}
stepData;
};
int registers[NUMREGBYTES / 4];
stepData instrBuffer;
@ -841,15 +840,14 @@ breakpoint (void)
/* SH1/SH2 exception vector table format */
typedef struct
struct vec_type
{
void (*func_cold) ();
int *stack_cold;
void (*func_warm) ();
int *stack_warm;
void (*(handler[256 - 4])) ();
}
vec_type;
};
/* vectable is the SH1/SH2 vector table. It must be at address 0
or wherever your vbr points. */

View file

@ -89,23 +89,23 @@ enum xtensa_target_flags_t
/* Mask. */
typedef struct
struct xtensa_reg_mask_t
{
int reg_num;
int bit_start;
int bit_size;
} xtensa_reg_mask_t;
};
typedef struct
struct xtensa_mask_t
{
int count;
xtensa_reg_mask_t *mask;
} xtensa_mask_t;
};
/* Xtensa register representation. */
typedef struct
struct xtensa_register_t
{
const char *name; /* Register name. */
int offset; /* Offset. */
@ -124,7 +124,7 @@ typedef struct
const xtensa_mask_t *mask; /* Register is a compilation of other regs. */
const char *fetch; /* Instruction sequence to fetch register. */
const char *store; /* Instruction sequence to store register. */
} xtensa_register_t;
};
/* For xtensa-config.c to expand to the structure above. */
#define XTREG(index,ofs,bsz,sz,al,tnum,flg,cp,ty,gr,name,fet,sto,mas,ct,x,y) \

View file

@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
typedef struct
struct xtensa_regtable_t
{
int gdb_regnum;
int gdb_offset;
@ -27,7 +27,7 @@ typedef struct
int coproc;
int dbnum;
const char *name;
} xtensa_regtable_t;
};
#define XTENSA_ELF_XTREG_SIZE 4

View file

@ -175,13 +175,13 @@ static struct
} arm_linux_hwbp_cap;
/* Enum describing the different types of ARM hardware break-/watch-points. */
typedef enum
enum arm_hwbp_type
{
arm_hwbp_break = 0,
arm_hwbp_load = 1,
arm_hwbp_store = 2,
arm_hwbp_access = 3
} arm_hwbp_type;
};
/* Type describing an ARM Hardware Breakpoint Control register value. */
using arm_hwbp_control_t = unsigned int;

View file

@ -104,7 +104,7 @@
#ifndef HAVE_ELF32_AUXV_T
/* Copied from glibc's elf.h. */
typedef struct
struct Elf32_auxv_t
{
uint32_t a_type; /* Entry type */
union
@ -114,12 +114,12 @@ typedef struct
though, since it does not work when using 32-bit definitions
on 64-bit platforms and vice versa. */
} a_un;
} Elf32_auxv_t;
};
#endif
#ifndef HAVE_ELF64_AUXV_T
/* Copied from glibc's elf.h. */
typedef struct
struct Elf64_auxv_t
{
uint64_t a_type; /* Entry type */
union
@ -129,7 +129,7 @@ typedef struct
though, since it does not work when using 32-bit definitions
on 64-bit platforms and vice versa. */
} a_un;
} Elf64_auxv_t;
};
#endif
/* See nat/linux-nat.h. */

View file

@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
typedef struct {
struct xtensa_regtable_t {
int gdb_regnum;
int gdb_offset;
int ptrace_cp_offset;
@ -26,7 +26,7 @@ typedef struct {
int coproc;
int dbnum;
char* name
;} xtensa_regtable_t;
;};
#define XTENSA_ELF_XTREG_SIZE 4

View file

@ -44,13 +44,13 @@ enum return_reason
#define RETURN_MASK(reason) (1 << (int)(-reason))
typedef enum
enum return_mask
{
RETURN_MASK_FORCED_QUIT = RETURN_MASK (RETURN_FORCED_QUIT),
RETURN_MASK_QUIT = RETURN_MASK (RETURN_QUIT),
RETURN_MASK_ERROR = RETURN_MASK (RETURN_ERROR),
RETURN_MASK_ALL = (RETURN_MASK_FORCED_QUIT | RETURN_MASK_QUIT | RETURN_MASK_ERROR)
} return_mask;
};
/* Describe all exceptions. */

View file

@ -72,7 +72,7 @@ extern "C" {
extern "C" {
/* Functions in this interface return one of these status codes. */
typedef enum
enum ps_err_e
{
PS_OK, /* Generic "call succeeded". */
PS_ERR, /* Generic error. */
@ -81,7 +81,7 @@ typedef enum
PS_BADADDR, /* Bad address. */
PS_NOSYM, /* Could not find given symbol. */
PS_NOFREGS /* FPU register set not available for given LWP. */
} ps_err_e;
};
#ifndef HAVE_LWPID_T
using lwpid_t = unsigned int;