> This makes it sound like "interruptible sleep" is some kind of wedged > state waiting for a debugger. But, this simply means your process is just > running as normal, and your test's case, normal means idling. Most likely, > your test program had a "sleep" call in it. IOW, it'd be in sleep state > even if had been started outside gdb. Another test program could go > to "T (stopped)", "R (running)", etc. You're right. Rev log updated. > This test must be called unconditionally. current_ptrace_options is > only initialized once: > > void > linux_enable_event_reporting (pid_t pid) > { > /* Check if we have initialized the ptrace features for this > target. If not, do it now. */ > if (current_ptrace_options == -1) > linux_check_ptrace_features (); > > so if the first process gdbserver debugs is an "attach" process, > but the second one is not, you'll miss setting PTRACE_O_EXITKILL on > the second process. > > Instead, always call linux_test_for_exitkill, and then in > linux_enable_event_reporting mask out PTRACE_O_EXITKILL > from current_ptrace_options if 'attached' is false. Right again. Here is an attached patch. Re-tested on x86_64-linux as previously done. gdb/ChangeLog: * nat/linux-ptrace.h (PTRACE_O_EXITKILL): Define if not already defined. (linux_enable_event_reporting): Add parameter "attached". * nat/linux-ptrace.c (linux_test_for_exitkill): New advance declaration. New function. (linux_check_ptrace_features): Add linux_test_for_exitkill call. (linux_enable_event_reporting): Add new parameter "attached". Do not call ptrace with the PTRACE_O_EXITKILL if ATTACHED is nonzero. * linux-nat.c (linux_init_ptrace): Add parameter "attached". Use it. Update function description. (linux_child_post_attach, linux_child_post_startup_inferior): Update call to linux_enable_event_reporting. gdb/gdbserver/ChangeLog: * linux-low.c (linux_low_filter_event): Update call to linux_enable_event_reporting following the addition of a new parameter to that function. Thanks, Pedro. -- Joel