aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-04-23 10:21:50 -0600
committerTom Tromey <tom@tromey.com>2017-08-03 07:58:51 -0600
commit4a2b031d5452226cf7894f313b3aac603f7ec5fb (patch)
tree8230279453a3136b5d29f238fec14112e1ae80cb /gdb/tracepoint.c
parentfd9770d81fba7ad860e8bcfbc13c77f21041f1f3 (diff)
downloadgdb-4a2b031d5452226cf7894f313b3aac603f7ec5fb.zip
gdb-4a2b031d5452226cf7894f313b3aac603f7ec5fb.tar.gz
gdb-4a2b031d5452226cf7894f313b3aac603f7ec5fb.tar.bz2
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.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 4f2bac5..6721e22 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -482,7 +482,6 @@ tvariables_info_1 (void)
struct trace_state_variable *tsv;
int ix;
int count = 0;
- struct cleanup *back_to;
struct ui_out *uiout = current_uiout;
if (VEC_length (tsv_s, tvariables) == 0 && !uiout->is_mi_like_p ())
@@ -496,8 +495,7 @@ tvariables_info_1 (void)
tsv->value_known = target_get_trace_state_variable_value (tsv->number,
&(tsv->value));
- back_to = make_cleanup_ui_out_table_begin_end (uiout, 3,
- count, "trace-variables");
+ ui_out_emit_table table_emitter (uiout, 3, count, "trace-variables");
uiout->table_header (15, ui_left, "name", "Name");
uiout->table_header (11, ui_left, "initial", "Initial");
uiout->table_header (11, ui_left, "current", "Current");
@@ -531,8 +529,6 @@ tvariables_info_1 (void)
uiout->field_string ("current", c);
uiout->text ("\n");
}
-
- do_cleanups (back_to);
}
/* List all the trace state variables. */
@@ -3952,9 +3948,8 @@ info_static_tracepoint_markers_command (char *arg, int from_tty)
don't work without in-process agent, so we don't bother users to type
`set agent on' when to use static tracepoint. */
- old_chain
- = make_cleanup_ui_out_table_begin_end (uiout, 5, -1,
- "StaticTracepointMarkersTable");
+ ui_out_emit_table table_emitter (uiout, 5, -1,
+ "StaticTracepointMarkersTable");
uiout->table_header (7, ui_left, "counter", "Cnt");
@@ -3970,7 +3965,7 @@ info_static_tracepoint_markers_command (char *arg, int from_tty)
uiout->table_body ();
markers = target_static_tracepoint_markers_by_strid (NULL);
- make_cleanup (VEC_cleanup (static_tracepoint_marker_p), &markers);
+ old_chain = make_cleanup (VEC_cleanup (static_tracepoint_marker_p), &markers);
for (i = 0;
VEC_iterate (static_tracepoint_marker_p,