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] Fix -list-thread-groups --available logic and add test


On 2017-10-04 12:13 PM, Pedro Alves wrote:
> On 10/04/2017 05:00 PM, Simon Marchi wrote:
>> New in v2:
>>
>> - Match more precisely process entry in output.  Actually, match two, to
>>   test that giving more than one pid works.
>>
> 
> Great, thanks!
> 
> I noticed something else.  Don't we need to kill/reap
> the spawned spawn_id's?
> 
> There's kill_wait_spawned_process for that, but it operators
> on build, not on target.

I just assumed dejagnu/expect/tcl did that for us.  I looked at the process list just after
running the test and there are no leftover test processes.  I'll add some calls to
kill_wait_spawned_process anyhow.  If I replace use_gdb_stub with can_spawn_for_attach, as you
suggest, it should work since we know that build == target.

> Maybe it'd be OK to limit the test to local testing,
> and so you'd use can_spawn_for_attach instead of
> use_gdb_stub.
> 
> Hmm, actually, I do think that you should do that, given:
> 
> proc can_spawn_for_attach { } {
>     # We use exp_pid to get the inferior's pid, assuming that gives
>     # back the pid of the program.  On remote boards, that would give
>     # us instead the PID of e.g., the ssh client, etc.
>     if [is_remote target] then {
>         return 0
>     }
> 
> (the "we" above refers to spawn_id_get_pid.)

Good point, thanks.

Simon


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