* gdbarch.sh (DEPRECATED_NPC_REGNUM): Deprecate NPC_REGNUM.
* gdbarch.h, gdbarch.c: Regenerate.
* core-sol2.c, hppa-tdep.c, lynx-nat.c, procfs.c: Update.
* regcache.c, remote-vxsparc.c, sparc-linux-nat.c: Update.
* sparc-nat.c, sparc-tdep.c, sparc64-tdep.c: Update.
* sparcnbsd-tdep.c: Update.
+2003-09-17 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_NPC_REGNUM): Deprecate NPC_REGNUM.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * core-sol2.c, hppa-tdep.c, lynx-nat.c, procfs.c: Update.
+ * regcache.c, remote-vxsparc.c, sparc-linux-nat.c: Update.
+ * sparc-nat.c, sparc-tdep.c, sparc64-tdep.c: Update.
+ * sparcnbsd-tdep.c: Update.
+
2003-09-17 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (DEPRECATED_REGISTER_BYTE): Rename REGISTER_BYTE.
= gregs->r_ps;
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)]
= gregs->r_pc;
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (NPC_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)]
= gregs->r_npc;
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)]
= gregs->r_y;
int pc_regnum;
int ps_regnum;
int fp0_regnum;
- int npc_regnum;
+ int deprecated_npc_regnum;
gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
-1, /* pc_regnum */
-1, /* ps_regnum */
0, /* fp0_regnum */
- 0, /* npc_regnum */
+ 0, /* deprecated_npc_regnum */
0, /* stab_reg_to_regnum */
0, /* ecoff_reg_to_regnum */
0, /* dwarf_reg_to_regnum */
current_gdbarch->pc_regnum = -1;
current_gdbarch->ps_regnum = -1;
current_gdbarch->fp0_regnum = -1;
- current_gdbarch->npc_regnum = -1;
+ current_gdbarch->deprecated_npc_regnum = -1;
current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
/* Skip verify of pc_regnum, invalid_p == 0 */
/* Skip verify of ps_regnum, invalid_p == 0 */
/* Skip verify of fp0_regnum, invalid_p == 0 */
- /* Skip verify of npc_regnum, invalid_p == 0 */
+ /* Skip verify of deprecated_npc_regnum, invalid_p == 0 */
/* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
/* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
/* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
"gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE = %d\n",
DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE);
#endif
+#ifdef DEPRECATED_NPC_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_NPC_REGNUM # %s\n",
+ XSTRING (DEPRECATED_NPC_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_NPC_REGNUM = %d\n",
+ DEPRECATED_NPC_REGNUM);
+#endif
#ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"gdbarch_dump: NAME_OF_MALLOC = %s\n",
NAME_OF_MALLOC);
#endif
-#ifdef NPC_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: NPC_REGNUM # %s\n",
- XSTRING (NPC_REGNUM));
- fprintf_unfiltered (file,
- "gdbarch_dump: NPC_REGNUM = %d\n",
- NPC_REGNUM);
-#endif
#ifdef NUM_PSEUDO_REGS
fprintf_unfiltered (file,
"gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
}
int
-gdbarch_npc_regnum (struct gdbarch *gdbarch)
+gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of npc_regnum, invalid_p == 0 */
+ /* Skip verify of deprecated_npc_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
- return gdbarch->npc_regnum;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_npc_regnum called\n");
+ return gdbarch->deprecated_npc_regnum;
}
void
-set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
- int npc_regnum)
+set_gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch,
+ int deprecated_npc_regnum)
{
- gdbarch->npc_regnum = npc_regnum;
+ gdbarch->deprecated_npc_regnum = deprecated_npc_regnum;
}
int
#define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
#endif
-extern int gdbarch_npc_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM)
-#error "Non multi-arch definition of NPC_REGNUM"
+/* Replace DEPRECATED_NPC_REGNUM with an implementation of WRITE_PC
+ that updates PC, NPC and even NNPC. */
+
+extern int gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch, int deprecated_npc_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_NPC_REGNUM)
+#error "Non multi-arch definition of DEPRECATED_NPC_REGNUM"
#endif
-#if !defined (NPC_REGNUM)
-#define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch))
+#if !defined (DEPRECATED_NPC_REGNUM)
+#define DEPRECATED_NPC_REGNUM (gdbarch_deprecated_npc_regnum (current_gdbarch))
#endif
/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0
v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
-v:2:NPC_REGNUM:int:npc_regnum::::0:-1::0
+# Replace DEPRECATED_NPC_REGNUM with an implementation of WRITE_PC
+# that updates PC, NPC and even NNPC.
+v:2:DEPRECATED_NPC_REGNUM:int:deprecated_npc_regnum::::0:-1::0
# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
f:2:STAB_REG_TO_REGNUM:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0
# Provide a default mapping from a ecoff register number to a gdb REGNUM.
write_register_pid (31, v | 0x3, ptid);
write_register_pid (PC_REGNUM, v, ptid);
- write_register_pid (NPC_REGNUM, v + 4, ptid);
+ write_register_pid (DEPRECATED_NPC_REGNUM, v + 4, ptid);
}
/* return the alignment of a type in bytes. Structures have the maximum
set_gdbarch_sp_regnum (gdbarch, 30);
set_gdbarch_fp0_regnum (gdbarch, 64);
set_gdbarch_pc_regnum (gdbarch, PCOQ_HEAD_REGNUM);
- set_gdbarch_npc_regnum (gdbarch, PCOQ_TAIL_REGNUM);
+ set_gdbarch_deprecated_npc_regnum (gdbarch, PCOQ_TAIL_REGNUM);
set_gdbarch_deprecated_register_raw_size (gdbarch, hppa_register_raw_size);
set_gdbarch_deprecated_register_byte (gdbarch, hppa_register_byte);
set_gdbarch_deprecated_register_virtual_size (gdbarch, hppa_register_raw_size);
supply_register (PS_REGNUM, (char *) &ec.psr);
supply_register (Y_REGNUM, (char *) &ec.y);
supply_register (PC_REGNUM, (char *) &ec.pc);
- supply_register (NPC_REGNUM, (char *) &ec.npc);
+ supply_register (DEPRECATED_NPC_REGNUM, (char *) &ec.npc);
supply_register (WIM_REGNUM, (char *) &ec.wim);
memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (O0_REGNUM)], ec.o,
ec.psr = read_register (PS_REGNUM);
ec.y = read_register (Y_REGNUM);
ec.pc = read_register (PC_REGNUM);
- ec.npc = read_register (NPC_REGNUM);
+ ec.npc = read_register (DEPRECATED_NPC_REGNUM);
ec.wim = read_register (WIM_REGNUM);
memcpy (ec.o, &deprecated_registers[DEPRECATED_REGISTER_BYTE (O0_REGNUM)],
{
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
- (NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
+ (DEPRECATED_NPC_REGNUM >= 0 && regno == DEPRECATED_NPC_REGNUM) ||
regno == DEPRECATED_FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
{
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
- (NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
+ (DEPRECATED_NPC_REGNUM >= 0 && regno == DEPRECATED_NPC_REGNUM) ||
regno == DEPRECATED_FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
#ifdef PC_REGNUM
if (PC_REGNUM >= 0)
write_register_pid (PC_REGNUM, pc, ptid);
- if (NPC_REGNUM >= 0)
- write_register_pid (NPC_REGNUM, pc + 4, ptid);
+ if (DEPRECATED_NPC_REGNUM >= 0)
+ write_register_pid (DEPRECATED_NPC_REGNUM, pc + 4, ptid);
#else
internal_error (__FILE__, __LINE__,
"generic_target_write_pc");
if (regno >= 0)
{
if ((G0_REGNUM <= regno && regno <= I7_REGNUM)
- || (Y_REGNUM <= regno && regno <= NPC_REGNUM))
+ || (Y_REGNUM <= regno && regno <= DEPRECATED_NPC_REGNUM))
in_fp_regs = 0;
else
in_gp_regs = 0;
supply_register (PS_REGNUM, (char *) (regp + 32));
supply_register (PC_REGNUM, (char *) (regp + 33));
- supply_register (NPC_REGNUM, (char *) (regp + 34));
+ supply_register (DEPRECATED_NPC_REGNUM, (char *) (regp + 34));
supply_register (Y_REGNUM, (char *) (regp + 35));
supply_register (WIM_REGNUM, (char *) (regp + 36));
if (regno == -1 || regno == PC_REGNUM)
regcache_collect (PC_REGNUM, regp + 33);
- if (regno == -1 || regno == NPC_REGNUM)
- regcache_collect (NPC_REGNUM, regp + 34);
+ if (regno == -1 || regno == DEPRECATED_NPC_REGNUM)
+ regcache_collect (DEPRECATED_NPC_REGNUM, regp + 34);
if (regno == -1 || regno == Y_REGNUM)
regcache_collect (Y_REGNUM, regp + 35);
= inferior_registers.r_ps;
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)]
= inferior_registers.r_pc;
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (NPC_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)]
= inferior_registers.r_npc;
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
deprecated_register_valid[Y_REGNUM] = 1;
deprecated_register_valid[PS_REGNUM] = 1;
deprecated_register_valid[PC_REGNUM] = 1;
- deprecated_register_valid[NPC_REGNUM] = 1;
+ deprecated_register_valid[DEPRECATED_NPC_REGNUM] = 1;
/* If we don't set these valid, read_register_bytes() rereads
all the regs every time it is called! FIXME. */
deprecated_register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
inferior_registers.r_pc =
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)];
inferior_registers.r_npc =
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (NPC_REGNUM)];
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)];
inferior_registers.r_y =
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)];
15 * REGISTER_RAW_SIZE (G1_REGNUM));
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
- *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)] = gregs->r_npc;
*(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
/* My best guess at where to get the locals and input
Beihl (beihl@mcc.com). */
/* npc4 and next_pc describe the situation at the time that the
- step-breakpoint was set, not necessary the current value of NPC_REGNUM. */
+ step-breakpoint was set, not necessary the current value of DEPRECATED_NPC_REGNUM. */
static CORE_ADDR next_pc, npc4, target;
static int brknpc4, brktrg;
typedef char binsn_quantum[BREAKPOINT_MAX];
if (insert_breakpoints_p)
{
/* Always set breakpoint for NPC. */
- next_pc = read_register (NPC_REGNUM);
+ next_pc = read_register (DEPRECATED_NPC_REGNUM);
npc4 = next_pc + 4; /* branch not taken */
target_insert_breakpoint (next_pc, break_mem[0]);
write_register (PC_REGNUM,
read_memory_integer (fsr[PC_REGNUM],
REGISTER_RAW_SIZE (PC_REGNUM)));
- if (fsr[NPC_REGNUM])
- write_register (NPC_REGNUM,
- read_memory_integer (fsr[NPC_REGNUM],
- REGISTER_RAW_SIZE (NPC_REGNUM)));
+ if (fsr[DEPRECATED_NPC_REGNUM])
+ write_register (DEPRECATED_NPC_REGNUM,
+ read_memory_integer (fsr[DEPRECATED_NPC_REGNUM],
+ REGISTER_RAW_SIZE (DEPRECATED_NPC_REGNUM)));
}
else if (get_frame_extra_info (frame)->flat)
{
}
write_register (PC_REGNUM, pc);
- write_register (NPC_REGNUM, pc + 4);
+ write_register (DEPRECATED_NPC_REGNUM, pc + 4);
}
else if (fsr[I7_REGNUM])
{
pc = PC_ADJUST ((CORE_ADDR) read_memory_integer (fsr[I7_REGNUM],
SPARC_INTREG_SIZE));
write_register (PC_REGNUM, pc);
- write_register (NPC_REGNUM, pc + 4);
+ write_register (DEPRECATED_NPC_REGNUM, pc + 4);
}
flush_cached_frames ();
}
/* These require a bit more care. */
supply_register (PC_REGNUM, ((char *) (regp + R_PC)) + offset);
- supply_register (NPC_REGNUM, ((char *) (regp + R_nPC)) + offset);
+ supply_register (DEPRECATED_NPC_REGNUM, ((char *) (regp + R_nPC)) + offset);
supply_register (Y_REGNUM, ((char *) (regp + R_Y)) + offset);
if (GDB_TARGET_IS_SPARC64)
if ((regno == -1) || (regno == PC_REGNUM))
deprecated_read_register_gen (PC_REGNUM, (char *) (regp + R_PC) + offset);
- if ((regno == -1) || (regno == NPC_REGNUM))
- deprecated_read_register_gen (NPC_REGNUM, (char *) (regp + R_nPC) + offset);
+ if ((regno == -1) || (regno == DEPRECATED_NPC_REGNUM))
+ deprecated_read_register_gen (DEPRECATED_NPC_REGNUM, (char *) (regp + R_nPC) + offset);
if ((regno == -1) || (regno == Y_REGNUM))
deprecated_read_register_gen (Y_REGNUM, (char *) (regp + R_Y) + offset);
set_gdbarch_frame_args_skip (gdbarch, 68);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- set_gdbarch_npc_regnum (gdbarch, SPARC32_NPC_REGNUM);
+ set_gdbarch_deprecated_npc_regnum (gdbarch, SPARC32_NPC_REGNUM);
set_gdbarch_pc_regnum (gdbarch, SPARC32_PC_REGNUM);
set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_push_arguments (gdbarch, sparc32_push_arguments);
set_gdbarch_frame_args_skip (gdbarch, 136);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- set_gdbarch_npc_regnum (gdbarch, SPARC64_NPC_REGNUM);
+ set_gdbarch_deprecated_npc_regnum (gdbarch, SPARC64_NPC_REGNUM);
set_gdbarch_pc_regnum (gdbarch, SPARC64_PC_REGNUM);
set_gdbarch_ptr_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_push_arguments (gdbarch, sparc64_push_arguments);
/* Register numbers of various important registers. */
set_gdbarch_sp_regnum (gdbarch, SPARC_SP_REGNUM); /* %sp */
set_gdbarch_pc_regnum (gdbarch, SPARC64_PC_REGNUM); /* %pc */
- set_gdbarch_npc_regnum (gdbarch, SPARC64_NPC_REGNUM);
+ set_gdbarch_deprecated_npc_regnum (gdbarch, SPARC64_NPC_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, SPARC_F0_REGNUM); /* %f0 */
/* Call dummy code. */
if (regno == PC_REGNUM || regno == -1)
supply_register (PC_REGNUM, regs + REG32_OFFSET_PC);
- if (regno == NPC_REGNUM || regno == -1)
- supply_register (NPC_REGNUM, regs + REG32_OFFSET_NPC);
+ if (regno == DEPRECATED_NPC_REGNUM || regno == -1)
+ supply_register (DEPRECATED_NPC_REGNUM, regs + REG32_OFFSET_NPC);
if (regno == Y_REGNUM || regno == -1)
supply_register (Y_REGNUM, regs + REG32_OFFSET_Y);
if (regno == PC_REGNUM || regno == -1)
supply_register (PC_REGNUM, regs + REG64_OFFSET_PC);
- if (regno == NPC_REGNUM || regno == -1)
- supply_register (NPC_REGNUM, regs + REG64_OFFSET_NPC);
+ if (regno == DEPRECATED_NPC_REGNUM || regno == -1)
+ supply_register (DEPRECATED_NPC_REGNUM, regs + REG64_OFFSET_NPC);
if (regno == Y_REGNUM || regno == -1)
{
if (regno == PC_REGNUM || regno == -1)
regcache_collect (PC_REGNUM, regs + REG32_OFFSET_PC);
- if (regno == NPC_REGNUM || regno == -1)
- regcache_collect (NPC_REGNUM, regs + REG32_OFFSET_NPC);
+ if (regno == DEPRECATED_NPC_REGNUM || regno == -1)
+ regcache_collect (DEPRECATED_NPC_REGNUM, regs + REG32_OFFSET_NPC);
if (regno == Y_REGNUM || regno == -1)
regcache_collect (Y_REGNUM, regs + REG32_OFFSET_Y);
if (regno == PC_REGNUM || regno == -1)
regcache_collect (PC_REGNUM, regs + REG64_OFFSET_PC);
- if (regno == NPC_REGNUM || regno == -1)
- regcache_collect (NPC_REGNUM, regs + REG64_OFFSET_NPC);
+ if (regno == DEPRECATED_NPC_REGNUM || regno == -1)
+ regcache_collect (DEPRECATED_NPC_REGNUM, regs + REG64_OFFSET_NPC);
if (regno == Y_REGNUM || regno == -1)
regcache_collect (Y_REGNUM, regs + REG64_OFFSET_Y);