register. */
static struct value *
-value_of_nds32_reg (struct frame_info *frame, const void *baton)
+value_of_nds32_reg (frame_info_ptr frame, const void *baton)
{
return value_of_register ((int) (intptr_t) baton, frame);
}
static int
nds32_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int num)
{
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
const int FSR = 38;
const int FDR = FSR + 32;
/* The NDS32 reggroup contains registers whose name is prefixed
by reggroup name. */
reg_name = gdbarch_register_name (gdbarch, regnum);
- group_name = reggroup_name (reggroup);
+ group_name = reggroup->name ();
return !strncmp (reg_name, group_name, strlen (group_name));
}
\f
regnum -= gdbarch_num_regs (gdbarch);
/* Currently, only FSRs could be defined as pseudo registers. */
- if (regnum < gdbarch_num_pseudo_regs (gdbarch))
- return nds32_fsr_register_names[regnum];
-
- warning (_("Unknown nds32 pseudo register %d."), regnum);
- return NULL;
+ gdb_assert (regnum < gdbarch_num_pseudo_regs (gdbarch));
+ return nds32_fsr_register_names[regnum];
}
/* Implement the "pseudo_register_read" gdbarch method. */
readable_regcache *regcache, int regnum,
gdb_byte *buf)
{
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_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)
{
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_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)
{
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
/* Current scanning status. */
int in_prologue_bb = 0;
a pointer to the current nds32_frame_cache in *THIS_CACHE. */
static struct nds32_frame_cache *
-nds32_frame_cache (struct frame_info *this_frame, void **this_cache)
+nds32_frame_cache (frame_info_ptr this_frame, void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct nds32_frame_cache *cache;
PC and the caller's SP when we were called. */
static void
-nds32_frame_this_id (struct frame_info *this_frame,
+nds32_frame_this_id (frame_info_ptr this_frame,
void **this_cache, struct frame_id *this_id)
{
struct nds32_frame_cache *cache = nds32_frame_cache (this_frame, this_cache);
/* Implement the "prev_register" frame_unwind method. */
static struct value *
-nds32_frame_prev_register (struct frame_info *this_frame, void **this_cache,
+nds32_frame_prev_register (frame_info_ptr this_frame, void **this_cache,
int regnum)
{
struct nds32_frame_cache *cache = nds32_frame_cache (this_frame, this_cache);
/* Return the frame base address of *THIS_FRAME. */
static CORE_ADDR
-nds32_frame_base_address (struct frame_info *this_frame, void **this_cache)
+nds32_frame_base_address (frame_info_ptr this_frame, void **this_cache)
{
struct nds32_frame_cache *cache = nds32_frame_cache (this_frame, this_cache);
nds32_analyze_epilogue (struct gdbarch *gdbarch, CORE_ADDR pc,
struct nds32_frame_cache *cache)
{
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_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)
{
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
int insn_type = INSN_NORMAL;
int ret_found = 0;
static int
nds32_epilogue_frame_sniffer (const struct frame_unwind *self,
- struct frame_info *this_frame, void **this_cache)
+ frame_info_ptr this_frame, void **this_cache)
{
if (frame_relative_level (this_frame) == 0)
return nds32_stack_frame_destroyed_p (get_frame_arch (this_frame),
*THIS_CACHE. */
static struct nds32_frame_cache *
-nds32_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
+nds32_epilogue_frame_cache (frame_info_ptr this_frame, void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct nds32_frame_cache *cache;
/* Implement the "this_id" frame_unwind method. */
static void
-nds32_epilogue_frame_this_id (struct frame_info *this_frame,
+nds32_epilogue_frame_this_id (frame_info_ptr this_frame,
void **this_cache, struct frame_id *this_id)
{
struct nds32_frame_cache *cache
/* Implement the "prev_register" frame_unwind method. */
static struct value *
-nds32_epilogue_frame_prev_register (struct frame_info *this_frame,
+nds32_epilogue_frame_prev_register (frame_info_ptr this_frame,
void **this_cache, int regnum)
{
struct nds32_frame_cache *cache
int i;
ULONGEST regval;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_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);
if (align == 0)
continue;
- sp -= TYPE_LENGTH (type);
+ sp -= type->length ();
sp = align_down (sp, align);
}
type = value_type (args[i]);
calling_use_fpr = nds32_check_calling_use_fpr (type);
- len = TYPE_LENGTH (type);
+ len = type->length ();
align = type_align (type);
val = value_contents (args[i]).data ();
break;
default:
/* Long double? */
- internal_error (__FILE__, __LINE__,
- "Do not know how to handle %d-byte double.\n",
+ internal_error ("Do not know how to handle %d-byte double.\n",
len);
break;
}
struct regcache *regcache, gdb_byte *valbuf)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
int calling_use_fpr;
int len;
calling_use_fpr = nds32_check_calling_use_fpr (type);
- len = TYPE_LENGTH (type);
+ len = type->length ();
if (abi_use_fpr && calling_use_fpr)
{
else if (len == 8)
regcache->cooked_read (NDS32_FD0_REGNUM, valbuf);
else
- internal_error (__FILE__, __LINE__,
- _("Cannot extract return value of %d bytes "
+ internal_error (_("Cannot extract return value of %d bytes "
"long floating-point."), len);
}
else
struct regcache *regcache, const gdb_byte *valbuf)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+ nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
int calling_use_fpr;
int len;
calling_use_fpr = nds32_check_calling_use_fpr (type);
- len = TYPE_LENGTH (type);
+ len = type->length ();
if (abi_use_fpr && calling_use_fpr)
{
else if (len == 8)
regcache->cooked_write (NDS32_FD0_REGNUM, valbuf);
else
- internal_error (__FILE__, __LINE__,
- _("Cannot store return value of %d bytes "
+ internal_error (_("Cannot store return value of %d bytes "
"long floating-point."), len);
}
else
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
- if (TYPE_LENGTH (type) > 8)
+ if (type->length () > 8)
{
return RETURN_VALUE_STRUCT_CONVENTION;
}
/* Implement the "get_longjmp_target" gdbarch method. */
static int
-nds32_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
+nds32_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc)
{
gdb_byte buf[4];
CORE_ADDR jb_addr;
best_arch = gdbarch_list_lookup_by_info (best_arch->next, &info))
{
nds32_gdbarch_tdep *idep
- = (nds32_gdbarch_tdep *) gdbarch_tdep (best_arch->gdbarch);
+ = gdbarch_tdep<nds32_gdbarch_tdep> (best_arch->gdbarch);
if (idep->elf_abi != elf_abi)
continue;
{
const char *regname = gdbarch_register_name (gdbarch, j);
- if (regname != NULL
- && strcmp (regname, nds32_register_aliases[i].name) == 0)
+ if (strcmp (regname, nds32_register_aliases[i].name) == 0)
{
regnum = j;
break;
_initialize_nds32_tdep ()
{
/* Initialize gdbarch. */
- register_gdbarch_init (bfd_arch_nds32, nds32_gdbarch_init);
+ gdbarch_register (bfd_arch_nds32, nds32_gdbarch_init);
initialize_tdesc_nds32 ();
nds32_init_reggroups ();