This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

listing threads with thread_db, PTRACE_ATTACH -> lwp exits, just ignore.


Something I noticed while looking at this code.

If the LWP exits just after we've attached to it here, it's
better to just pretend we haven't seen it than stopping
thread_db thread listing with a hard error.

Tested on x86_64-linux and applied.

-- 
Pedro Alves

2011-09-09  Pedro Alves  <pedro@codesourcery.com>

	* linux-nat.c (lin_lwp_attach_lwp): Return 1 (ignore) instead of
	-1 (error), if the lwp exits right after attaching.

---
 gdb/linux-nat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: src/gdb/linux-nat.c
===================================================================
--- src.orig/gdb/linux-nat.c	2011-09-09 20:16:04.899765559 +0100
+++ src/gdb/linux-nat.c	2011-09-09 20:17:42.269765576 +0100
@@ -1479,7 +1479,7 @@ lin_lwp_attach_lwp (ptid_t ptid)
       if (!WIFSTOPPED (status))
 	{
 	  restore_child_signals_mask (&prev_mask);
-	  return -1;
+	  return 1;
 	}
 
       lp = add_lwp (ptid);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]