[PATCH] Unset attach_flag when running a new process
Pedro Alves
palves@redhat.com
Wed Aug 26 17:06:00 GMT 2015
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
More information about the Gdb-patches
mailing list