/* Supply vr0~vr15. */
for (i = 0; i < 16; i ++)
{
- if (gdbarch_register_name (gdbarch, (CSKY_VR0_REGNUM + i)))
+ if (*gdbarch_register_name (gdbarch, (CSKY_VR0_REGNUM + i)) != '\0')
{
offset = 16 * i;
regcache->raw_supply (CSKY_VR0_REGNUM + i, fregs + offset);
/* Supply fr0~fr15. */
for (i = 0; i < 16; i ++)
{
- if (gdbarch_register_name (gdbarch, (CSKY_FR0_REGNUM + i)))
+ if (*gdbarch_register_name (gdbarch, (CSKY_FR0_REGNUM + i)) != '\0')
{
offset = 16 * i;
regcache->raw_supply (CSKY_FR0_REGNUM + i, fregs + offset);
/* Supply fr16~fr31. */
for (i = 0; i < 16; i ++)
{
- if (gdbarch_register_name (gdbarch, (CSKY_FR16_REGNUM + i)))
+ if (*gdbarch_register_name (gdbarch, (CSKY_FR16_REGNUM + i)) != '\0')
{
offset = (16 * 16) + (8 * i);
regcache->raw_supply (CSKY_FR16_REGNUM + i, fregs + offset);
/* Supply fcr, fesr, fid. */
for (i = 0; i < 3; i ++)
{
- if (gdbarch_register_name (gdbarch, fcr_regno[i]))
+ if (*gdbarch_register_name (gdbarch, fcr_regno[i]) != '\0')
{
offset = (16 * 16) + (16 * 8) + (4 * i);
regcache->raw_supply (fcr_regno[i], fregs + offset);
/* Supply vr0~vr15. */
for (i = 0; i < 16; i ++)
{
- if (gdbarch_register_name (gdbarch, (CSKY_VR0_REGNUM + i)))
+ if (*gdbarch_register_name (gdbarch, (CSKY_VR0_REGNUM + i)) != '\0')
{
offset = 16 * i;
regcache ->raw_collect (CSKY_VR0_REGNUM + i, fregs + offset);
/* Supply fr16~fr31. */
for (i = 0; i < 16; i ++)
{
- if (gdbarch_register_name (gdbarch, (CSKY_FR16_REGNUM + i)))
+ if (*gdbarch_register_name (gdbarch, (CSKY_FR16_REGNUM + i)) != '\0')
{
offset = (16 * 16) + (8 * i);
regcache ->raw_collect (CSKY_FR16_REGNUM + i, fregs + offset);
/* Supply fcr, fesr, fid. */
for (i = 0; i < 3; i ++)
{
- if (gdbarch_register_name (gdbarch, fcr_regno[i]))
+ if (*gdbarch_register_name (gdbarch, fcr_regno[i]) != '\0')
{
offset = (16 * 16) + (16 * 8) + (4 * i);
regcache ->raw_collect (fcr_regno[i], fregs + offset);
static const char *
csky_register_name (struct gdbarch *gdbarch, int reg_nr)
{
- int num_regs = gdbarch_num_regs (gdbarch);
- int num_pseudo_regs = gdbarch_num_pseudo_regs (gdbarch);
-
- if ((reg_nr >= num_regs) && (reg_nr < (num_regs + num_pseudo_regs)))
+ if (reg_nr >= gdbarch_num_regs (gdbarch))
return csky_pseudo_register_name (gdbarch, reg_nr);
if (tdesc_has_registers (gdbarch_target_desc (gdbarch)))
return tdesc_register_name (gdbarch, reg_nr);
- if (reg_nr < 0)
- return NULL;
-
- if (reg_nr >= gdbarch_num_regs (gdbarch))
- return NULL;
-
return csky_register_names[reg_nr];
}
if (regno < tdep->fv_pseudo_registers_count)
{
if ((regno < 64) && ((regno % 4) >= 2) && !tdep->has_vr0)
- return NULL;
+ return "";
else if ((regno >= 64) && ((regno % 4) >= 2))
- return NULL;
+ return "";
else
return fv_pseudo_names[regno];
}
}
- return NULL;
+ return "";
}
/* Read for csky pseudo regs. */