X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Ftilegx-linux-nat.c;h=5cdf74daf2f5f2b2f082f8769e36d8dc52e6f4d1;hb=3c9ebddd93ffb8b44b8cc69f3be9db08c861368e;hp=61bca3ff2bfbcf14ccaf5540ef664a96eaac4112;hpb=ecd75fc8eed3bde86036141228074a20e55dcfc9;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c index 61bca3ff2b..5cdf74daf2 100644 --- a/gdb/tilegx-linux-nat.c +++ b/gdb/tilegx-linux-nat.c @@ -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. @@ -22,23 +22,18 @@ #include "gdbcore.h" #include "regcache.h" #include "linux-nat.h" +#include "inf-ptrace.h" -#include - -#include "gdb_assert.h" -#include +#include "nat/gdb_ptrace.h" #include +/* Defines ps_err_e, struct ps_prochandle. */ #include "gdb_proc_service.h" -#include /* Prototypes for supply_gregset etc. */ #include "gregset.h" -/* Defines ps_err_e, struct ps_prochandle. */ -#include "gdb_proc_service.h" - /* The register sets used in GNU/Linux ELF core-dumps are identical to the register sets in `struct user' that is used for a.out core-dumps, and is also used by `ptrace'. The corresponding types @@ -132,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) ®s) < 0) perror_with_name (_("Couldn't get registers")); @@ -152,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) ®s) < 0) perror_with_name (_("Couldn't get registers"));