/* 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 <string.h>
+#include "nat/gdb_ptrace.h"
#include <sys/procfs.h>
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"));
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"));