Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb fix arm



details:   https://anonhg.NetBSD.org/src/rev/9b43bcfea8ff
branches:  trunk
changeset: 451666:9b43bcfea8ff
user:      christos <christos%NetBSD.org@localhost>
date:      Thu May 30 16:02:23 2019 +0000

description:
fix arm

diffstat:

 external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c                   |    50 +-
 external/gpl3/gdb/dist/gdb/configure.tgt                    |     2 +-
 external/gpl3/gdb/lib/libbfd/arch/arm/bfd-in3.h             |  1415 ++++++----
 external/gpl3/gdb/lib/libbfd/arch/arm/bfd.h                 |  1415 ++++++----
 external/gpl3/gdb/lib/libbfd/arch/arm/bfdver.h              |    28 +-
 external/gpl3/gdb/lib/libbfd/arch/arm/config.h              |    34 +-
 external/gpl3/gdb/lib/libbfd/arch/arm/defs.mk               |    12 +-
 external/gpl3/gdb/lib/libbfd/arch/arm/targmatch.h           |   906 +------
 external/gpl3/gdb/lib/libdecnumber/arch/arm/config.h        |    14 +-
 external/gpl3/gdb/lib/libgdb/arch/arm/build-gnulib/config.h |   507 +++-
 external/gpl3/gdb/lib/libgdb/arch/arm/config.h              |   128 +-
 external/gpl3/gdb/lib/libgdb/arch/arm/defs.mk               |     6 +-
 external/gpl3/gdb/lib/libgdb/arch/arm/init.c                |   130 +-
 external/gpl3/gdb/lib/libgdb/arch/arm/jit-reader.h          |     6 +-
 external/gpl3/gdb/lib/libgdb/arch/arm/version.c             |     6 +-
 external/gpl3/gdb/lib/libgdb/arch/arm/xml-builtin.c         |    24 +-
 external/gpl3/gdb/lib/libiberty/arch/arm/config.h           |    12 +-
 external/gpl3/gdb/lib/libopcodes/arch/arm/config.h          |    10 +-
 external/gpl3/gdb/lib/libreadline/arch/arm/config.h         |    14 +-
 19 files changed, 2510 insertions(+), 2209 deletions(-)

diffs (truncated from 8546 to 300 lines):

diff -r 3d8a3e19a349 -r 9b43bcfea8ff external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c Thu May 30 14:58:51 2019 +0000
+++ b/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c Thu May 30 16:02:23 2019 +0000
@@ -1,5 +1,4 @@
-/* Native-dependent code for BSD Unix running on ARM's, for GDB.
-
+/*
    Copyright (C) 1988-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -40,16 +39,6 @@
 #include "inf-ptrace.h"
 #include "bsd-kvm.h"
 
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-
-#include "gregset.h"
-
 class arm_nbsd_nat_target final : public nbsd_nat_target
 {
 public:
@@ -62,6 +51,10 @@
 
 extern int arm_apcs_32;
 
+#define FPSCR(r) ((char *) &(r)->fpr_vfp.vfp_fpscr)
+#define FPREG(r, regno) \
+    ((char *) (r)->fpr_vfp.vfp_regs + 8 * ((regno) - ARM_D0_REGNUM))
+
 static int
 armnbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
 {
@@ -135,14 +128,14 @@
 {
   int regno;
 
-  for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
-    regcache->raw_supply (regno, (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]);
+  for (regno = ARM_D0_REGNUM; regno < 16 + ARM_D0_REGNUM; regno++)
+    regcache->raw_supply (regno, FPREG(vfpregset, regno));
 
-  regcache->raw_supply (ARM_FPS_REGNUM, (char *) &fparegset->fpr_fpsr);
+  regcache->raw_supply (ARM_FPSCR_REGNUM, FPSCR(vfpregset));
 }
 
 static void
-arm_nbsd_nat_fetch_register (struct regcache *regcache, int regno)
+fetch_register (struct regcache *regcache, int regno)
 {
   struct reg regs;
   ptid_t ptid = regcache->ptid ();
@@ -211,11 +204,13 @@
 static void
 fetch_fp_register (struct regcache *regcache, int regno)
 {
+  ptid_t ptid = regcache->ptid ();
+  pid_t pid = ptid.pid ();
+  int lwp = ptid.lwp ();
   struct fpreg fpregs;
   int ret;
 
-  ret = ptrace (PT_GETFPREGS, pid,
-               (PTRACE_TYPE_ARG3) &fpregs, lwp); 
+  ret = ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, lwp); 
 
   if (ret < 0)
     {
@@ -225,14 +220,13 @@
 
   switch (regno)
     {
-    case ARM_FPS_REGNUM:
-      regcache->raw_supply (ARM_FPS_REGNUM,
-                           (char *) &fpregs.fpr_fpsr);
+    case ARM_FPSCR_REGNUM:
+      regcache->raw_supply (ARM_FPSCR_REGNUM, FPSCR(&fpregs));
       break;
 
     default:
-      regcache->raw_supply
-       (regno, (char *) &fpregs.fpr[regno - ARM_F0_REGNUM]);
+      regno += ARM_D0_REGNUM;
+      regcache->raw_supply (regno, FPREG(&fpregs, regno));
       break;
     }
 }
@@ -407,11 +401,11 @@
   switch (regno)
     {
     case ARM_FPS_REGNUM:
-      regcache->raw_collect (ARM_FPS_REGNUM, (char *) &fpregs.fpr_fpsr);
+      regcache->raw_collect (ARM_FPS_REGNUM, FPSCR(&fpregs));
       break;
 
     default:
-      regcache->raw_collect (regno, (char *) &fpregs.fpr[regno - ARM_F0_REGNUM]);
+      regcache->raw_collect (regno, FPREG(&fpregs, regno));
       break;
     }
 
@@ -432,10 +426,10 @@
   int regno;
 
 
-  for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
-    regcache->raw_collect (regno, (char *) &fpregs.fpr[regno - ARM_F0_REGNUM]);
+  for (regno = ARM_D0_REGNUM; regno < 16 + ARM_D0_REGNUM; regno++)
+    regcache->raw_collect (regno, FPREG(&fpregs, regno));
 
-  regcache->raw_collect (ARM_FPS_REGNUM, (char *) &fpregs.fpr_fpsr);
+  regcache->raw_collect (ARM_FPSCR_REGNUM, FPSCR(&fpregs));
 
   ret = ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, lwp);
 
diff -r 3d8a3e19a349 -r 9b43bcfea8ff external/gpl3/gdb/dist/gdb/configure.tgt
--- a/external/gpl3/gdb/dist/gdb/configure.tgt  Thu May 30 14:58:51 2019 +0000
+++ b/external/gpl3/gdb/dist/gdb/configure.tgt  Thu May 30 16:02:23 2019 +0000
@@ -182,7 +182,7 @@
        ;;
 arm*-*-netbsd* | arm*-*-knetbsd*-gnu)
        # Target: NetBSD/arm
-       gdb_target_obs="arm-nbsd-tdep.o"
+       gdb_target_obs="arm-bsd-tdep.o arm-nbsd-tdep.o"
        ;;
 arm*-*-openbsd*)
        # Target: OpenBSD/arm
diff -r 3d8a3e19a349 -r 9b43bcfea8ff external/gpl3/gdb/lib/libbfd/arch/arm/bfd-in3.h
--- a/external/gpl3/gdb/lib/libbfd/arch/arm/bfd-in3.h   Thu May 30 14:58:51 2019 +0000
+++ b/external/gpl3/gdb/lib/libbfd/arch/arm/bfd-in3.h   Thu May 30 16:02:23 2019 +0000
@@ -1,17 +1,17 @@
 /* This file is automatically generated.  DO NOT EDIT! */
-/* Generated from: NetBSD: mknative-gdb,v 1.7 2016/10/16 04:37:42 mrg Exp  */
-/* Generated from: NetBSD: mknative.common,v 1.15 2017/11/29 03:32:28 christos Exp  */
-
-/* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically 
-   generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", 
-   "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", 
-   "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", 
+/* Generated from: NetBSD: mknative-gdb,v 1.8 2019/05/29 01:56:06 christos Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
+
+/* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically
+   generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
+   "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
+   "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
    "linker.c", "simple.c" and "compress.c".
    Run "make headers" in your build bfd/ to regenerate.  */
 
 /* Main header file for the bfd library -- portable access to object files.
 
-   Copyright (C) 1990-2017 Free Software Foundation, Inc.
+   Copyright (C) 1990-2019 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
 
@@ -45,6 +45,8 @@
 
 #include "ansidecl.h"
 #include "symcat.h"
+#include "bfd_stdint.h"
+#include "diagnostics.h"
 #include <stdarg.h>
 #include <sys/stat.h>
 
@@ -102,6 +104,24 @@
 typedef BFD_HOST_U_64_BIT bfd_uint64_t;
 #endif
 
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if BFD_HOST_64BIT_LONG
+#  define BFD_PRI64 "l"
+# elif defined (__MSVCRT__)
+#  define BFD_PRI64 "I64"
+# else
+#  define BFD_PRI64 "ll"
+# endif
+# undef PRId64
+# define PRId64 BFD_PRI64 "d"
+# undef PRIu64
+# define PRIu64 BFD_PRI64 "u"
+# undef PRIx64
+# define PRIx64 BFD_PRI64 "x"
+#endif
+
 #if BFD_ARCH_SIZE >= 64
 #define BFD64
 #endif
@@ -115,7 +135,7 @@
 #endif
 
 /* Declaring a type wide enough to hold a host long and a host pointer.  */
-#define BFD_HOSTPTR_T  unsigned long
+#define BFD_HOSTPTR_T unsigned long
 typedef BFD_HOSTPTR_T bfd_hostptr_t;
 
 /* Forward declaration.  */
@@ -226,9 +246,6 @@
 /* A count of carsyms (canonical archive symbols).  */
 typedef unsigned long symindex;
 
-/* How to perform a relocation.  */
-typedef const struct reloc_howto_struct reloc_howto_type;
-
 #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
 
 /* General purpose part of a symbol X;
@@ -258,7 +275,7 @@
 
 /* Used in generating armaps (archive tables of contents).
    Perhaps just a forward definition would do?  */
-struct orl                     /* Output ranlib.  */
+struct orl             /* Output ranlib.  */
 {
   char **name;         /* Symbol name.  */
   union
@@ -276,7 +293,7 @@
   union
   {
     struct bfd_symbol *sym;    /* Function name.  */
-    bfd_vma offset;                    /* Offset into section.  */
+    bfd_vma offset;            /* Offset into section.  */
   } u;
 }
 alent;
@@ -340,11 +357,11 @@
 {
   symvalue value;
   char type;
-  const char *name;            /* Symbol name.  */
-  unsigned char stab_type;     /* Stab type.  */
-  char stab_other;             /* Stab other.  */
-  short stab_desc;             /* Stab desc.  */
-  const char *stab_name;       /* String for stab type.  */
+  const char *name;            /* Symbol name.  */
+  unsigned char stab_type;     /* Stab type.  */
+  char stab_other;             /* Stab other.  */
+  short stab_desc;             /* Stab desc.  */
+  const char *stab_name;       /* String for stab type.  */
 } symbol_info;
 
 /* Get the name of a stabs type code.  */
@@ -382,7 +399,7 @@
      only if the argument is NULL.  */
   struct bfd_hash_entry *(*newfunc)
     (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
-   /* An objalloc for this hash table.  This is a struct objalloc *,
+  /* An objalloc for this hash table.  This is a struct objalloc *,
      but we use void * to avoid requiring the inclusion of objalloc.h.  */
   void *memory;
   /* The number of slots in the hash table.  */
@@ -500,7 +517,7 @@
   (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),        \
    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
 #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)                          \
-  (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__),       \
+  (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
 #else
 #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)                           \
@@ -574,6 +591,8 @@
 void bfd_putl64 (bfd_uint64_t, void *);
 void bfd_putb32 (bfd_vma, void *);
 void bfd_putl32 (bfd_vma, void *);
+void bfd_putb24 (bfd_vma, void *);
+void bfd_putl24 (bfd_vma, void *);
 void bfd_putb16 (bfd_vma, void *);
 void bfd_putl16 (bfd_vma, void *);
 
@@ -601,8 +620,6 @@
 
 /* Externally visible ECOFF routines.  */
 
-extern bfd_vma bfd_ecoff_get_gp_value
-  (bfd * abfd);
 extern bfd_boolean bfd_ecoff_set_gp_value
   (bfd *abfd, bfd_vma gp_value);
 extern bfd_boolean bfd_ecoff_set_regmasks
@@ -771,8 +788,6 @@
 
 extern bfd_boolean bfd_i386linux_size_dynamic_sections
   (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_m68klinux_size_dynamic_sections
-  (bfd *, struct bfd_link_info *);
 extern bfd_boolean bfd_sparclinux_size_dynamic_sections
   (bfd *, struct bfd_link_info *);
 
@@ -841,9 +856,6 @@
 extern bfd_boolean bfd_coff_set_symbol_class
   (bfd *, struct bfd_symbol *, unsigned int);
 
-extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
-  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);



Home | Main Index | Thread Index | Old Index