Make program_space::deleted_solibs a vector of std::string
[deliverable/binutils-gdb.git] / gdb / ia64-linux-nat.c
index 03bd14086c2ed853d3cc7948b2dcf3d13cb817f5..f6492dcebb517810eb214653759a33e2c2a3912b 100644 (file)
@@ -1,7 +1,7 @@
 /* Functions specific to running gdb native on IA-64 running
    GNU/Linux.
 
-   Copyright (C) 1999-2015 Free Software Foundation, Inc.
+   Copyright (C) 1999-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -41,6 +41,8 @@
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
 
+#include "inf-ptrace.h"
+
 /* These must match the order of the register names.
 
    Some sort of lookup table is needed because the offsets associated
@@ -692,11 +694,12 @@ ia64_linux_can_use_hw_breakpoint (struct target_ops *self,
 static void
 ia64_linux_fetch_register (struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR addr;
   size_t size;
   PTRACE_TYPE_RET *buf;
-  int pid, i;
+  pid_t pid;
+  int i;
 
   /* r0 cannot be fetched but is always zero.  */
   if (regnum == IA64_GR0_REGNUM)
@@ -735,18 +738,14 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
       return;
     }
 
-  /* Cater for systems like GNU/Linux, that implement threads as
-     separate processes.  */
-  pid = ptid_get_lwp (inferior_ptid);
-  if (pid == 0)
-    pid = ptid_get_pid (inferior_ptid);
+  pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   /* This isn't really an address, but ptrace thinks of it as one.  */
   addr = ia64_register_addr (gdbarch, regnum);
   size = register_size (gdbarch, regnum);
 
   gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0);
-  buf = alloca (size);
+  buf = (PTRACE_TYPE_RET *) alloca (size);
 
   /* Read the register contents from the inferior a chunk at a time.  */
   for (i = 0; i < size / sizeof (PTRACE_TYPE_RET); i++)
@@ -772,7 +771,7 @@ ia64_linux_fetch_registers (struct target_ops *ops,
 {
   if (regnum == -1)
     for (regnum = 0;
-        regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+        regnum < gdbarch_num_regs (regcache->arch ());
         regnum++)
       ia64_linux_fetch_register (regcache, regnum);
   else
@@ -784,27 +783,24 @@ ia64_linux_fetch_registers (struct target_ops *ops,
 static void
 ia64_linux_store_register (const struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR addr;
   size_t size;
   PTRACE_TYPE_RET *buf;
-  int pid, i;
+  pid_t pid;
+  int i;
 
   if (ia64_cannot_store_register (gdbarch, regnum))
     return;
 
-  /* Cater for systems like GNU/Linux, that implement threads as
-     separate processes.  */
-  pid = ptid_get_lwp (inferior_ptid);
-  if (pid == 0)
-    pid = ptid_get_pid (inferior_ptid);
+  pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   /* This isn't really an address, but ptrace thinks of it as one.  */
   addr = ia64_register_addr (gdbarch, regnum);
   size = register_size (gdbarch, regnum);
 
   gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0);
-  buf = alloca (size);
+  buf = (PTRACE_TYPE_RET *) alloca (size);
 
   /* Write the register contents into the inferior a chunk at a time.  */
   regcache_raw_collect (regcache, regnum, buf);
@@ -830,7 +826,7 @@ ia64_linux_store_registers (struct target_ops *ops,
 {
   if (regnum == -1)
     for (regnum = 0;
-        regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+        regnum < gdbarch_num_regs (regcache->arch ());
         regnum++)
       ia64_linux_store_register (regcache, regnum);
   else
@@ -865,7 +861,7 @@ ia64_linux_xfer_partial (struct target_ops *ops,
       if (offset >= gate_table_size)
        return TARGET_XFER_EOF;
 
-      tmp_buf = alloca (gate_table_size);
+      tmp_buf = (gdb_byte *) alloca (gate_table_size);
       res = syscall (__NR_getunwind, tmp_buf, gate_table_size);
       if (res < 0)
        return TARGET_XFER_E_IO;
@@ -895,8 +891,6 @@ ia64_linux_status_is_event (int status)
                                 || WSTOPSIG (status) == SIGILL);
 }
 
-void _initialize_ia64_linux_nat (void);
-
 void
 _initialize_ia64_linux_nat (void)
 {
This page took 0.025814 seconds and 4 git commands to generate.