diff options
author | Tom Tromey <tom@tromey.com> | 2017-09-09 09:16:49 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-09-09 13:46:04 -0600 |
commit | dc9fe180a4437b437015a8b835d05e32d64dff3d (patch) | |
tree | 10445ce96625632b46c715fdc7bcb55906b119c4 /gdb/spu-tdep.c | |
parent | f8cc3da6e4548529eabb1ff4e9693261aae1cfee (diff) | |
download | gdb-dc9fe180a4437b437015a8b835d05e32d64dff3d.zip gdb-dc9fe180a4437b437015a8b835d05e32d64dff3d.tar.gz gdb-dc9fe180a4437b437015a8b835d05e32d64dff3d.tar.bz2 |
Remove make_cleanup_ui_out_table_begin_end
This changes the few remaining uses of
make_cleanup_ui_out_table_begin_end to use ui_out_emit_table instead,
and then removes the cleanup.
ChangeLog
2017-09-09 Tom Tromey <tom@tromey.com>
* ui-out.h (make_cleanup_ui_out_table_begin_end): Remove.
(class ui_out_emit_table): Update comment.
* ui-out.c (do_cleanup_table_end)
(make_cleanup_ui_out_table_begin_end): Remove.
* spu-tdep.c (info_spu_mailbox_list): Use ui_out_emit_table.
(info_spu_dma_cmdlist): Likewise.
* probe.c (info_probes_for_ops): Use ui_out_emit_table.
* darwin-nat-info.c (darwin_debug_regions_recurse): Use
ui_out_emit_table.
Diffstat (limited to 'gdb/spu-tdep.c')
-rw-r--r-- | gdb/spu-tdep.c | 90 |
1 files changed, 41 insertions, 49 deletions
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 2de9155..7133ab6 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -2209,31 +2209,28 @@ static void info_spu_mailbox_list (gdb_byte *buf, int nr, enum bfd_endian byte_order, const char *field, const char *msg) { - struct cleanup *chain; int i; if (nr <= 0) return; - chain = make_cleanup_ui_out_table_begin_end (current_uiout, 1, nr, "mbox"); + ui_out_emit_table table_emitter (current_uiout, 1, nr, "mbox"); current_uiout->table_header (32, ui_left, field, msg); current_uiout->table_body (); for (i = 0; i < nr; i++) { - struct cleanup *val_chain; - ULONGEST val; - val_chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "mbox"); - val = extract_unsigned_integer (buf + 4*i, 4, byte_order); - current_uiout->field_fmt (field, "0x%s", phex (val, 4)); - do_cleanups (val_chain); + { + ULONGEST val; + ui_out_emit_tuple tuple_emitter (current_uiout, "mbox"); + val = extract_unsigned_integer (buf + 4*i, 4, byte_order); + current_uiout->field_fmt (field, "0x%s", phex (val, 4)); + } if (!current_uiout->is_mi_like_p ()) printf_filtered ("\n"); } - - do_cleanups (chain); } static void @@ -2333,7 +2330,6 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr, enum bfd_endian byte_order) int *seq = XALLOCAVEC (int, nr); int done = 0; - struct cleanup *chain; int i, j; @@ -2371,8 +2367,7 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr, enum bfd_endian byte_order) nr = i; - chain = make_cleanup_ui_out_table_begin_end (current_uiout, 10, nr, - "dma_cmd"); + ui_out_emit_table table_emitter (current_uiout, 10, nr, "dma_cmd"); current_uiout->table_header (7, ui_left, "opcode", "Opcode"); current_uiout->table_header (3, ui_left, "tag", "Tag"); @@ -2389,7 +2384,6 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr, enum bfd_endian byte_order) for (i = 0; i < nr; i++) { - struct cleanup *cmd_chain; ULONGEST mfc_cq_dw0; ULONGEST mfc_cq_dw1; ULONGEST mfc_cq_dw2; @@ -2425,51 +2419,49 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr, enum bfd_endian byte_order) ea_valid_p = spu_mfc_get_bitfield (mfc_cq_dw2, 39, 39); cmd_error_p = spu_mfc_get_bitfield (mfc_cq_dw2, 40, 40); - cmd_chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "cmd"); - - if (spu_mfc_opcode[mfc_cmd_opcode]) - current_uiout->field_string ("opcode", spu_mfc_opcode[mfc_cmd_opcode]); - else - current_uiout->field_int ("opcode", mfc_cmd_opcode); + { + ui_out_emit_tuple tuple_emitter (current_uiout, "cmd"); - current_uiout->field_int ("tag", mfc_cmd_tag); - current_uiout->field_int ("tid", tclass_id); - current_uiout->field_int ("rid", rclass_id); + if (spu_mfc_opcode[mfc_cmd_opcode]) + current_uiout->field_string ("opcode", spu_mfc_opcode[mfc_cmd_opcode]); + else + current_uiout->field_int ("opcode", mfc_cmd_opcode); - if (ea_valid_p) - current_uiout->field_fmt ("ea", "0x%s", phex (mfc_ea, 8)); - else - current_uiout->field_skip ("ea"); + current_uiout->field_int ("tag", mfc_cmd_tag); + current_uiout->field_int ("tid", tclass_id); + current_uiout->field_int ("rid", rclass_id); - current_uiout->field_fmt ("lsa", "0x%05x", mfc_lsa << 4); - if (qw_valid_p) - current_uiout->field_fmt ("size", "0x%05x", mfc_size << 4); - else - current_uiout->field_fmt ("size", "0x%05x", mfc_size); + if (ea_valid_p) + current_uiout->field_fmt ("ea", "0x%s", phex (mfc_ea, 8)); + else + current_uiout->field_skip ("ea"); - if (list_valid_p) - { - current_uiout->field_fmt ("lstaddr", "0x%05x", list_lsa << 3); - current_uiout->field_fmt ("lstsize", "0x%05x", list_size << 3); - } - else - { - current_uiout->field_skip ("lstaddr"); - current_uiout->field_skip ("lstsize"); - } + current_uiout->field_fmt ("lsa", "0x%05x", mfc_lsa << 4); + if (qw_valid_p) + current_uiout->field_fmt ("size", "0x%05x", mfc_size << 4); + else + current_uiout->field_fmt ("size", "0x%05x", mfc_size); - if (cmd_error_p) - current_uiout->field_string ("error_p", "*"); - else - current_uiout->field_skip ("error_p"); + if (list_valid_p) + { + current_uiout->field_fmt ("lstaddr", "0x%05x", list_lsa << 3); + current_uiout->field_fmt ("lstsize", "0x%05x", list_size << 3); + } + else + { + current_uiout->field_skip ("lstaddr"); + current_uiout->field_skip ("lstsize"); + } - do_cleanups (cmd_chain); + if (cmd_error_p) + current_uiout->field_string ("error_p", "*"); + else + current_uiout->field_skip ("error_p"); + } if (!current_uiout->is_mi_like_p ()) printf_filtered ("\n"); } - - do_cleanups (chain); } static void |