/* Target-dependent code for FT32.
- Copyright (C) 2009-2021 Free Software Foundation, Inc.
+ Copyright (C) 2009-2022 Free Software Foundation, Inc.
This file is part of GDB.
ft32_register_type (struct gdbarch *gdbarch, int reg_nr)
{
if (reg_nr == FT32_PC_REGNUM)
- return gdbarch_tdep (gdbarch)->pc_type;
+ {
+ ft32_gdbarch_tdep *tdep = (ft32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ return tdep->pc_type;
+ }
else if (reg_nr == FT32_SP_REGNUM || reg_nr == FT32_FP_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr;
else
ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
struct gdbarch *gdbarch;
- struct gdbarch_tdep *tdep;
struct type *void_type;
struct type *func_void_type;
return arches->gdbarch;
/* Allocate space for the new architecture. */
- tdep = XCNEW (struct gdbarch_tdep);
+ ft32_gdbarch_tdep *tdep = new ft32_gdbarch_tdep;
gdbarch = gdbarch_alloc (&info, tdep);
/* Create a type for PC. We can't use builtin types here, as they may not