aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-08-11 15:02:04 -0600
committerTom Tromey <tom@tromey.com>2017-09-09 13:46:05 -0600
commit76f9c9cfd42eb8df90ce8455a92109c0f71b41e1 (patch)
tree412125e3a8e7f78d909430fbed1cd045e332828a /gdb/breakpoint.c
parentdc9fe180a4437b437015a8b835d05e32d64dff3d (diff)
downloadfsf-binutils-gdb-76f9c9cfd42eb8df90ce8455a92109c0f71b41e1.zip
fsf-binutils-gdb-76f9c9cfd42eb8df90ce8455a92109c0f71b41e1.tar.gz
fsf-binutils-gdb-76f9c9cfd42eb8df90ce8455a92109c0f71b41e1.tar.bz2
Use ui_out_emit_tuple in more places
This changes more places to use ui_out_emit_tuple, removing cleanups. ChangeLog 2017-09-09 Tom Tromey <tom@tromey.com> * target.c (flash_erase_command): Use ui_out_emit_tuple. * stack.c (print_frame): Use ui_out_emit_tuple. * spu-tdep.c (info_spu_event_command): Use ui_out_emit_tuple. (info_spu_mailbox_command, info_spu_dma_command) (info_spu_proxydma_command): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Use ui_out_emit_tuple, gdb::byte_vector, bin2hex. * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use ui_out_emit_tuple. * breakpoint.c (print_it_watchpoint): Use ui_out_emit_tuple.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 4b329b9..123420c 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -82,6 +82,7 @@
#include <algorithm>
#include "progspace-and-thread.h"
#include "common/array-view.h"
+#include "common/gdb_optional.h"
/* Enums for exception-handling support. */
enum exception_event_kind
@@ -10536,7 +10537,6 @@ works_in_software_mode_watchpoint (const struct breakpoint *b)
static enum print_stop_action
print_it_watchpoint (bpstat bs)
{
- struct cleanup *old_chain;
struct breakpoint *b;
enum print_stop_action result;
struct watchpoint *w;
@@ -10547,13 +10547,12 @@ print_it_watchpoint (bpstat bs)
b = bs->breakpoint_at;
w = (struct watchpoint *) b;
- old_chain = make_cleanup (null_cleanup, NULL);
-
annotate_watchpoint (b->number);
maybe_print_thread_hit_breakpoint (uiout);
string_file stb;
+ gdb::optional<ui_out_emit_tuple> tuple_emitter;
switch (b->type)
{
case bp_watchpoint:
@@ -10562,7 +10561,7 @@ print_it_watchpoint (bpstat bs)
uiout->field_string
("reason", async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER));
mention (b);
- make_cleanup_ui_out_tuple_begin_end (uiout, "value");
+ tuple_emitter.emplace (uiout, "value");
uiout->text ("\nOld value = ");
watchpoint_value_print (bs->old_val, &stb);
uiout->field_stream ("old", stb);
@@ -10579,7 +10578,7 @@ print_it_watchpoint (bpstat bs)
uiout->field_string
("reason", async_reason_lookup (EXEC_ASYNC_READ_WATCHPOINT_TRIGGER));
mention (b);
- make_cleanup_ui_out_tuple_begin_end (uiout, "value");
+ tuple_emitter.emplace (uiout, "value");
uiout->text ("\nValue = ");
watchpoint_value_print (w->val, &stb);
uiout->field_stream ("value", stb);
@@ -10595,7 +10594,7 @@ print_it_watchpoint (bpstat bs)
("reason",
async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER));
mention (b);
- make_cleanup_ui_out_tuple_begin_end (uiout, "value");
+ tuple_emitter.emplace (uiout, "value");
uiout->text ("\nOld value = ");
watchpoint_value_print (bs->old_val, &stb);
uiout->field_stream ("old", stb);
@@ -10608,7 +10607,7 @@ print_it_watchpoint (bpstat bs)
uiout->field_string
("reason",
async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER));
- make_cleanup_ui_out_tuple_begin_end (uiout, "value");
+ tuple_emitter.emplace (uiout, "value");
uiout->text ("\nValue = ");
}
watchpoint_value_print (w->val, &stb);
@@ -10620,7 +10619,6 @@ print_it_watchpoint (bpstat bs)
result = PRINT_UNKNOWN;
}
- do_cleanups (old_chain);
return result;
}