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 Thu, Jul 30, 2015 at 12:24 PM, Yao Qi <qiyaoltc@gmail.com> wrote:
> On 30/07/15 16:28, Patrick Palka wrote:
>>
>> +  /* Unset attach_flag, it may be set if the previous process associated
>> with
>> +     the inferior was attached to.  */
>> +  current_inferior ()->attach_flag = 0;
>
>
> It is better to do such reset in target.c:target_pre_inferior, which
> is created for such purpose, as far as I know.

That makes sense, although I am a bit hesitant about such a change,
since target_pre_inferior has a lot of callers.  Is it OK, for
instance, to assume that current_inferior points to the right inferior
when target_pre_inferior gets called?  Currently current_inferior is
not called directly or indirectly from target_pre_inferior.

I wonder how this attach_flag issues manifests itself elsewhere, if at all.


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