This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

NPC_REGNUM, multi-arch and gdbserver


Hello,

The attatched patch converts NPC_REGNUM and NNPC_REGNUM to multi-arch. 
Unfortunatly it also (finally) treds on the toes of gdbserver:

cc    -o gdbserver utils.o low-linux.o server.o remote-utils.o \
remote-utils.o: In function `prepare_resume_reply':
/home/scratch/MULTI-ARCH/linux/gdb/gdbserver/../../../src/gdb/gdbserver/remote-utils.c:491:
undefined reference to `current_gdbarch'
/home/scratch/MULTI-ARCH/linux/gdb/gdbserver/../../../src/gdb/gdbserver/remote-utils.c:491:
undefined reference to `gdbarch_npc_regnum'
/home/scratch/MULTI-ARCH/linux/gdb/gdbserver/../../../src/gdb/gdbserver/remote-utils.c:492:
undefined reference to `current_gdbarch'
/home/scratch/MULTI-ARCH/linux/gdb/gdbserver/../../../src/gdb/gdbserver/remote-utils.c:492:
undefined reference to `gdbarch_npc_regnum'
collect2: ld returned 1 exit status

the underlying problem/question is how should gdbserver be built when
the upper-level GDB is being built multi-arch?

Comments, ideas?

The short term fix is to apply chewing gum in strategic places.  Long
term a solution will be needed.

	enjoy,
		Andrew
Sat Apr 29 18:59:03 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* gdbserver/remote-utils.c (prepare_resume_reply): Check for valid
 	NPC_REGNUM.

	* 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.  Do not fix indentation.
	(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/04/29 09:40:58
*************** 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.17
diff -p -r1.17 gdbarch.sh
*** gdbarch.sh	2000/04/29 08:55:45	1.17
--- gdbarch.sh	2000/04/29 09:41:07
*************** 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/04/29 09:41:16
*************** 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]