In order to manipulate SPR registers with generic gdb functions, SPR need to be part of the gdbarch register set.
The size of the g/G packet is defined by the remote. Thus, the list of registers reachable using a g/G packet is ajusted by the remote and all our SPR will be reached using p/P packets. So having more than 2000 registers declared in gdbarch is not a problem. Signed-off-by: Franck Jullien <[email protected]> --- gdb/or32-tdep.c | 6 +++--- gdb/or32-tdep.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gdb/or32-tdep.c b/gdb/or32-tdep.c index a69bb20..aa0e953 100644 --- a/gdb/or32-tdep.c +++ b/gdb/or32-tdep.c @@ -639,7 +639,7 @@ static const char * or32_register_name (struct gdbarch *gdbarch, int regnum) { - static char *or32_gdb_reg_names[OR32_TOTAL_NUM_REGS] = + static char *or32_gdb_reg_names[OR32_NUM_REGS_CACHED] = { /* general purpose registers */ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", @@ -739,7 +739,7 @@ or32_registers_info (struct gdbarch *gdbarch, if (-1 == regnum) { /* Do all (valid) registers */ - unsigned int lim = all ? OR32_NUM_REGS : OR32_MAX_GPR_REGS; + unsigned int lim = all ? OR32_NUM_REGS_CACHED : OR32_MAX_GPR_REGS; for (regnum = 0; regnum < lim; regnum++) { if ('\0' != *(or32_register_name (gdbarch, regnum))) @@ -792,7 +792,7 @@ or32_register_reggroup_p (struct gdbarch *gdbarch, if (group == all_reggroup) { return ((regnum >= 0) && - (regnum < OR32_TOTAL_NUM_REGS) && + (regnum < OR32_NUM_REGS_CACHED) && (or32_register_name (gdbarch, regnum)[0] != '\0')); } diff --git a/gdb/or32-tdep.h b/gdb/or32-tdep.h index c4d38bd..557aeef 100644 --- a/gdb/or32-tdep.h +++ b/gdb/or32-tdep.h @@ -320,8 +320,10 @@ followed by the PPC, NPC and SR at the end. Red zone is the area past the end of the stack reserved for exception handlers etc. */ #define OR32_MAX_GPR_REGS 32 +#define OR32_MAX_SPR_REGS 2300 #define OR32_NUM_PSEUDO_REGS 0 -#define OR32_NUM_REGS (OR32_MAX_GPR_REGS + 3) +#define OR32_NUM_REGS_CACHED (OR32_MAX_GPR_REGS + 3) +#define OR32_NUM_REGS (OR32_NUM_REGS_CACHED + OR32_MAX_SPR_REGS) #define OR32_TOTAL_NUM_REGS (OR32_NUM_REGS + OR32_NUM_PSEUDO_REGS) #define OR32_MAX_MATCHPOINTS 8 #define OR32_MAX_HW_WATCHES OR32_MAX_MATCHPOINTS -- 1.7.1 _______________________________________________ OpenRISC mailing list [email protected] http://lists.openrisc.net/listinfo/openrisc
