aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-04-12 16:10:02 -0600
committerTom Tromey <tom@tromey.com>2017-04-22 09:46:59 -0600
commit46b9c12945629fffb61001a8f13a37c96675c0b7 (patch)
tree56cb90f08f7ce3f3ee41c8a7058e57d5be8e1bf3 /gdb/breakpoint.c
parent2e78302469502f4f8a98144b60c09d4d9b6438fd (diff)
downloadgdb-46b9c12945629fffb61001a8f13a37c96675c0b7.zip
gdb-46b9c12945629fffb61001a8f13a37c96675c0b7.tar.gz
gdb-46b9c12945629fffb61001a8f13a37c96675c0b7.tar.bz2
More uses of ui_out_emit_tuple
This patch adds a few more uses of ui_out_emit_tuple. In these cases a slightly more complicated change was needed. This also adds annotate_arg_emitter, for use in stack.c, to avoid having to introduce a new scope and reindent the code for a single call. ChangeLog 2017-04-22 Tom Tromey <tom@tromey.com> * stack.c (print_frame_arg): Use ui_out_emit_tuple, annotate_arg_emitter. * breakpoint.c (print_mention_watchpoint) (print_mention_masked_watchpoint): Use ui_out_emit_tuple. * annotate.h (struct annotate_arg_emitter): New.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 2ff4406..269cddd 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10778,37 +10778,37 @@ print_it_watchpoint (bpstat bs)
static void
print_mention_watchpoint (struct breakpoint *b)
{
- struct cleanup *ui_out_chain;
struct watchpoint *w = (struct watchpoint *) b;
struct ui_out *uiout = current_uiout;
+ const char *tuple_name;
switch (b->type)
{
case bp_watchpoint:
uiout->text ("Watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "wpt");
+ tuple_name = "wpt";
break;
case bp_hardware_watchpoint:
uiout->text ("Hardware watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "wpt");
+ tuple_name = "wpt";
break;
case bp_read_watchpoint:
uiout->text ("Hardware read watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-rwpt");
+ tuple_name = "hw-rwpt";
break;
case bp_access_watchpoint:
uiout->text ("Hardware access (read/write) watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-awpt");
+ tuple_name = "hw-awpt";
break;
default:
internal_error (__FILE__, __LINE__,
_("Invalid hardware watchpoint type."));
}
+ ui_out_emit_tuple tuple_emitter (uiout, tuple_name);
uiout->field_int ("number", b->number);
uiout->text (": ");
uiout->field_string ("exp", w->exp_string);
- do_cleanups (ui_out_chain);
}
/* Implement the "print_recreate" breakpoint_ops method for
@@ -10977,31 +10977,31 @@ print_mention_masked_watchpoint (struct breakpoint *b)
{
struct watchpoint *w = (struct watchpoint *) b;
struct ui_out *uiout = current_uiout;
- struct cleanup *ui_out_chain;
+ const char *tuple_name;
switch (b->type)
{
case bp_hardware_watchpoint:
uiout->text ("Masked hardware watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "wpt");
+ tuple_name = "wpt";
break;
case bp_read_watchpoint:
uiout->text ("Masked hardware read watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-rwpt");
+ tuple_name = "hw-rwpt";
break;
case bp_access_watchpoint:
uiout->text ("Masked hardware access (read/write) watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-awpt");
+ tuple_name = "hw-awpt";
break;
default:
internal_error (__FILE__, __LINE__,
_("Invalid hardware watchpoint type."));
}
+ ui_out_emit_tuple tuple_emitter (uiout, tuple_name);
uiout->field_int ("number", b->number);
uiout->text (": ");
uiout->field_string ("exp", w->exp_string);
- do_cleanups (ui_out_chain);
}
/* Implement the "print_recreate" breakpoint_ops method for