diff options
author | Pedro Alves <palves@redhat.com> | 2008-12-02 15:52:15 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-12-02 15:52:15 +0000 |
commit | e0665bc852e60fc131ce6606e433102371f95f69 (patch) | |
tree | 7d71df915b225241c5f89a422817f42f0ebb4085 /gdb/mi | |
parent | e0740f779c1471fbc565ceedae93dea09bc0eadf (diff) | |
download | gdb-e0665bc852e60fc131ce6606e433102371f95f69.zip gdb-e0665bc852e60fc131ce6606e433102371f95f69.tar.gz gdb-e0665bc852e60fc131ce6606e433102371f95f69.tar.bz2 |
* 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 ed92559..e1db010 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) |