This is the mail archive of the gdb-patches@sources.redhat.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]

[PATCH]: adapt netbsd/ppc target to multi-arch changes, fix typos


I've applied the enclosed patch to the repository.

        --jtc

2000-10-27  J.T. Conklin  <jtc@redback.com>

	* arch-utils.c (set_architecture, set_architecture_from_arch_mach,
 	set_gdbarch_from_file): Fix spelling error.
	* v850-tdep.c (v850_target_architecture_hook): Likewise.
	* gdbarch.sh: Fix spelling errors in comment.
	* gdbarch.c, gdbarch.h: Regenerate.

	* ppcnbsd-nat.c (fetch_core_registers, fetch_inferior_registers,
 	store_inferior_registers): Support older NetBSD/powerpc systems
 	from before fp reg support was added.  Adapt to register number
	changes caused when powerpc target was  multi-arched.

Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.15
diff -c -r1.15 arch-utils.c
*** arch-utils.c	2000/10/26 07:41:25	1.15
--- arch-utils.c	2000/10/27 19:15:55
***************
*** 441,447 ****
    if (wanted != NULL)
      set_arch (wanted, set_arch_manual);
    else
!     internal_error ("gdbarch: hardwired architecture/machine not reconized");
  }
  
  /* Set the architecture from a BFD (deprecated) */
--- 441,447 ----
    if (wanted != NULL)
      set_arch (wanted, set_arch_manual);
    else
!     internal_error ("gdbarch: hardwired architecture/machine not recognized");
  }
  
  /* Set the architecture from a BFD (deprecated) */
***************
*** 500,506 ****
        if (gdbarch_update_p (info))
  	target_architecture_auto = 0;
        else
! 	printf_unfiltered ("Architecture `%s' not reconized.\n",
  			   set_architecture_string);
      }
    else
--- 500,506 ----
        if (gdbarch_update_p (info))
  	target_architecture_auto = 0;
        else
! 	printf_unfiltered ("Architecture `%s' not recognized.\n",
  			   set_architecture_string);
      }
    else
***************
*** 560,566 ****
        memset (&info, 0, sizeof info);
        info.abfd = abfd;
        if (! gdbarch_update_p (info))
! 	error ("Architecture of file not reconized.\n");
      }
    else
      {
--- 560,566 ----
        memset (&info, 0, sizeof info);
        info.abfd = abfd;
        if (! gdbarch_update_p (info))
! 	error ("Architecture of file not recognized.\n");
      }
    else
      {
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.44
diff -c -r1.44 gdbarch.c
*** gdbarch.c	2000/10/27 15:02:42	1.44
--- gdbarch.c	2000/10/27 19:15:58
***************
*** 3998,4004 ****
  {
    struct gdbarch_registration **curr;
    const struct bfd_arch_info *bfd_arch_info;
!   /* Check that BFD reconizes this architecture */
    bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
    if (bfd_arch_info == NULL)
      {
--- 3998,4004 ----
  {
    struct gdbarch_registration **curr;
    const struct bfd_arch_info *bfd_arch_info;
!   /* Check that BFD recognizes this architecture */
    bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
    if (bfd_arch_info == NULL)
      {
Index: gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.36
diff -c -r1.36 gdbarch.h
*** gdbarch.h	2000/10/26 07:41:25	1.36
--- gdbarch.h	2000/10/27 19:16:00
***************
*** 1398,1404 ****
     that the INFO.BYTE_ORDER is non-zero.
  
     The INIT function shall return any of: NULL - indicating that it
!    doesn't reconize the selected architecture; an existing ``struct
     gdbarch'' from the ARCHES list - indicating that the new
     architecture is just a synonym for an earlier architecture (see
     gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
--- 1398,1404 ----
     that the INFO.BYTE_ORDER is non-zero.
  
     The INIT function shall return any of: NULL - indicating that it
!    doesn't recognize the selected architecture; an existing ``struct
     gdbarch'' from the ARCHES list - indicating that the new
     architecture is just a synonym for an earlier architecture (see
     gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.45
diff -c -r1.45 gdbarch.sh
*** gdbarch.sh	2000/10/27 15:02:42	1.45
--- gdbarch.sh	2000/10/27 19:16:02
***************
*** 747,753 ****
     that the INFO.BYTE_ORDER is non-zero.
  
     The INIT function shall return any of: NULL - indicating that it
!    doesn't reconize the selected architecture; an existing \`\`struct
     gdbarch'' from the ARCHES list - indicating that the new
     architecture is just a synonym for an earlier architecture (see
     gdbarch_list_lookup_by_info()); a newly created \`\`struct gdbarch''
--- 747,753 ----
     that the INFO.BYTE_ORDER is non-zero.
  
     The INIT function shall return any of: NULL - indicating that it
!    doesn't recognize the selected architecture; an existing \`\`struct
     gdbarch'' from the ARCHES list - indicating that the new
     architecture is just a synonym for an earlier architecture (see
     gdbarch_list_lookup_by_info()); a newly created \`\`struct gdbarch''
***************
*** 1696,1702 ****
  {
    struct gdbarch_registration **curr;
    const struct bfd_arch_info *bfd_arch_info;
!   /* Check that BFD reconizes this architecture */
    bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
    if (bfd_arch_info == NULL)
      {
--- 1696,1702 ----
  {
    struct gdbarch_registration **curr;
    const struct bfd_arch_info *bfd_arch_info;
!   /* Check that BFD recognizes this architecture */
    bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
    if (bfd_arch_info == NULL)
      {
Index: ppcnbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/ppcnbsd-nat.c,v
retrieving revision 1.2
diff -c -r1.2 ppcnbsd-nat.c
*** ppcnbsd-nat.c	2000/07/30 01:48:26	1.2
--- ppcnbsd-nat.c	2000/10/27 19:16:02
***************
*** 26,31 ****
--- 26,32 ----
  #include "defs.h"
  #include "inferior.h"
  #include "gdbcore.h"
+ #include "ppc-tdep.h"
  
  #define RF(dst, src) \
          memcpy(&registers[REGISTER_BYTE(dst)], &src, sizeof(src))
***************
*** 37,59 ****
  fetch_inferior_registers (int regno)
  {
    struct reg inferior_registers;
    struct fpreg inferior_fp_registers;
    int i;
  
    ptrace (PT_GETREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) & inferior_registers, 0);
    for (i = 0; i < 32; i++)
      RF (i, inferior_registers.fixreg[i]);
!   RF (LR_REGNUM, inferior_registers.lr);
!   RF (CR_REGNUM, inferior_registers.cr);
!   RF (XER_REGNUM, inferior_registers.xer);
!   RF (CTR_REGNUM, inferior_registers.ctr);
    RF (PC_REGNUM, inferior_registers.pc);
  
    ptrace (PT_GETFPREGS, inferior_pid,
! 	  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
    for (i = 0; i < 32; i++)
      RF (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
  
    registers_fetched ();
  }
--- 38,64 ----
  fetch_inferior_registers (int regno)
  {
    struct reg inferior_registers;
+ #ifdef PT_GETFPREGS
    struct fpreg inferior_fp_registers;
+ #endif
    int i;
  
    ptrace (PT_GETREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) & inferior_registers, 0);
    for (i = 0; i < 32; i++)
      RF (i, inferior_registers.fixreg[i]);
!   RF (PPC_LR_REGNUM, inferior_registers.lr);
!   RF (PPC_CR_REGNUM, inferior_registers.cr);
!   RF (PPC_XER_REGNUM, inferior_registers.xer);
!   RF (PPC_CTR_REGNUM, inferior_registers.ctr);
    RF (PC_REGNUM, inferior_registers.pc);
  
+ #ifdef PT_GETFPREGS
    ptrace (PT_GETFPREGS, inferior_pid,
! 	  (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
    for (i = 0; i < 32; i++)
      RF (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
+ #endif
  
    registers_fetched ();
  }
***************
*** 62,91 ****
  store_inferior_registers (int regno)
  {
    struct reg inferior_registers;
    struct fpreg inferior_fp_registers;
    int i;
  
    for (i = 0; i < 32; i++)
      RS (i, inferior_registers.fixreg[i]);
!   RS (LR_REGNUM, inferior_registers.lr);
!   RS (CR_REGNUM, inferior_registers.cr);
!   RS (XER_REGNUM, inferior_registers.xer);
!   RS (CTR_REGNUM, inferior_registers.ctr);
    RS (PC_REGNUM, inferior_registers.pc);
  
    ptrace (PT_SETREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) & inferior_registers, 0);
  
    for (i = 0; i < 32; i++)
      RS (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
    ptrace (PT_SETFPREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
  }
  
  struct md_core
  {
    struct reg intreg;
    struct fpreg freg;
  };
  
  void
--- 67,102 ----
  store_inferior_registers (int regno)
  {
    struct reg inferior_registers;
+ #ifdef PT_SETFPREGS
    struct fpreg inferior_fp_registers;
+ #endif
    int i;
  
    for (i = 0; i < 32; i++)
      RS (i, inferior_registers.fixreg[i]);
!   RS (PPC_LR_REGNUM, inferior_registers.lr);
!   RS (PPC_CR_REGNUM, inferior_registers.cr);
!   RS (PPC_XER_REGNUM, inferior_registers.xer);
!   RS (PPC_CTR_REGNUM, inferior_registers.ctr);
    RS (PC_REGNUM, inferior_registers.pc);
  
    ptrace (PT_SETREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) & inferior_registers, 0);
  
+ #ifdef PT_SETFPREGS
    for (i = 0; i < 32; i++)
      RS (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
    ptrace (PT_SETFPREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
+ #endif
  }
  
  struct md_core
  {
    struct reg intreg;
+ #ifdef PT_GETFPREGS
    struct fpreg freg;
+ #endif
  };
  
  void
***************
*** 98,112 ****
    /* Integer registers */
    for (i = 0; i < 32; i++)
      RF (i, core_reg->intreg.fixreg[i]);
!   RF (LR_REGNUM, core_reg->intreg.lr);
!   RF (CR_REGNUM, core_reg->intreg.cr);
!   RF (XER_REGNUM, core_reg->intreg.xer);
!   RF (CTR_REGNUM, core_reg->intreg.ctr);
    RF (PC_REGNUM, core_reg->intreg.pc);
  
    /* Floating point registers */
    for (i = 0; i < 32; i++)
      RF (FP0_REGNUM + i, core_reg->freg.r_regs[i]);
  
    registers_fetched ();
  }
--- 109,125 ----
    /* Integer registers */
    for (i = 0; i < 32; i++)
      RF (i, core_reg->intreg.fixreg[i]);
!   RF (PPC_LR_REGNUM, core_reg->intreg.lr);
!   RF (PPC_CR_REGNUM, core_reg->intreg.cr);
!   RF (PPC_XER_REGNUM, core_reg->intreg.xer);
!   RF (PPC_CTR_REGNUM, core_reg->intreg.ctr);
    RF (PC_REGNUM, core_reg->intreg.pc);
  
+ #ifdef PT_FPGETREGS
    /* Floating point registers */
    for (i = 0; i < 32; i++)
      RF (FP0_REGNUM + i, core_reg->freg.r_regs[i]);
+ #endif
  
    registers_fetched ();
  }
Index: v850-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/v850-tdep.c,v
retrieving revision 1.4
diff -c -r1.4 v850-tdep.c
*** v850-tdep.c	2000/07/30 01:48:27	1.4
--- v850-tdep.c	2000/10/27 19:16:04
***************
*** 850,856 ****
  	}
      }
  
!   internal_error ("Architecture `%s' unreconized", ap->printable_name);
  }
  
  void
--- 850,856 ----
  	}
      }
  
!   internal_error ("Architecture `%s' unrecognized", ap->printable_name);
  }
  
  void




-- 
J.T. Conklin
RedBack Networks

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