/* Native-dependent code for GNU/Linux on MIPS processors.
- Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ Copyright (C) 2001-2017 Free Software Foundation, Inc.
This file is part of GDB.
#include <sgidefs.h>
#include "nat/gdb_ptrace.h"
#include <asm/ptrace.h>
+#include "inf-ptrace.h"
#include "nat/mips-linux-watch.h"
/* Fetch the thread-local storage pointer for libthread_db. */
ps_err_e
-ps_get_thread_area (const struct ps_prochandle *ph,
+ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
else
is_dsp = 0;
- tid = ptid_get_lwp (inferior_ptid);
- if (tid == 0)
- tid = ptid_get_pid (inferior_ptid);
+ tid = get_ptrace_pid (regcache_get_ptid (regcache));
if (regno == -1 || (!is_fp && !is_dsp))
{
else
is_dsp = 0;
- tid = ptid_get_lwp (inferior_ptid);
- if (tid == 0)
- tid = ptid_get_pid (inferior_ptid);
+ tid = get_ptrace_pid (regcache_get_ptid (regcache));
if (regno == -1 || (!is_fp && !is_dsp))
{
static void
mips_linux_new_thread (struct lwp_info *lp)
{
- int tid;
+ long tid = lp->ptid.lwp ();
- if (!mips_linux_read_watch_registers (ptid_get_lwp (inferior_ptid),
+ if (!mips_linux_read_watch_registers (tid,
&watch_readback,
&watch_readback_valid, 0))
return;
- tid = ptid_get_lwp (lp->ptid);
if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror, NULL) == -1)
perror_with_name (_("Couldn't write debug register"));
}