mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-18 05:12:33 +08:00
Introduce and use ui_out_emit_table
This introduces ui_out_emit_table, similar to the other existing ui_out RAII classes, and then uses it in a number of places. This replaces some cleanups. ChangeLog 2017-08-03 Tom Tromey <tom@tromey.com> * tracepoint.c (tvariables_info_1): Use ui_out_emit_table. (info_static_tracepoint_markers_command): Likewise. * solib.c (info_sharedlibrary_command): Use ui_out_emit_table. * skip.c (skip_info): Use ui_out_emit_table. * progspace.c (print_program_space): Use ui_out_emit_table. * osdata.c (info_osdata): Use ui_out_emit_table. * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions): Use ui_out_emit_table. * linux-thread-db.c (info_auto_load_libthread_db): Use ui_out_emit_table. * inferior.c (print_inferior): Use ui_out_emit_table. * gdb_bfd.c (maintenance_info_bfds): Use ui_out_emit_table. * breakpoint.c (breakpoint_1): Use ui_out_emit_table. * auto-load.c (auto_load_info_scripts): Use ui_out_emit_table. * ada-tasks.c (print_ada_task_info): Use ui_out_emit_table. * ui-out.h (class ui_out_emit_table): New.
This commit is contained in:
@ -259,7 +259,6 @@ print_program_space (struct ui_out *uiout, int requested)
|
||||
{
|
||||
struct program_space *pspace;
|
||||
int count = 0;
|
||||
struct cleanup *old_chain;
|
||||
|
||||
/* Compute number of pspaces we will print. */
|
||||
ALL_PSPACES (pspace)
|
||||
@ -273,7 +272,7 @@ print_program_space (struct ui_out *uiout, int requested)
|
||||
/* There should always be at least one. */
|
||||
gdb_assert (count > 0);
|
||||
|
||||
old_chain = make_cleanup_ui_out_table_begin_end (uiout, 3, count, "pspaces");
|
||||
ui_out_emit_table table_emitter (uiout, 3, count, "pspaces");
|
||||
uiout->table_header (1, ui_left, "current", "");
|
||||
uiout->table_header (4, ui_left, "id", "Id");
|
||||
uiout->table_header (17, ui_left, "exec", "Executable");
|
||||
@ -325,8 +324,6 @@ print_program_space (struct ui_out *uiout, int requested)
|
||||
|
||||
uiout->text ("\n");
|
||||
}
|
||||
|
||||
do_cleanups (old_chain);
|
||||
}
|
||||
|
||||
/* Boolean test for an already-known program space id. */
|
||||
|
Reference in New Issue
Block a user