diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-11-15 11:29:39 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-11-15 11:29:39 -0500 |
commit | 345bd07cce33565f1cd66acabdaf387ca3a7ccb3 (patch) | |
tree | bfa86d2102817e06235193c865d2580e802d0a1a /gdb/rs6000-tdep.c | |
parent | eae06bb301512a21277dd48a4bff025c4dceda9e (diff) | |
download | gdb-345bd07cce33565f1cd66acabdaf387ca3a7ccb3.zip gdb-345bd07cce33565f1cd66acabdaf387ca3a7ccb3.tar.gz gdb-345bd07cce33565f1cd66acabdaf387ca3a7ccb3.tar.bz2 |
gdb: fix gdbarch_tdep ODR violation
I would like to be able to use non-trivial types in gdbarch_tdep types.
This is not possible at the moment (in theory), because of the one
definition rule.
To allow it, rename all gdbarch_tdep types to <arch>_gdbarch_tdep, and
make them inherit from a gdbarch_tdep base class. The inheritance is
necessary to be able to pass pointers to all these <arch>_gdbarch_tdep
objects to gdbarch_alloc, which takes a pointer to gdbarch_tdep.
These objects are never deleted through a base class pointer, so I
didn't include a virtual destructor. In the future, if gdbarch objects
deletable, I could imagine that the gdbarch_tdep objects could become
owned by the gdbarch objects, and then it would become useful to have a
virtual destructor (so that the gdbarch object can delete the owned
gdbarch_tdep object). But that's not necessary right now.
It turns out that RISC-V already has a gdbarch_tdep that is
non-default-constructible, so that provides a good motivation for this
change.
Most changes are fairly straightforward, mostly needing to add some
casts all over the place. There is however the xtensa architecture,
doing its own little weird thing to define its gdbarch_tdep. I did my
best to adapt it, but I can't test those changes.
Change-Id: Ic001903f91ddd106bd6ca09a79dabe8df2d69f3b
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r-- | gdb/rs6000-tdep.c | 121 |
1 files changed, 60 insertions, 61 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 4830ed2..0d61894 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -209,7 +209,7 @@ struct rs6000_framedata int vsx_register_p (struct gdbarch *gdbarch, int regno) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (tdep->ppc_vsr0_regnum < 0) return 0; else @@ -221,7 +221,7 @@ vsx_register_p (struct gdbarch *gdbarch, int regno) int altivec_register_p (struct gdbarch *gdbarch, int regno) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (tdep->ppc_vr0_regnum < 0 || tdep->ppc_vrsave_regnum < 0) return 0; else @@ -233,7 +233,7 @@ altivec_register_p (struct gdbarch *gdbarch, int regno) int spe_register_p (struct gdbarch *gdbarch, int regno) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); /* Is it a reference to EV0 -- EV31, and do we have those? */ if (IS_SPE_PSEUDOREG (tdep, regno)) @@ -265,7 +265,7 @@ spe_register_p (struct gdbarch *gdbarch, int regno) int ppc_floating_point_unit_p (struct gdbarch *gdbarch) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); return (tdep->ppc_fp0_regnum >= 0 && tdep->ppc_fpscr_regnum >= 0); @@ -276,7 +276,7 @@ ppc_floating_point_unit_p (struct gdbarch *gdbarch) int ppc_altivec_support_p (struct gdbarch *gdbarch) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); return (tdep->ppc_vr0_regnum >= 0 && tdep->ppc_vrsave_regnum >= 0); @@ -305,7 +305,7 @@ set_sim_regno (int *table, int gdb_regno, int sim_regno) static void init_sim_regno_table (struct gdbarch *arch) { - struct gdbarch_tdep *tdep = gdbarch_tdep (arch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (arch); int total_regs = gdbarch_num_regs (arch); int *sim_regno = GDBARCH_OBSTACK_CALLOC (arch, total_regs, int); int i; @@ -399,7 +399,7 @@ init_sim_regno_table (struct gdbarch *arch) static int rs6000_register_sim_regno (struct gdbarch *gdbarch, int reg) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int sim_regno; if (tdep->sim_regno == NULL) @@ -470,7 +470,7 @@ ppc_collect_reg (const struct regcache *regcache, int regnum, static int ppc_greg_offset (struct gdbarch *gdbarch, - struct gdbarch_tdep *tdep, + ppc_gdbarch_tdep *tdep, const struct ppc_reg_offsets *offsets, int regnum, int *regsize) @@ -507,7 +507,7 @@ ppc_greg_offset (struct gdbarch *gdbarch, } static int -ppc_fpreg_offset (struct gdbarch_tdep *tdep, +ppc_fpreg_offset (ppc_gdbarch_tdep *tdep, const struct ppc_reg_offsets *offsets, int regnum) { @@ -530,7 +530,7 @@ ppc_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { struct gdbarch *gdbarch = regcache->arch (); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); const struct ppc_reg_offsets *offsets = (const struct ppc_reg_offsets *) regset->regmap; size_t offset; @@ -580,14 +580,13 @@ ppc_supply_fpregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *fpregs, size_t len) { struct gdbarch *gdbarch = regcache->arch (); - struct gdbarch_tdep *tdep; const struct ppc_reg_offsets *offsets; size_t offset; if (!ppc_floating_point_unit_p (gdbarch)) return; - tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); offsets = (const struct ppc_reg_offsets *) regset->regmap; if (regnum == -1) { @@ -620,7 +619,7 @@ ppc_collect_gregset (const struct regset *regset, int regnum, void *gregs, size_t len) { struct gdbarch *gdbarch = regcache->arch (); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); const struct ppc_reg_offsets *offsets = (const struct ppc_reg_offsets *) regset->regmap; size_t offset; @@ -671,14 +670,13 @@ ppc_collect_fpregset (const struct regset *regset, int regnum, void *fpregs, size_t len) { struct gdbarch *gdbarch = regcache->arch (); - struct gdbarch_tdep *tdep; const struct ppc_reg_offsets *offsets; size_t offset; if (!ppc_floating_point_unit_p (gdbarch)) return; - tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); offsets = (const struct ppc_reg_offsets *) regset->regmap; if (regnum == -1) { @@ -756,7 +754,7 @@ static int rs6000_in_function_epilogue_frame_p (struct frame_info *curfrm, struct gdbarch *gdbarch, CORE_ADDR pc) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte insn_buf[PPC_INSN_SIZE]; CORE_ADDR scan_pc, func_start, func_end, epilogue_start, epilogue_end; @@ -1052,8 +1050,9 @@ ppc_displaced_step_fixup (struct gdbarch *gdbarch, if (insn & 0x1) { /* Link register needs to be set to the next instruction's PC. */ + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); regcache_cooked_write_unsigned (regs, - gdbarch_tdep (gdbarch)->ppc_lr_regnum, + tdep->ppc_lr_regnum, from + PPC_INSN_SIZE); displaced_debug_printf ("(ppc) adjusted LR to %s", paddress (gdbarch, from + PPC_INSN_SIZE)); @@ -1599,7 +1598,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, int num_skip_non_prologue_insns = 0; int r0_contains_arg = 0; const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (gdbarch); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); memset (fdata, 0, sizeof (struct rs6000_framedata)); @@ -2319,7 +2318,7 @@ static CORE_ADDR rs6000_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) { struct gdbarch *gdbarch = get_frame_arch (frame); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); unsigned int ii, op; int rel; @@ -2377,7 +2376,7 @@ rs6000_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) static struct type * rs6000_builtin_type_vec64 (struct gdbarch *gdbarch) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (!tdep->ppc_builtin_type_vec64) { @@ -2422,7 +2421,7 @@ rs6000_builtin_type_vec64 (struct gdbarch *gdbarch) static struct type * rs6000_builtin_type_vec128 (struct gdbarch *gdbarch) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (!tdep->ppc_builtin_type_vec128) { @@ -2476,7 +2475,7 @@ rs6000_builtin_type_vec128 (struct gdbarch *gdbarch) static const char * rs6000_register_name (struct gdbarch *gdbarch, int regno) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); /* The upper half "registers" have names in the XML description, but we present only the low GPRs and the full 64-bit registers @@ -2614,7 +2613,7 @@ rs6000_register_name (struct gdbarch *gdbarch, int regno) static struct type * rs6000_pseudo_register_type (struct gdbarch *gdbarch, int regnum) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); /* These are the e500 pseudo-registers. */ if (IS_SPE_PSEUDOREG (tdep, regnum)) @@ -2653,7 +2652,7 @@ static int rs6000_pseudo_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *group) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (IS_V_ALIAS_PSEUDOREG (tdep, regnum)) return 0; @@ -2668,7 +2667,7 @@ static int rs6000_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); return (tdep->ppc_fp0_regnum >= 0 && regnum >= tdep->ppc_fp0_regnum @@ -2753,7 +2752,7 @@ e500_move_ev_register (move_ev_register_func move, struct regcache *regcache, int ev_reg, void *buffer) { struct gdbarch *arch = regcache->arch (); - struct gdbarch_tdep *tdep = gdbarch_tdep (arch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (arch); int reg_index; gdb_byte *byte_buffer = (gdb_byte *) buffer; enum register_status status; @@ -2794,7 +2793,7 @@ e500_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int ev_reg, gdb_byte *buffer) { struct gdbarch *arch = regcache->arch (); - struct gdbarch_tdep *tdep = gdbarch_tdep (arch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index; enum register_status status; @@ -2835,7 +2834,7 @@ static enum register_status dfp_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int reg_nr, gdb_byte *buffer) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, fp0; enum register_status status; @@ -2875,7 +2874,7 @@ static void dfp_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const gdb_byte *buffer) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, fp0; if (IS_DFP_PSEUDOREG (tdep, reg_nr)) @@ -2912,7 +2911,7 @@ v_alias_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int reg_nr, gdb_byte *buffer) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); gdb_assert (IS_V_ALIAS_PSEUDOREG (tdep, reg_nr)); return regcache->raw_read (tdep->ppc_vr0_regnum @@ -2927,7 +2926,7 @@ v_alias_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const gdb_byte *buffer) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); gdb_assert (IS_V_ALIAS_PSEUDOREG (tdep, reg_nr)); regcache->raw_write (tdep->ppc_vr0_regnum @@ -2939,7 +2938,7 @@ static enum register_status vsx_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int reg_nr, gdb_byte *buffer) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, vr0, fp0, vsr0_upper; enum register_status status; @@ -2987,7 +2986,7 @@ static void vsx_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const gdb_byte *buffer) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, vr0, fp0, vsr0_upper; if (IS_VSX_PSEUDOREG (tdep, reg_nr)) @@ -3029,7 +3028,7 @@ static enum register_status efp_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int reg_nr, gdb_byte *buffer) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, vr0; if (IS_EFP_PSEUDOREG (tdep, reg_nr)) @@ -3058,7 +3057,7 @@ static void efp_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const gdb_byte *buffer) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, vr0; int offset = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; @@ -3094,7 +3093,7 @@ rs6000_pseudo_register_read (struct gdbarch *gdbarch, int reg_nr, gdb_byte *buffer) { struct gdbarch *regcache_arch = regcache->arch (); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); gdb_assert (regcache_arch == gdbarch); @@ -3125,7 +3124,7 @@ rs6000_pseudo_register_write (struct gdbarch *gdbarch, int reg_nr, const gdb_byte *buffer) { struct gdbarch *regcache_arch = regcache->arch (); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); gdb_assert (regcache_arch == gdbarch); @@ -3156,7 +3155,7 @@ static void dfp_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg_nr) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, fp0; if (IS_DFP_PSEUDOREG (tdep, reg_nr)) @@ -3183,7 +3182,7 @@ static void v_alias_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg_nr) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); gdb_assert (IS_V_ALIAS_PSEUDOREG (tdep, reg_nr)); ax_reg_mask (ax, tdep->ppc_vr0_regnum @@ -3197,7 +3196,7 @@ static void vsx_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg_nr) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, vr0, fp0, vsr0_upper; if (IS_VSX_PSEUDOREG (tdep, reg_nr)) @@ -3235,7 +3234,7 @@ static void efp_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg_nr) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int reg_index, vr0; if (IS_EFP_PSEUDOREG (tdep, reg_nr)) @@ -3258,7 +3257,7 @@ static int rs6000_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg_nr) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (IS_SPE_PSEUDOREG (tdep, reg_nr)) { int reg_index = reg_nr - tdep->ppc_ev0_regnum; @@ -3298,7 +3297,7 @@ rs6000_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); value->type = register_type (gdbarch, tdep->ppc_lr_regnum); value->kind = axs_lvalue_register; value->u.reg = tdep->ppc_lr_regnum; @@ -3309,7 +3308,7 @@ rs6000_gen_return_address (struct gdbarch *gdbarch, static int rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (0 <= num && num <= 31) return tdep->ppc_gp0_regnum + num; @@ -3351,7 +3350,7 @@ rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num) static int rs6000_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int num) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (0 <= num && num <= 31) return tdep->ppc_gp0_regnum + num; @@ -3570,7 +3569,7 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache) { struct rs6000_frame_cache *cache; struct gdbarch *gdbarch = get_frame_arch (this_frame); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct rs6000_framedata fdata; int wordsize = tdep->wordsize; @@ -3806,7 +3805,7 @@ rs6000_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache) { struct rs6000_frame_cache *cache; struct gdbarch *gdbarch = get_frame_arch (this_frame); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (*this_cache) return (struct rs6000_frame_cache *) *this_cache; @@ -3927,7 +3926,7 @@ ppc_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, struct frame_info *this_frame) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); /* PPC32 and PPC64 ABI's are the same regarding volatile and non-volatile registers. We will use the same code for both. */ @@ -4139,7 +4138,7 @@ bfd_uses_spe_extensions (bfd *abfd) Otherwise, it's just a VR register. Record them accordingly. */ static int -ppc_record_vsr (struct regcache *regcache, struct gdbarch_tdep *tdep, int vsr) +ppc_record_vsr (struct regcache *regcache, ppc_gdbarch_tdep *tdep, int vsr) { if (vsr < 0 || vsr >= 64) return -1; @@ -4168,7 +4167,7 @@ static int ppc_process_record_op4 (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr, uint32_t insn) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int ext = PPC_FIELD (insn, 21, 11); int vra = PPC_FIELD (insn, 11, 5); @@ -4541,7 +4540,7 @@ static int ppc_process_record_op19 (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr, uint32_t insn) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int ext = PPC_EXTOP (insn); switch (ext & 0x01f) @@ -4593,7 +4592,7 @@ static int ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr, uint32_t insn) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int ext = PPC_EXTOP (insn); int tmp, nr, nb, i; CORE_ADDR at_dcsz, ea = 0; @@ -5190,7 +5189,7 @@ static int ppc_process_record_op59 (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr, uint32_t insn) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int ext = PPC_EXTOP (insn); switch (ext & 0x1f) @@ -5284,7 +5283,7 @@ static int ppc_process_record_op60 (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr, uint32_t insn) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int ext = PPC_EXTOP (insn); switch (ext >> 2) @@ -5646,7 +5645,7 @@ static int ppc_process_record_op61 (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr, uint32_t insn) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); ULONGEST ea = 0; int size; @@ -5705,7 +5704,7 @@ static int ppc_process_record_op63 (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr, uint32_t insn) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); int ext = PPC_EXTOP (insn); int tmp; @@ -5964,7 +5963,7 @@ int ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); uint32_t insn; int op6, tmp, i; @@ -6267,7 +6266,6 @@ static struct gdbarch * rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; - struct gdbarch_tdep *tdep; int wordsize, from_xcoff_exec, from_elf_exec; enum bfd_architecture arch; unsigned long mach; @@ -6953,7 +6951,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Word size in the various PowerPC bfd_arch_info structs isn't meaningful, because 64-bit CPUs can run in 32-bit mode. So, perform separate word size check. */ - tdep = gdbarch_tdep (arches->gdbarch); + ppc_gdbarch_tdep *tdep + = (ppc_gdbarch_tdep *) gdbarch_tdep (arches->gdbarch); if (tdep && tdep->elf_abi != elf_abi) continue; if (tdep && tdep->soft_float != soft_float) @@ -6974,7 +6973,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - "set arch" trust blindly - GDB startup useless but harmless */ - tdep = XCNEW (struct gdbarch_tdep); + ppc_gdbarch_tdep *tdep = new ppc_gdbarch_tdep; tdep->wordsize = wordsize; tdep->elf_abi = elf_abi; tdep->soft_float = soft_float; @@ -7253,7 +7252,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) static void rs6000_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + ppc_gdbarch_tdep *tdep = (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (tdep == NULL) return; |