summaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-10-04 12:44:01 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2017-10-04 12:44:01 -0400
commit4c71c1059f876fcca9809f7b6372b721ddb83635 (patch)
tree36a46dcff03672071dff54be9542c47f35e7660e /gdb/mi
parent73dcd72d4eeec176f769660ddcdefd1f25d0a2ec (diff)
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.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 83b1fcf532..289445f832 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -801,7 +801,7 @@ list_available_thread_groups (const std::set<int> &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);