This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Fix lin_lwp_thread_alive
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 2 Nov 2003 21:37:10 +0100 (CET)
- Subject: [PATCH] Fix lin_lwp_thread_alive
Kevin and Daniel reacted positevely on this, so unless someone raises
a serious objection in the next week, I'm going to check this in on
mainline next friday. I already committed this to the SPARC branch.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* lin-lwp.c (lin_lwp_thread_alive): Use PTRACE_PEEKDATA instead of
PTRACE_PEEKUSER. Return zero if the call failed with ESRCH.
Index: lin-lwp.c
===================================================================
RCS file: /cvs/src/src/gdb/lin-lwp.c,v
retrieving revision 1.51
diff -u -p -r1.51 lin-lwp.c
--- lin-lwp.c 7 Sep 2003 18:49:44 -0000 1.51
+++ lin-lwp.c 2 Nov 2003 20:34:41 -0000
@@ -1713,13 +1713,13 @@ lin_lwp_thread_alive (ptid_t ptid)
gdb_assert (is_lwp (ptid));
errno = 0;
- ptrace (PTRACE_PEEKUSER, GET_LWP (ptid), 0, 0);
+ ptrace (PTRACE_PEEKDATA, GET_LWP (ptid), 0, 0);
if (debug_lin_lwp)
fprintf_unfiltered (gdb_stdlog,
- "LLTA: PTRACE_PEEKUSER %s, 0, 0 (%s)\n",
+ "LLTA: PTRACE_PEEKDATA %s, 0, 0 (%s)\n",
target_pid_to_str (ptid),
errno ? safe_strerror (errno) : "OK");
- if (errno)
+ if (errno == ESRCH)
return 0;
return 1;