Guard against 'current_directory == NULL' on gdb_abspath (PR gdb/23613)
[deliverable/binutils-gdb.git] / gdb / arm-fbsd-nat.c
index f31ee5fa1d13464e89d94c6623152cfeeb170bbe..e6c7d3c4a8d1f72bdef882e115bb921fac532245 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for FreeBSD/arm.
 
-   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   Copyright (C) 2017-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -41,7 +41,7 @@ static arm_fbsd_nat_target the_arm_fbsd_nat_target;
 /* Determine if PT_GETREGS fetches REGNUM.  */
 
 static bool
-getregs_supplies (struct gdbarch *gdbarch, int regnum)
+getregs_supplies (int regnum)
 {
   return ((regnum >= ARM_A1_REGNUM && regnum <= ARM_PC_REGNUM)
          || regnum == ARM_PS_REGNUM);
@@ -51,7 +51,7 @@ getregs_supplies (struct gdbarch *gdbarch, int regnum)
 /* Determine if PT_GETVFPREGS fetches REGNUM.  */
 
 static bool
-getvfpregs_supplies (struct gdbarch *gdbarch, int regnum)
+getvfpregs_supplies (int regnum)
 {
   return ((regnum >= ARM_D0_REGNUM && regnum <= ARM_D31_REGNUM)
          || regnum == ARM_FPSCR_REGNUM);
@@ -64,10 +64,9 @@ getvfpregs_supplies (struct gdbarch *gdbarch, int regnum)
 void
 arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
 {
-  pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+  pid_t pid = get_ptrace_pid (regcache->ptid ());
 
-  struct gdbarch *gdbarch = regcache->arch ();
-  if (regnum == -1 || getregs_supplies (gdbarch, regnum))
+  if (regnum == -1 || getregs_supplies (regnum))
     {
       struct reg regs;
 
@@ -79,7 +78,7 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
     }
 
 #ifdef PT_GETVFPREGS
-  if (regnum == -1 || getvfpregs_supplies (gdbarch, regnum))
+  if (regnum == -1 || getvfpregs_supplies (regnum))
     {
       struct vfpreg vfpregs;
 
@@ -98,10 +97,9 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
 void
 arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
 {
-  pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+  pid_t pid = get_ptrace_pid (regcache->ptid ());
 
-  struct gdbarch *gdbarch = regcache->arch ();
-  if (regnum == -1 || getregs_supplies (gdbarch, regnum))
+  if (regnum == -1 || getregs_supplies (regnum))
     {
       struct reg regs;
 
@@ -116,7 +114,7 @@ arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
     }
 
 #ifdef PT_GETVFPREGS
-  if (regnum == -1 || getvfpregs_supplies (gdbarch, regnum))
+  if (regnum == -1 || getvfpregs_supplies (regnum))
     {
       struct vfpreg vfpregs;
 
@@ -141,12 +139,12 @@ arm_fbsd_nat_target::read_description ()
 
   desc = arm_fbsd_read_description_auxv (this);
   if (desc == NULL)
-    desc = this->beneath->read_description ();
+    desc = this->beneath ()->read_description ();
   return desc;
 }
 
 void
 _initialize_arm_fbsd_nat (void)
 {
-  add_target (&the_arm_fbsd_nat_target);
+  add_inf_child_target (&the_arm_fbsd_nat_target);
 }
This page took 0.029675 seconds and 4 git commands to generate.