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]

Re: [PATCH] Unset attach_flag when running a new process


On Wed, Aug 26, 2015 at 1:06 PM, Pedro Alves <palves@redhat.com> wrote:
> 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.

Ah, yeah, that is an artifact from the previous version which used
gdb_expect.  Committed with that change.


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