Fix -list-thread-groups --available logic and add test
New in v3:
- Replace use_gdb_stub with can_spawn_for_attach.
- Call kill_wait_spawned_process on spawn_ids.
Commit
Use std::set in mi-main.c
52f9abe4c739f42cc5f80b2629276493ac6306f9
changed the logic of the "-list-thread-groups --available" by mistake
when a pid is passed. It prints all the processes except the one
specified by the given pid. The correct behavior is to only print the
process corresponding to that pid. this patch fixes that and adds a test.
gdb/ChangeLog:
* mi/mi-main.c (list_available_thread_groups): Reverse filter logic.
gdb/testsuite/ChangeLog:
* gdb.mi/list-thread-groups-available.exp: New file.
* gdb.mi/list-thread-groups-available.c: New file.