From: Kevin Buettner Date: Fri, 7 Nov 2003 05:54:51 +0000 (+0000) Subject: Handle iacc0 as a pseudo-register. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a748db69096274011b24f2b131fe3cc1ab3eb81;p=binutils-gdb.git Handle iacc0 as a pseudo-register. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 67bfb476a19..41dc14c02b5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2003-11-06 Kevin Buettner + + * frv-tdep.c (first_pseudo_regnum, iacc0_regnum, frv_num_pseudo_regs): + Define. + (new_variant): Set name for iacc0_regnum. + (frv_register_name): Accommodate pseudo-registers. + (frv_register_type): Add case for iacc0_regnum. + (frv_pseudo_register_read, frv_pseudo_register_write): New functions. + (frv_gdbarch_init): Set number of pseudo registers. Establish + pseudo-register read/write methods. + 2003-11-06 Andrew Cagney * valops.c (destructor_name_p): Replace STREQN with strncmp. diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index e184f4de8a5..31e070387c7 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -85,7 +85,16 @@ enum { last_spr_regnum = 148, /* The total number of registers we know exist. */ - frv_num_regs = last_spr_regnum + 1 + frv_num_regs = last_spr_regnum + 1, + + /* Pseudo registers */ + first_pseudo_regnum = frv_num_regs, + + /* iacc0 - the 64-bit concatenation of iacc0h and iacc0l. */ + iacc0_regnum = first_pseudo_regnum + 0, + + last_pseudo_regnum = iacc0_regnum, + frv_num_pseudo_regs = last_pseudo_regnum + first_pseudo_regnum + 1, }; static LONGEST frv_call_dummy_words[] = @@ -161,8 +170,10 @@ new_variant (void) /* By default, don't supply any general-purpose or floating-point register names. */ - var->register_names = (char **) xmalloc (frv_num_regs * sizeof (char *)); - for (r = 0; r < frv_num_regs; r++) + var->register_names + = (char **) xmalloc ((frv_num_regs + frv_num_pseudo_regs) + * sizeof (char *)); + for (r = 0; r < frv_num_regs + frv_num_pseudo_regs; r++) var->register_names[r] = ""; /* Do, however, supply default names for the known special-purpose @@ -187,6 +198,7 @@ new_variant (void) /* iacc0 (Only found on MB93405.) */ var->register_names[iacc0h_regnum] = "iacc0h"; var->register_names[iacc0l_regnum] = "iacc0l"; + var->register_names[iacc0_regnum] = "iacc0"; return var; } @@ -235,7 +247,7 @@ frv_register_name (int reg) { if (reg < 0) return "?toosmall?"; - if (reg >= frv_num_regs) + if (reg >= frv_num_regs + frv_num_pseudo_regs) return "?toolarge?"; return CURRENT_VARIANT->register_names[reg]; @@ -247,10 +259,34 @@ frv_register_type (struct gdbarch *gdbarch, int reg) { if (reg >= first_fpr_regnum && reg <= last_fpr_regnum) return builtin_type_float; + else if (reg == iacc0_regnum) + return builtin_type_int64; else return builtin_type_int32; } +static void +frv_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, + int reg, void *buffer) +{ + if (reg == iacc0_regnum) + { + regcache_raw_read (regcache, iacc0h_regnum, buffer); + regcache_raw_read (regcache, iacc0l_regnum, (bfd_byte *) buffer + 4); + } +} + +static void +frv_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, + int reg, const void *buffer) +{ + if (reg == iacc0_regnum) + { + regcache_raw_write (regcache, iacc0h_regnum, buffer); + regcache_raw_write (regcache, iacc0l_regnum, (bfd_byte *) buffer + 4); + } +} + static int frv_register_sim_regno (int reg) { @@ -1202,6 +1238,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_ptr_bit (gdbarch, 32); set_gdbarch_num_regs (gdbarch, frv_num_regs); + set_gdbarch_num_pseudo_regs (gdbarch, frv_num_pseudo_regs); + set_gdbarch_sp_regnum (gdbarch, sp_regnum); set_gdbarch_deprecated_fp_regnum (gdbarch, fp_regnum); set_gdbarch_pc_regnum (gdbarch, pc_regnum); @@ -1210,6 +1248,9 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, frv_register_type); set_gdbarch_register_sim_regno (gdbarch, frv_register_sim_regno); + set_gdbarch_pseudo_register_read (gdbarch, frv_pseudo_register_read); + set_gdbarch_pseudo_register_write (gdbarch, frv_pseudo_register_write); + set_gdbarch_skip_prologue (gdbarch, frv_skip_prologue); set_gdbarch_breakpoint_from_pc (gdbarch, frv_breakpoint_from_pc); set_gdbarch_adjust_breakpoint_address (gdbarch, frv_gdbarch_adjust_breakpoint_address);