This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[patch] NPC_REGNUM and NNPC_REGNUM multi-arched
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [patch] NPC_REGNUM and NNPC_REGNUM multi-arched
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 02 May 2000 19:34:33 +1000
- Organization: Cygnus Solutions
FYI,
I've checked in the attached. It no longer breaks gdbserver for Linux.
Andrew
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.
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.9
diff -p -r1.9 findvar.c
*** findvar.c 2000/04/27 15:33:01 1.9
--- findvar.c 2000/05/02 09:28:46
*************** generic_target_write_pc (pc, pid)
*** 1082,1095 ****
#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
--- 1082,1091 ----
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.18
diff -p -r1.18 gdbarch.sh
*** gdbarch.sh 2000/05/02 08:57:21 1.18
--- gdbarch.sh 2000/05/02 09:28:55
*************** v:2:NUM_REGS:int:num_regs::::0:-1
*** 241,246 ****
--- 241,248 ----
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
Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.6
diff -p -r1.6 procfs.c
*** procfs.c 2000/04/27 01:04:52 1.6
--- procfs.c 2000/05/02 09:29:06
*************** procfs_fetch_registers (regno)
*** 3531,3539 ****
#if defined (FP0_REGNUM) /* need floating point? */
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
! #ifdef NPC_REGNUM
! regno == NPC_REGNUM ||
! #endif
regno == FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
--- 3531,3537 ----
#if defined (FP0_REGNUM) /* need floating point? */
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
! (NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
regno == FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
*************** procfs_store_registers (regno)
*** 3607,3615 ****
#if defined (FP0_REGNUM) /* need floating point? */
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
! #ifdef NPC_REGNUM
! regno == NPC_REGNUM ||
! #endif
regno == FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
--- 3605,3611 ----
#if defined (FP0_REGNUM) /* need floating point? */
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
! (NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
regno == FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
Index: gdbserver/remote-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/remote-utils.c,v
retrieving revision 1.1.1.3
diff -p -r1.1.1.3 remote-utils.c
*** remote-utils.c 1999/11/02 04:44:24 1.1.1.3
--- remote-utils.c 2000/05/02 09:29:09
***************
*** 33,38 ****
--- 33,39 ----
#include <fcntl.h>
int remote_debug = 0;
+ struct ui_file *gdb_stdlog;
static int remote_desc;
*************** prepare_resume_reply (buf, status, signo
*** 487,495 ****
buf = outreg (PC_REGNUM, buf);
buf = outreg (FP_REGNUM, buf);
buf = outreg (SP_REGNUM, buf);
! #ifdef NPC_REGNUM
! buf = outreg (NPC_REGNUM, buf);
! #endif
#ifdef O7_REGNUM
buf = outreg (O7_REGNUM, buf);
#endif
--- 488,495 ----
buf = outreg (PC_REGNUM, buf);
buf = outreg (FP_REGNUM, buf);
buf = outreg (SP_REGNUM, buf);
! if (NPC_REGNUM >= 0)
! buf = outreg (NPC_REGNUM, buf);
#ifdef O7_REGNUM
buf = outreg (O7_REGNUM, buf);
#endif