/* Target-dependent code for the NDS32 architecture, for GDB.
- Copyright (C) 2013-2020 Free Software Foundation, Inc.
+ Copyright (C) 2013-2022 Free Software Foundation, Inc.
Contributed by Andes Technology Corporation.
This file is part of GDB.
static int
nds32_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int num)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
const int FSR = 38;
const int FDR = FSR + 32;
readable_regcache *regcache, int regnum,
gdb_byte *buf)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
gdb_byte reg_buf[8];
int offset, fdr_regnum;
enum register_status status;
struct regcache *regcache, int regnum,
const gdb_byte *buf)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
gdb_byte reg_buf[8];
int offset, fdr_regnum;
nds32_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
CORE_ADDR limit_pc, struct nds32_frame_cache *cache)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
/* Current scanning status. */
int in_prologue_bb = 0;
static const struct frame_unwind nds32_frame_unwind =
{
+ "nds32 prologue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
nds32_frame_this_id,
nds32_analyze_epilogue (struct gdbarch *gdbarch, CORE_ADDR pc,
struct nds32_frame_cache *cache)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
CORE_ADDR limit_pc;
uint32_t insn, insn_len;
static int
nds32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
int insn_type = INSN_NORMAL;
int ret_found = 0;
static const struct frame_unwind nds32_epilogue_frame_unwind =
{
+ "nds32 epilogue",
NORMAL_FRAME,
default_frame_unwind_stop_reason,
nds32_epilogue_frame_this_id,
int i;
ULONGEST regval;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
struct type *func_type = value_type (function);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
int abi_split = nds32_abi_split (tdep->elf_abi);
calling_use_fpr = nds32_check_calling_use_fpr (type);
len = TYPE_LENGTH (type);
align = type_align (type);
- val = value_contents (args[i]);
+ val = value_contents (args[i]).data ();
/* The size of a composite type larger than 4 bytes will be rounded
up to the nearest multiple of 4. */
struct regcache *regcache, gdb_byte *valbuf)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
int calling_use_fpr;
int len;
struct regcache *regcache, const gdb_byte *valbuf)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
int calling_use_fpr;
int len;
nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
struct gdbarch *gdbarch;
- struct gdbarch_tdep *tdep;
struct gdbarch_list *best_arch;
tdesc_arch_data_up tdesc_data;
const struct target_desc *tdesc = info.target_desc;
best_arch != NULL;
best_arch = gdbarch_list_lookup_by_info (best_arch->next, &info))
{
- struct gdbarch_tdep *idep = gdbarch_tdep (best_arch->gdbarch);
+ nds32_gdbarch_tdep *idep
+ = (nds32_gdbarch_tdep *) gdbarch_tdep (best_arch->gdbarch);
if (idep->elf_abi != elf_abi)
continue;
return NULL;
/* Allocate space for the new architecture. */
- tdep = XCNEW (struct gdbarch_tdep);
+ nds32_gdbarch_tdep *tdep = new nds32_gdbarch_tdep;
tdep->fpu_freg = fpu_freg;
tdep->use_pseudo_fsrs = use_pseudo_fsrs;
tdep->fs0_regnum = -1;