diff options
author | Pedro Alves <pedro@codesourcery.com> | 2008-12-02 15:52:13 +0000 |
---|---|---|
committer | Pedro Alves <pedro@codesourcery.com> | 2008-12-02 15:52:13 +0000 |
commit | c6cfd68af8ced76343f5cc446374af35e57a0802 (patch) | |
tree | f398e787e4e12f8e15e0fed0eece938f8991ef46 /gdb/mi | |
parent | ff9d520b9dd390a2a8c2ac68a2f6b76a967ffe74 (diff) | |
download | gdb-c6cfd68af8ced76343f5cc446374af35e57a0802.tar.gz |
* target.h (target_get_osdata): Describe.
* osdata.h (make_cleanup_osdata_free): Declare.
* osdata.c (osdata_item_clear): Define even if HAVE_LIBEXPAT is
not defined.
(osdata_free_cleanup): New.
(make_cleanup_osdata_free): New.
(get_osdata): Fix leak.
(info_osdata_command): Use make_cleanup_osdata_free.
(info_processes_command): Delete.
(_initialize_osdata): Drop undocumented "info processes" alias.
* mi/mi-main.c (mi_cmd_list_thread_groups): Fix leak.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-main.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index ed925594839..e1db010e254 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -377,7 +377,7 @@ mi_cmd_list_thread_groups (char *command, char **argv, int argc) if (argc > 0) id = argv[0]; - back_to = make_cleanup (&null_cleanup, NULL); + back_to = make_cleanup (null_cleanup, NULL); if (available && id) { @@ -385,18 +385,21 @@ mi_cmd_list_thread_groups (char *command, char **argv, int argc) } else if (available) { - struct osdata *data = get_osdata ("processes"); + struct osdata *data; struct osdata_item *item; int ix_items; + data = get_osdata ("processes"); + make_cleanup_osdata_free (data); + make_cleanup_ui_out_list_begin_end (uiout, "groups"); - + for (ix_items = 0; - VEC_iterate (osdata_item_s, data->items, - ix_items, item); + VEC_iterate (osdata_item_s, data->items, + ix_items, item); ix_items++) { - struct cleanup *back_to = + struct cleanup *back_to = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); const char *pid = get_osdata_column (item, "pid"); @@ -409,8 +412,8 @@ mi_cmd_list_thread_groups (char *command, char **argv, int argc) ui_out_field_string (uiout, "description", cmd); if (user) ui_out_field_string (uiout, "user", user); - - do_cleanups (back_to); + + do_cleanups (back_to); } } else if (id) |