From 4c71c1059f876fcca9809f7b6372b721ddb83635 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 4 Oct 2017 12:44:01 -0400 Subject: 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. --- gdb/mi/mi-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/mi') diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 83b1fcf5322..289445f8324 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -801,7 +801,7 @@ list_available_thread_groups (const std::set &ids, int recurse) /* At present, the target will return all available processes and if information about specific ones was required, we filter undesired processes here. */ - if (!ids.empty () && ids.find (pid_i) != ids.end ()) + if (!ids.empty () && ids.find (pid_i) == ids.end ()) continue; ui_out_emit_tuple tuple_emitter (uiout, NULL); -- cgit v1.2.1