/* Target-dependent code for SPARC.
- Copyright (C) 2003-2021 Free Software Foundation, Inc.
+ Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.
static struct type *
sparc_psr_type (struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ sparc_gdbarch_tdep *tdep = (sparc_gdbarch_tdep *) gdbarch_tdep (gdbarch);
if (!tdep->sparc_psr_type)
{
static struct type *
sparc_fsr_type (struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ sparc_gdbarch_tdep *tdep = (sparc_gdbarch_tdep *) gdbarch_tdep (gdbarch);
if (!tdep->sparc_fsr_type)
{
correct, and wasting a few bytes shouldn't be a problem. */
sp &= ~0x7;
- write_memory (sp, value_contents (args[i]), len);
+ write_memory (sp, value_contents (args[i]).data (), len);
args[i] = value_from_pointer (lookup_pointer_type (type), sp);
num_elements++;
}
for (i = 0; i < nargs; i++)
{
- const bfd_byte *valbuf = value_contents (args[i]);
+ const bfd_byte *valbuf = value_contents (args[i]).data ();
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
gdb_byte buf[4];
sparc_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
CORE_ADDR current_pc, struct sparc_frame_cache *cache)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ sparc_gdbarch_tdep *tdep = (sparc_gdbarch_tdep *) gdbarch_tdep (gdbarch);
unsigned long insn;
int offset = 0;
int dest = -1;
static const struct frame_unwind sparc32_frame_unwind =
{
+ "sparc32 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
sparc32_frame_this_id,
struct frame_info *frame = get_current_frame ();
/* Trap instruction (TRAP). */
- return gdbarch_tdep (regcache->arch ())->step_trap (frame,
- insn);
+ gdbarch *arch = regcache->arch ();
+ sparc_gdbarch_tdep *tdep = (sparc_gdbarch_tdep *) gdbarch_tdep (arch);
+ return tdep->step_trap (frame, insn);
}
/* FIXME: Handle DONE and RETRY instructions. */
sparc_software_single_step (struct regcache *regcache)
{
struct gdbarch *arch = regcache->arch ();
- struct gdbarch_tdep *tdep = gdbarch_tdep (arch);
+ sparc_gdbarch_tdep *tdep = (sparc_gdbarch_tdep *) gdbarch_tdep (arch);
CORE_ADDR npc, nnpc;
CORE_ADDR pc, orig_npc;
static void
sparc_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
+ gdbarch *arch = regcache->arch ();
+ sparc_gdbarch_tdep *tdep = (sparc_gdbarch_tdep *) gdbarch_tdep (arch);
regcache_cooked_write_unsigned (regcache, tdep->pc_regnum, pc);
regcache_cooked_write_unsigned (regcache, tdep->npc_regnum, pc + 4);
void *cb_data,
const struct regcache *regcache)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ sparc_gdbarch_tdep *tdep = (sparc_gdbarch_tdep *) gdbarch_tdep (gdbarch);
cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, tdep->gregset, NULL,
cb_data);
static struct gdbarch *
sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
- struct gdbarch_tdep *tdep;
const struct target_desc *tdesc = info.target_desc;
struct gdbarch *gdbarch;
int valid_p = 1;
return arches->gdbarch;
/* Allocate space for the new architecture. */
- tdep = XCNEW (struct gdbarch_tdep);
+ sparc_gdbarch_tdep *tdep = new sparc_gdbarch_tdep;
gdbarch = gdbarch_alloc (&info, tdep);
tdep->pc_regnum = SPARC32_PC_REGNUM;