aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-04-28 09:33:16 +0100
committerYao Qi <yao.qi@linaro.org>2017-04-28 09:36:37 +0100
commitc6767e625c0fb73c9a12d991140670a00ad8284c (patch)
tree0bc16af9c8b120ae632c70309a637fa3a0171f9a
parent6f43fe1508c359c4daa25a1a1c97496292462b13 (diff)
downloadgdb-c6767e625c0fb73c9a12d991140670a00ad8284c.zip
gdb-c6767e625c0fb73c9a12d991140670a00ad8284c.tar.gz
gdb-c6767e625c0fb73c9a12d991140670a00ad8284c.tar.bz2
[MIPS] Use lwpid from lwp_info instead of inferior_ptid
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/mips-linux-nat.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fb64b64..c8b0084 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+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)
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 9596b49..c5c18fd 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -624,14 +624,13 @@ write_watchpoint_regs (void)
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"));
}