> I think we can get by without adding a new field. The process_info > structure has the "process->attached" field already. We could > check that here. Indeed! Attached is an updated patch which uses that flag. 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 new paramter "attached". Call linux_test_for_exitkill if !ATTACHED. (linux_enable_event_reporting): Add new parameter "attached". Update call to linux_check_ptrace_features. * 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. Tested on x86_64-linux, native and native-gdbserver. I also verified by hand that the inferior gets killed when killing GDB in the "run" case, while the inferior remains in the "attach" case. Same for GDBserver. OK to push? Thank you! -- Joel