+Tue May 2 19:07:20 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (NPC_REGNUM, NNPC_REGNUM): Add.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+ * gdbserver/remote-utils.c (prepare_resume_reply): Change #ifdef
+ NPC_REGNUM to run-time test.
+ * findvar.c (generic_target_write_pc): Change #ifdef NPC_REGNUM
+ and NNPC_REGNUM to run-time test.
+ * procfs.c (procfs_fetch_registers): Change #ifdef NPC_REGNUM to
+ run-time test.
+ (procfs_store_registers): Ditto.
+
Tue May 2 18:48:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.sh: Provide non- multi-arch defaults by direct
#ifdef PC_REGNUM
if (PC_REGNUM >= 0)
write_register_pid (PC_REGNUM, pc, pid);
-#ifdef NPC_REGNUM
if (NPC_REGNUM >= 0)
write_register_pid (NPC_REGNUM, pc + 4, pid);
-#ifdef NNPC_REGNUM
if (NNPC_REGNUM >= 0)
write_register_pid (NNPC_REGNUM, pc + 8, pid);
-#endif
-#endif
#else
internal_error ("generic_target_write_pc");
#endif
int sp_regnum;
int fp_regnum;
int pc_regnum;
+ int npc_regnum;
+ int nnpc_regnum;
gdbarch_register_name_ftype *register_name;
int register_size;
int register_bytes;
0,
0,
0,
+ 0,
+ 0,
generic_get_saved_register,
0,
0,
gdbarch->sp_regnum = -1;
gdbarch->fp_regnum = -1;
gdbarch->pc_regnum = -1;
+ gdbarch->npc_regnum = -1;
+ gdbarch->nnpc_regnum = -1;
gdbarch->register_name = legacy_register_name;
gdbarch->register_size = -1;
gdbarch->register_bytes = -1;
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->pc_regnum == -1))
internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
+ /* Skip verify of npc_regnum, invalid_p == 0 */
+ /* Skip verify of nnpc_regnum, invalid_p == 0 */
/* Skip verify of register_name, invalid_p == 0 */
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_size == -1))
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: PC_REGNUM = %ld\n",
(long) PC_REGNUM);
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: NPC_REGNUM = %ld\n",
+ (long) NPC_REGNUM);
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: NNPC_REGNUM = %ld\n",
+ (long) NNPC_REGNUM);
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: REGISTER_NAME = 0x%08lx\n",
(long) current_gdbarch->register_name
gdbarch->pc_regnum = pc_regnum;
}
+int
+gdbarch_npc_regnum (struct gdbarch *gdbarch)
+{
+ /* Skip verify of npc_regnum, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
+ return gdbarch->npc_regnum;
+}
+
+void
+set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
+ int npc_regnum)
+{
+ gdbarch->npc_regnum = npc_regnum;
+}
+
+int
+gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
+{
+ /* Skip verify of nnpc_regnum, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
+ return gdbarch->nnpc_regnum;
+}
+
+void
+set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
+ int nnpc_regnum)
+{
+ gdbarch->nnpc_regnum = nnpc_regnum;
+}
+
char *
gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
{
#endif
#endif
+/* Default (value) for non- multi-arch platforms. */
+#if (GDB_MULTI_ARCH == 0) && !defined (NPC_REGNUM)
+#define NPC_REGNUM (-1)
+#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
+#if (GDB_MULTI_ARCH > 1) || !defined (NPC_REGNUM)
+#define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (GDB_MULTI_ARCH == 0) && !defined (NNPC_REGNUM)
+#define NNPC_REGNUM (-1)
+#endif
+
+extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > 1) || !defined (NNPC_REGNUM)
+#define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch))
+#endif
+#endif
+
/* Default (function) for non- multi-arch platforms. */
#if (GDB_MULTI_ARCH == 0) && !defined (REGISTER_NAME)
#define REGISTER_NAME(regnr) (legacy_register_name (regnr))
v:2:SP_REGNUM:int:sp_regnum::::0:-1
v:2:FP_REGNUM:int:fp_regnum::::0:-1
v:2:PC_REGNUM:int:pc_regnum::::0:-1
+v:2:NPC_REGNUM:int:npc_regnum::::0:-1:0
+v:2:NNPC_REGNUM:int:nnpc_regnum::::0:-1:0
f:2:REGISTER_NAME:char *:register_name:int regnr:regnr:::legacy_register_name:0
v:2:REGISTER_SIZE:int:register_size::::0:-1
v:2:REGISTER_BYTES:int:register_bytes::::0:-1
#include <fcntl.h>
int remote_debug = 0;
+struct ui_file *gdb_stdlog;
static int remote_desc;
buf = outreg (PC_REGNUM, buf);
buf = outreg (FP_REGNUM, buf);
buf = outreg (SP_REGNUM, buf);
-#ifdef NPC_REGNUM
- buf = outreg (NPC_REGNUM, buf);
-#endif
+ if (NPC_REGNUM >= 0)
+ buf = outreg (NPC_REGNUM, buf);
#ifdef O7_REGNUM
buf = outreg (O7_REGNUM, buf);
#endif
#if defined (FP0_REGNUM) /* need floating point? */
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
-#ifdef NPC_REGNUM
- regno == NPC_REGNUM ||
-#endif
+ (NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
regno == FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
#if defined (FP0_REGNUM) /* need floating point? */
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
-#ifdef NPC_REGNUM
- regno == NPC_REGNUM ||
-#endif
+ (NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
regno == FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */