RAJESH reported that GDB gets "Couldn't write debug register: No such
process." on mips64 when GDB attaches to a multi threaded application.
Looks GDB nows PTRACE_GET_WATCH_REGS for inferior_ptid but
PTRACE_SET_WATCH_REGS for lwp->ptid, they may be different.
gdb:
2017-04-28 Yao Qi <yao.qi@linaro.org>
* mips-linux-nat.c (mips_linux_new_thread): Get lwpid from
lwp_info instead of getting from inferior_ptid.
+2017-04-28 Yao Qi <yao.qi@linaro.org>
+
+ * mips-linux-nat.c (mips_linux_new_thread): Get lwpid from
+ lwp_info instead of getting from inferior_ptid.
+
2017-04-27 Keith Seitz <keiths@redhat.com>
* gdbtypes.c (LVALUE_REFERENCE_TO_RVALUE_BINDING_BADNESS)
static void
mips_linux_new_thread (struct lwp_info *lp)
{
- int tid;
+ long tid = ptid_get_lwp (lp->ptid);
- 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"));
}