Change regcache list to be an hash map
[deliverable/binutils-gdb.git] / gdb / hppa-nbsd-tdep.c
index 1beea448e31d29922c76d75838b5d7d145118a9c..5309b1976fd2a94a2cd41bb361c283ad5e1fa4f0 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for NetBSD/hppa
 
-   Copyright (C) 2008-2017 Free Software Foundation, Inc.
+   Copyright (C) 2008-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -27,6 +27,8 @@
 
 #include "hppa-tdep.h"
 #include "hppa-bsd-tdep.h"
+#include "nbsd-tdep.h"
+#include "gdbarch.h"
 
 /* From <machine/mcontext.h>.  */
 static int hppanbsd_mc_reg_offset[] =
@@ -71,25 +73,25 @@ static const struct tramp_frame hppanbsd_sigtramp_si4 =
   SIGTRAMP_FRAME,
   4,
   {
-    { 0xc7d7c012, -1 },        /*      bb,>=,n %arg3, 30, 1f           */
-    { 0xd6e01c1e, -1 },        /*       depwi 0,31,2,%arg3             */
-    { 0x0ee81093, -1 },        /*      ldw 4(%arg3), %r19              */
-    { 0x0ee01097, -1 },        /*      ldw 0(%arg3), %arg3             */
+    { 0xc7d7c012, ULONGEST_MAX },      /*      bb,>=,n %arg3, 30, 1f           */
+    { 0xd6e01c1e, ULONGEST_MAX },      /*       depwi 0,31,2,%arg3             */
+    { 0x0ee81093, ULONGEST_MAX },      /*      ldw 4(%arg3), %r19              */
+    { 0x0ee01097, ULONGEST_MAX },      /*      ldw 0(%arg3), %arg3             */
                        /* 1:                                   */
-    { 0xe8404000, -1 },        /*      blr %r0, %rp                    */
-    { 0xeae0c002, -1 },        /*      bv,n %r0(%arg3)                 */
-    { 0x08000240, -1 },        /*       nop                            */
-
-    { 0x0803025a, -1 },        /*      copy %r3, %arg0                 */
-    { 0x20200801, -1 },        /*      ldil -40000000, %r1             */
-    { 0xe420e008, -1 },        /*      be,l 4(%sr7, %r1), %sr0, %r31   */
-    { 0x34160268, -1 },        /*       ldi 134, %t1 ; SYS_setcontext  */
-
-    { 0x081c025a, -1 },        /*      copy ret0, %arg0                */
-    { 0x20200801, -1 },        /*      ldil -40000000, %r1             */
-    { 0xe420e008, -1 },        /*      be,l 4(%sr7, %r1), %sr0, %r31   */
-    { 0x34160002, -1 },        /*       ldi 1, %t1 ; SYS_exit          */
-    { TRAMP_SENTINEL_INSN, -1 }
+    { 0xe8404000, ULONGEST_MAX },      /*      blr %r0, %rp                    */
+    { 0xeae0c002, ULONGEST_MAX },      /*      bv,n %r0(%arg3)                 */
+    { 0x08000240, ULONGEST_MAX },      /*       nop                            */
+
+    { 0x0803025a, ULONGEST_MAX },      /*      copy %r3, %arg0                 */
+    { 0x20200801, ULONGEST_MAX },      /*      ldil -40000000, %r1             */
+    { 0xe420e008, ULONGEST_MAX },      /*      be,l 4(%sr7, %r1), %sr0, %r31   */
+    { 0x34160268, ULONGEST_MAX },      /*       ldi 134, %t1 ; SYS_setcontext  */
+
+    { 0x081c025a, ULONGEST_MAX },      /*      copy ret0, %arg0                */
+    { 0x20200801, ULONGEST_MAX },      /*      ldil -40000000, %r1             */
+    { 0xe420e008, ULONGEST_MAX },      /*      be,l 4(%sr7, %r1), %sr0, %r31   */
+    { 0x34160002, ULONGEST_MAX },      /*       ldi 1, %t1 ; SYS_exit          */
+    { TRAMP_SENTINEL_INSN, ULONGEST_MAX }
   },
   hppanbsd_sigtramp_cache_init
 };
@@ -171,7 +173,7 @@ hppanbsd_supply_gregset (const struct regset *regset,
   for (i = 0; i < ARRAY_SIZE (hppanbsd_reg_offset); i++)
     if (hppanbsd_reg_offset[i] != -1)
       if (regnum == -1 || regnum == i)
-       regcache_raw_supply (regcache, i, regs + hppanbsd_reg_offset[i]);
+       regcache->raw_supply (i, regs + hppanbsd_reg_offset[i]);
 }
 
 /* NetBSD/hppa register set.  */
@@ -190,7 +192,8 @@ hppanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                       void *cb_data,
                                       const struct regcache *regcache)
 {
-  cb (".reg", HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset, NULL, cb_data);
+  cb (".reg", HPPANBSD_SIZEOF_GREGS, HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset,
+      NULL, cb_data);
 }
 \f
 static void
@@ -199,19 +202,18 @@ hppanbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* Obviously NetBSD is BSD-based.  */
   hppabsd_init_abi (info, gdbarch);
 
+  nbsd_init_abi (info, gdbarch);
+
   /* Core file support.  */
   set_gdbarch_iterate_over_regset_sections
     (gdbarch, hppanbsd_iterate_over_regset_sections);
 
   tramp_frame_prepend_unwinder (gdbarch, &hppanbsd_sigtramp_si4);
 }
-\f
-
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-extern initialize_file_ftype _initialize_hppanbsd_tdep;
 
+void _initialize_hppanbsd_tdep ();
 void
-_initialize_hppanbsd_tdep (void)
+_initialize_hppanbsd_tdep ()
 {
   gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_NETBSD,
                          hppanbsd_init_abi);
This page took 0.026087 seconds and 4 git commands to generate.