This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Unset attach_flag when running a new process
- From: Pedro Alves <palves at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, gdb-patches at sourceware dot org
- Date: Wed, 26 Aug 2015 18:06:48 +0100
- Subject: Re: [PATCH] Unset attach_flag when running a new process
- Authentication-results: sourceware.org; auth=none
- References: <CA+C-WL-pXAYhLBcVE2Cj7Qtjhxm_XbHnJOHjwB=4FmHhvnoQ7Q at mail dot gmail dot com> <1439816493-17559-1-git-send-email-patrick at parcs dot ath dot cx>
On 08/17/2015 02:01 PM, Patrick Palka wrote:
> We currently set attach_flag when attaching to a process, so we should
> make sure to unset it when forking a new process. Otherwise attach_flag
> would remain set after forking, if the previous process associated with
> the inferior was attached to.
>
> gdb/ChangeLog:
>
> * target.c (target_pre_inferior): Unset attach_flag.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.base/run-after-attach.exp: New test file.
> * gdb.base/run-after-attach.c: New test file.
OK, but,
> +set test "attempt kill via quit"
> +# The quit prompt should warn about killing the process, not about detaching the
> +# process, since this process was not attached to.
> +set ok 0
> +gdb_test_multiple "quit" $test {
> + -re "will be killed.*.y or n. $" {
> + set ok 1
> + send_gdb "n\n"
> + exp_continue
> + }
> + -re "will be detached.*.y or n. $" {
> + send_gdb "n\n"
> + exp_continue
> + }
> + -re "$gdb_prompt $" {
> + gdb_assert $ok $test
> + }
> + default {
> + fail $test
> + }
I don't think you need this default? gdb_test_multiple
handles timeout and eof itself.
> +}
> +
> +kill_wait_spawned_process $test_spawn_id
>
OK.
Thanks,
Pedro Alves