[ARM] PR ld/21402, only override the symbol dynamic decision on undefined weak symbol.
[deliverable/binutils-gdb.git] / gdb / tilegx-linux-nat.c
index a00f386909dd1485f1ca3407750c8b8c5c8ddf1b..c5c3a14352dac9792e33b1e4c4b1bac9fc5debae 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for GNU/Linux TILE-Gx.
 
-   Copyright (C) 2012-2014 Free Software Foundation, Inc.
+   Copyright (C) 2012-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "gdbcore.h"
 #include "regcache.h"
 #include "linux-nat.h"
+#include "inf-ptrace.h"
 
-#include <sys/ptrace.h>
-
-#include "gdb_assert.h"
-#include <string.h>
+#include "nat/gdb_ptrace.h"
 
 #include <sys/procfs.h>
 
@@ -129,11 +127,7 @@ fetch_inferior_registers (struct target_ops *ops,
                          struct regcache *regcache, int regnum)
 {
   elf_gregset_t regs;
-  int tid;
-
-  tid = ptid_get_lwp (inferior_ptid);
-  if (tid == 0)
-    tid = ptid_get_pid (inferior_ptid);
+  pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   if (ptrace (PTRACE_GETREGS, tid, 0, (PTRACE_TYPE_ARG3) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
@@ -149,11 +143,7 @@ store_inferior_registers (struct target_ops *ops,
                          struct regcache *regcache, int regnum)
 {
   elf_gregset_t regs;
-  int tid;
-
-  tid = ptid_get_lwp (inferior_ptid);
-  if (tid == 0)
-    tid = ptid_get_pid (inferior_ptid);
+  pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   if (ptrace (PTRACE_GETREGS, tid, 0, (PTRACE_TYPE_ARG3) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
@@ -164,9 +154,6 @@ store_inferior_registers (struct target_ops *ops,
     perror_with_name (_("Couldn't write registers"));
 }
 
-
-extern initialize_file_ftype _initialize_tile_linux_nat;
-
 void
 _initialize_tile_linux_nat (void)
 {
This page took 0.027106 seconds and 4 git commands to generate.