gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / sparc64-nbsd-nat.c
index 44e54f5444943f3c00ef8fb2ae738d13eb38a2b8..5e249b629d16c24f2da7387cec5023c6a6cd3aba 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for NetBSD/sparc64.
 
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -34,7 +34,7 @@ sparc64nbsd_supply_gregset (const struct sparc_gregmap *gregmap,
                            struct regcache *regcache,
                            int regnum, const void *gregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
+  int sparc32 = (gdbarch_ptr_bit (regcache->arch ()) == 32);
 
   if (sparc32)
     sparc32_supply_gregset (&sparc32nbsd_gregmap, regcache, regnum, gregs);
@@ -47,7 +47,7 @@ sparc64nbsd_collect_gregset (const struct sparc_gregmap *gregmap,
                             const struct regcache *regcache,
                             int regnum, void *gregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
+  int sparc32 = (gdbarch_ptr_bit (regcache->arch ()) == 32);
 
   if (sparc32)
     sparc32_collect_gregset (&sparc32nbsd_gregmap, regcache, regnum, gregs);
@@ -60,7 +60,7 @@ sparc64nbsd_supply_fpregset (const struct sparc_fpregmap *fpregmap,
                             struct regcache *regcache,
                             int regnum, const void *fpregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
+  int sparc32 = (gdbarch_ptr_bit (regcache->arch ()) == 32);
 
   if (sparc32)
     sparc32_supply_fpregset (&sparc32_bsd_fpregmap, regcache, regnum, fpregs);
@@ -73,7 +73,7 @@ sparc64nbsd_collect_fpregset (const struct sparc_fpregmap *fpregmap,
                              const struct regcache *regcache,
                              int regnum, void *fpregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
+  int sparc32 = (gdbarch_ptr_bit (regcache->arch ()) == 32);
 
   if (sparc32)
     sparc32_collect_fpregset (&sparc32_bsd_fpregmap, regcache, regnum, fpregs);
@@ -156,19 +156,23 @@ sparc64nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
       read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8), 
                  (gdb_byte *)&pcb->pcb_pc, sizeof pcb->pcb_pc);
 
-  regcache_raw_supply (regcache, SPARC_SP_REGNUM, &pcb->pcb_sp);
-  regcache_raw_supply (regcache, SPARC64_PC_REGNUM, &pcb->pcb_pc);
+  regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp);
+  regcache->raw_supply (SPARC64_PC_REGNUM, &pcb->pcb_pc);
 
   state = pcb->pcb_pstate << 8 | pcb->pcb_cwp;
-  regcache_raw_supply (regcache, SPARC64_STATE_REGNUM, &state);
+  regcache->raw_supply (SPARC64_STATE_REGNUM, &state);
 
   sparc_supply_rwindow (regcache, pcb->pcb_sp, -1);
 
   return 1;
 }
 
+/* We've got nothing to add to the generic SPARC target.  */
+static sparc_target<inf_ptrace_target> the_sparc64_nbsd_nat_target;
+
+void _initialize_sparc64nbsd_nat ();
 void
-_initialize_sparc64nbsd_nat (void)
+_initialize_sparc64nbsd_nat ()
 {
   sparc_supply_gregset = sparc64nbsd_supply_gregset;
   sparc_collect_gregset = sparc64nbsd_collect_gregset;
@@ -177,8 +181,7 @@ _initialize_sparc64nbsd_nat (void)
   sparc_gregset_supplies_p = sparc64nbsd_gregset_supplies_p;
   sparc_fpregset_supplies_p = sparc64nbsd_fpregset_supplies_p;
 
-  /* We've got nothing to add to the generic SPARC target.  */
-  add_target (sparc_target ());
+  add_inf_child_target (&the_sparc64_nbsd_nat_target);
 
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (sparc64nbsd_supply_pcb);
This page took 0.024579 seconds and 4 git commands to generate.