Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA 2/5] More uses of ui_out_emit_tuple
  2017-04-14  2:23 [RFA 0/5] some cleanup removal for ui_out Tom Tromey
@ 2017-04-14  2:23 ` Tom Tromey
  2017-04-18 18:42   ` Pedro Alves
  2017-04-14  2:23 ` [RFA 3/5] Use ui_out_emit_tuple in tracepoint.c Tom Tromey
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2017-04-14  2:23 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This patch adds a few more uses of ui_out_emit_tuple.  In these cases
a slightly more complicated change was needed.

gdb/ChangeLog
2017-04-13  Tom Tromey  <tom@tromey.com>

	* stack.c (print_frame_arg): Use ui_out_emit_tuple.
	* breakpoint.c (print_mention_watchpoint)
	(print_mention_masked_watchpoint): Use ui_out_emit_tuple.
---
 gdb/ChangeLog    |   6 +++
 gdb/breakpoint.c |  22 ++++-----
 gdb/stack.c      | 141 ++++++++++++++++++++++++++++---------------------------
 3 files changed, 88 insertions(+), 81 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 688d11f..1ec48a3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2017-04-13  Tom Tromey  <tom@tromey.com>
 
+	* stack.c (print_frame_arg): Use ui_out_emit_tuple.
+	* breakpoint.c (print_mention_watchpoint)
+	(print_mention_masked_watchpoint): Use ui_out_emit_tuple.
+
+2017-04-13  Tom Tromey  <tom@tromey.com>
+
 	* record-btrace.c (record_btrace_insn_history)
 	(record_btrace_insn_history_range, record_btrace_call_history)
 	(record_btrace_call_history_range): Use ui_out_emit_tuple.
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
diff --git a/gdb/stack.c b/gdb/stack.c
index 32acca1..05081fa 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -224,7 +224,6 @@ static void
 print_frame_arg (const struct frame_arg *arg)
 {
   struct ui_out *uiout = current_uiout;
-  struct cleanup *old_chain;
   const char *error_message = NULL;
 
   string_file stb;
@@ -237,77 +236,79 @@ print_frame_arg (const struct frame_arg *arg)
 
   annotate_arg_begin ();
 
-  old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
-  fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym),
-			   SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI);
-  if (arg->entry_kind == print_entry_values_compact)
-    {
-      /* It is OK to provide invalid MI-like stream as with
-	 PRINT_ENTRY_VALUE_COMPACT we never use MI.  */
-      stb.puts ("=");
-
-      fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym),
-			       SYMBOL_LANGUAGE (arg->sym),
-			       DMGL_PARAMS | DMGL_ANSI);
-    }
-  if (arg->entry_kind == print_entry_values_only
-      || arg->entry_kind == print_entry_values_compact)
-    stb.puts ("@entry");
-  uiout->field_stream ("name", stb);
-  annotate_arg_name_end ();
-  uiout->text ("=");
-
-  if (!arg->val && !arg->error)
-    uiout->text ("...");
-  else
-    {
-      if (arg->error)
-	error_message = arg->error;
-      else
-	{
-	  TRY
-	    {
-	      const struct language_defn *language;
-	      struct value_print_options opts;
-
-	      /* Avoid value_print because it will deref ref parameters.  We
-		 just want to print their addresses.  Print ??? for args whose
-		 address we do not know.  We pass 2 as "recurse" to val_print
-		 because our standard indentation here is 4 spaces, and
-		 val_print indents 2 for each recurse.  */ 
-
-	      annotate_arg_value (value_type (arg->val));
-
-	      /* Use the appropriate language to display our symbol, unless the
-		 user forced the language to a specific language.  */
-	      if (language_mode == language_mode_auto)
-		language = language_def (SYMBOL_LANGUAGE (arg->sym));
-	      else
-		language = current_language;
-
-	      get_no_prettyformat_print_options (&opts);
-	      opts.deref_ref = 1;
-	      opts.raw = print_raw_frame_arguments;
-
-	      /* True in "summary" mode, false otherwise.  */
-	      opts.summary = !strcmp (print_frame_arguments, "scalars");
-
-	      common_val_print (arg->val, &stb, 2, &opts, language);
-	    }
-	  CATCH (except, RETURN_MASK_ERROR)
-	    {
-	      error_message = except.message;
-	    }
-	  END_CATCH
-	}
-      if (error_message != NULL)
-	stb.printf (_("<error reading variable: %s>"), error_message);
-    }
+  {
+    ui_out_emit_tuple tuple_emitter (uiout, NULL);
+    fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym),
+			     SYMBOL_LANGUAGE (arg->sym),
+			     DMGL_PARAMS | DMGL_ANSI);
+    if (arg->entry_kind == print_entry_values_compact)
+      {
+	/* It is OK to provide invalid MI-like stream as with
+	   PRINT_ENTRY_VALUE_COMPACT we never use MI.  */
+	stb.puts ("=");
 
-  uiout->field_stream ("value", stb);
+	fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym),
+				 SYMBOL_LANGUAGE (arg->sym),
+				 DMGL_PARAMS | DMGL_ANSI);
+      }
+    if (arg->entry_kind == print_entry_values_only
+	|| arg->entry_kind == print_entry_values_compact)
+      stb.puts ("@entry");
+    uiout->field_stream ("name", stb);
+    annotate_arg_name_end ();
+    uiout->text ("=");
+
+    if (!arg->val && !arg->error)
+      uiout->text ("...");
+    else
+      {
+	if (arg->error)
+	  error_message = arg->error;
+	else
+	  {
+	    TRY
+	      {
+		const struct language_defn *language;
+		struct value_print_options opts;
+
+		/* Avoid value_print because it will deref ref
+		   parameters.  We just want to print their addresses.
+		   Print ??? for args whose address we do not know.
+		   We pass 2 as "recurse" to val_print because our
+		   standard indentation here is 4 spaces, and
+		   val_print indents 2 for each recurse.  */ 
+
+		annotate_arg_value (value_type (arg->val));
+
+		/* Use the appropriate language to display our symbol,
+		   unless the user forced the language to a specific
+		   language.  */
+		if (language_mode == language_mode_auto)
+		  language = language_def (SYMBOL_LANGUAGE (arg->sym));
+		else
+		  language = current_language;
+
+		get_no_prettyformat_print_options (&opts);
+		opts.deref_ref = 1;
+		opts.raw = print_raw_frame_arguments;
+
+		/* True in "summary" mode, false otherwise.  */
+		opts.summary = !strcmp (print_frame_arguments, "scalars");
+
+		common_val_print (arg->val, &stb, 2, &opts, language);
+	      }
+	    CATCH (except, RETURN_MASK_ERROR)
+	      {
+		error_message = except.message;
+	      }
+	    END_CATCH
+	      }
+	if (error_message != NULL)
+	  stb.printf (_("<error reading variable: %s>"), error_message);
+      }
 
-  /* Also invoke ui_out_tuple_end.  */
-  do_cleanups (old_chain);
+    uiout->field_stream ("value", stb);
+  }
 
   annotate_arg_end ();
 }
-- 
2.9.3


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [RFA 5/5] Use ui_out_emit_list
  2017-04-14  2:23 [RFA 0/5] some cleanup removal for ui_out Tom Tromey
  2017-04-14  2:23 ` [RFA 2/5] More uses of ui_out_emit_tuple Tom Tromey
  2017-04-14  2:23 ` [RFA 3/5] Use ui_out_emit_tuple in tracepoint.c Tom Tromey
@ 2017-04-14  2:23 ` Tom Tromey
  2017-04-18 18:44   ` Pedro Alves
  2017-04-14  2:24 ` [RFA 1/5] Use ui_out_emit_tuple Tom Tromey
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2017-04-14  2:23 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some spots to use ui_out_emit_list.  This only touches
"easy" cases, where the cleanup was used in a block-structured way.
There's also one more use of ui_out_emit_tuple in here.

ChangeLog
2017-04-13  Tom Tromey  <tom@tromey.com>

	* mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use
	ui_out_emit_list.
	* stack.c (print_frame): Use ui_out_emit_list.
	* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
	ui_out_emit_list.
	* mi/mi-main.c (print_one_inferior)
	(mi_cmd_data_list_register_names)
	(mi_cmd_data_list_register_values, mi_cmd_list_features)
	(mi_cmd_list_target_features, mi_cmd_trace_frame_collected): Use
	ui_out_emit_list.
	* mi/mi-interp.c (mi_on_normal_stop_1): Use ui_out_emit_list.
	(mi_output_solib_attribs): Use ui_out_emit_list,
	ui_out_emit_tuple.
	* mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_list.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
	(mi_cmd_stack_list_args, list_args_or_locals): Use
	ui_out_emit_list.
	* disasm.c (do_assembly_only): Use ui_out_emit_list.
	* breakpoint.c (print_solib_event, output_thread_groups): Use
	ui_out_emit_list.
---
 gdb/ChangeLog           | 23 +++++++++++++++++++++++
 gdb/breakpoint.c        | 17 +++--------------
 gdb/disasm.c            |  6 +-----
 gdb/mi/mi-cmd-file.c    |  5 +----
 gdb/mi/mi-cmd-stack.c   | 14 +++-----------
 gdb/mi/mi-cmd-var.c     |  4 +---
 gdb/mi/mi-interp.c      | 12 +++---------
 gdb/mi/mi-main.c        | 40 ++++++++--------------------------------
 gdb/mi/mi-symbol-cmds.c |  5 +----
 gdb/stack.c             | 27 +++++++++++++--------------
 10 files changed, 57 insertions(+), 96 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e972b4c..7e38580 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,28 @@
 2017-04-13  Tom Tromey  <tom@tromey.com>
 
+	* mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use
+	ui_out_emit_list.
+	* stack.c (print_frame): Use ui_out_emit_list.
+	* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
+	ui_out_emit_list.
+	* mi/mi-main.c (print_one_inferior)
+	(mi_cmd_data_list_register_names)
+	(mi_cmd_data_list_register_values, mi_cmd_list_features)
+	(mi_cmd_list_target_features, mi_cmd_trace_frame_collected): Use
+	ui_out_emit_list.
+	* mi/mi-interp.c (mi_on_normal_stop_1): Use ui_out_emit_list.
+	(mi_output_solib_attribs): Use ui_out_emit_list,
+	ui_out_emit_tuple.
+	* mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_list.
+	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
+	(mi_cmd_stack_list_args, list_args_or_locals): Use
+	ui_out_emit_list.
+	* disasm.c (do_assembly_only): Use ui_out_emit_list.
+	* breakpoint.c (print_solib_event, output_thread_groups): Use
+	ui_out_emit_list.
+
+2017-04-13  Tom Tromey  <tom@tromey.com>
+
 	* mi/mi-main.c (print_variable_or_computed): Use ui_out_emit_tuple.
 	* mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_tuple.
 	* mi/mi-cmd-stack.c (list_arg_or_local): Use ui_out_emit_tuple.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 269cddd..b0f7cb5 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -4885,13 +4885,11 @@ print_solib_event (int is_catchpoint)
 
   if (any_deleted)
     {
-      struct cleanup *cleanup;
       char *name;
       int ix;
 
       current_uiout->text (_("  Inferior unloaded "));
-      cleanup = make_cleanup_ui_out_list_begin_end (current_uiout,
-						    "removed");
+      ui_out_emit_list list_emitter (current_uiout, "removed");
       for (ix = 0;
 	   VEC_iterate (char_ptr, current_program_space->deleted_solibs,
 			ix, name);
@@ -4902,19 +4900,15 @@ print_solib_event (int is_catchpoint)
 	  current_uiout->field_string ("library", name);
 	  current_uiout->text ("\n");
 	}
-
-      do_cleanups (cleanup);
     }
 
   if (any_added)
     {
       struct so_list *iter;
       int ix;
-      struct cleanup *cleanup;
 
       current_uiout->text (_("  Inferior loaded "));
-      cleanup = make_cleanup_ui_out_list_begin_end (current_uiout,
-						    "added");
+      ui_out_emit_list list_emitter (current_uiout, "added");
       for (ix = 0;
 	   VEC_iterate (so_list_ptr, current_program_space->added_solibs,
 			ix, iter);
@@ -4925,8 +4919,6 @@ print_solib_event (int is_catchpoint)
 	  current_uiout->field_string ("library", iter->so_name);
 	  current_uiout->text ("\n");
 	}
-
-      do_cleanups (cleanup);
     }
 }
 
@@ -6271,7 +6263,6 @@ output_thread_groups (struct ui_out *uiout,
 		      VEC(int) *inf_num,
 		      int mi_only)
 {
-  struct cleanup *back_to;
   int is_mi = uiout->is_mi_like_p ();
   int inf;
   int i;
@@ -6281,7 +6272,7 @@ output_thread_groups (struct ui_out *uiout,
   if (!is_mi && mi_only)
     return;
 
-  back_to = make_cleanup_ui_out_list_begin_end (uiout, field_name);
+  ui_out_emit_list list_emitter (uiout, field_name);
 
   for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
     {
@@ -6302,8 +6293,6 @@ output_thread_groups (struct ui_out *uiout,
 	  uiout->text (plongest (inf));
 	}
     }
-
-  do_cleanups (back_to);
 }
 
 /* Print B to gdb_stdout.  */
diff --git a/gdb/disasm.c b/gdb/disasm.c
index fde52c3..83f9871 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -732,13 +732,9 @@ do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
 		  CORE_ADDR low, CORE_ADDR high,
 		  int how_many, int flags)
 {
-  struct cleanup *ui_out_chain;
-
-  ui_out_chain = make_cleanup_ui_out_list_begin_end (uiout, "asm_insns");
+  ui_out_emit_list list_emitter (uiout, "asm_insns");
 
   dump_insns (gdbarch, uiout, low, high, how_many, flags, NULL);
-
-  do_cleanups (ui_out_chain);
 }
 
 /* Initialize the disassemble info struct ready for the specified
diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c
index d166ff6..2b3522b 100644
--- a/gdb/mi/mi-cmd-file.c
+++ b/gdb/mi/mi-cmd-file.c
@@ -144,8 +144,7 @@ mi_cmd_file_list_shared_libraries (const char *command, char **argv, int argc)
   update_solib_list (1);
 
   /* Print the table header.  */
-  struct cleanup *cleanup
-    = make_cleanup_ui_out_list_begin_end (uiout, "shared-libraries");
+  ui_out_emit_list list_emitter (uiout, "shared-libraries");
 
   ALL_SO_LIBS (so)
     {
@@ -160,6 +159,4 @@ mi_cmd_file_list_shared_libraries (const char *command, char **argv, int argc)
 
       do_cleanups (tuple_clean_up);
     }
-
-  do_cleanups (cleanup);
 }
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index bd24e5b..6250b75 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -82,7 +82,6 @@ mi_cmd_stack_list_frames (const char *command, char **argv, int argc)
   int frame_low;
   int frame_high;
   int i;
-  struct cleanup *cleanup_stack;
   struct frame_info *fi;
   enum ext_lang_bt_status result = EXT_LANG_BT_ERROR;
   int raw_arg = 0;
@@ -143,7 +142,7 @@ mi_cmd_stack_list_frames (const char *command, char **argv, int argc)
   if (fi == NULL)
     error (_("-stack-list-frames: Not enough frames in stack."));
 
-  cleanup_stack = make_cleanup_ui_out_list_begin_end (current_uiout, "stack");
+  ui_out_emit_list list_emitter (current_uiout, "stack");
 
   if (! raw_arg && frame_filters)
     {
@@ -177,8 +176,6 @@ mi_cmd_stack_list_frames (const char *command, char **argv, int argc)
 	  print_frame_info (fi, 1, LOC_AND_ADDRESS, 0 /* args */, 0);
 	}
     }
-
-  do_cleanups (cleanup_stack);
 }
 
 void
@@ -291,7 +288,6 @@ mi_cmd_stack_list_args (const char *command, char **argv, int argc)
   int frame_high;
   int i;
   struct frame_info *fi;
-  struct cleanup *cleanup_stack_args;
   enum print_values print_values;
   struct ui_out *uiout = current_uiout;
   int raw_arg = 0;
@@ -359,8 +355,7 @@ mi_cmd_stack_list_args (const char *command, char **argv, int argc)
   if (fi == NULL)
     error (_("-stack-list-arguments: Not enough frames in stack."));
 
-  cleanup_stack_args
-    = make_cleanup_ui_out_list_begin_end (uiout, "stack-args");
+  ui_out_emit_list list_emitter (uiout, "stack-args");
 
   if (! raw_arg && frame_filters)
     {
@@ -394,7 +389,6 @@ mi_cmd_stack_list_args (const char *command, char **argv, int argc)
 	  list_args_or_locals (arguments, print_values, fi, skip_unavailable);
 	}
     }
-  do_cleanups (cleanup_stack_args);
 }
 
 /* Print a list of the local variables (including arguments) for the 
@@ -570,7 +564,6 @@ list_args_or_locals (enum what_to_list what, enum print_values values,
   const struct block *block;
   struct symbol *sym;
   struct block_iterator iter;
-  struct cleanup *cleanup_list;
   struct type *type;
   const char *name_of_result;
   struct ui_out *uiout = current_uiout;
@@ -593,7 +586,7 @@ list_args_or_locals (enum what_to_list what, enum print_values values,
 		      "unexpected what_to_list: %d", (int) what);
     }
 
-  cleanup_list = make_cleanup_ui_out_list_begin_end (uiout, name_of_result);
+  ui_out_emit_list list_emitter (uiout, name_of_result);
 
   while (block != 0)
     {
@@ -681,7 +674,6 @@ list_args_or_locals (enum what_to_list what, enum print_values values,
       else
 	block = BLOCK_SUPERBLOCK (block);
     }
-  do_cleanups (cleanup_list);
 }
 
 void
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 1a7e322..191e770 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -772,16 +772,14 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
 	{
 	  int j;
 	  varobj_p child;
-	  struct cleanup *cleanup;
 
-	  cleanup = make_cleanup_ui_out_list_begin_end (uiout, "new_children");
+	  ui_out_emit_list list_emitter (uiout, "new_children");
 	  for (j = 0; VEC_iterate (varobj_p, r->newobj, j, child); ++j)
 	    {
 	      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 	      print_varobj (child, print_values, 1 /* print_expression */);
 	    }
 
-	  do_cleanups (cleanup);
 	  VEC_free (varobj_p, r->newobj);
 	  r->newobj = NULL;	/* Paranoia.  */
 	}
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index a769fe9..959ae37 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -680,11 +680,9 @@ mi_on_normal_stop_1 (struct bpstats *bs, int print_frame)
       mi_uiout->field_int ("thread-id", tp->global_num);
       if (non_stop)
 	{
-	  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end 
-	    (mi_uiout, "stopped-threads");
+	  ui_out_emit_list list_emitter (mi_uiout, "stopped-threads");
 
 	  mi_uiout->field_int (NULL, tp->global_num);
-	  do_cleanups (back_to);
 	}
       else
 	mi_uiout->field_string ("stopped-threads", "all");
@@ -1128,17 +1126,13 @@ mi_output_solib_attribs (ui_out *uiout, struct so_list *solib)
   if (!gdbarch_has_global_solist (target_gdbarch ()))
       uiout->field_fmt ("thread-group", "i%d", current_inferior ()->num);
 
-  struct cleanup *cleanup
-    = make_cleanup_ui_out_list_begin_end (uiout, "ranges");
-  struct cleanup *tuple_clean_up
-    = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+  ui_out_emit_list list_emitter (uiout, "ranges");
+  ui_out_emit_tuple tuple_emitter (uiout, NULL);
   if (solib->addr_high != 0)
     {
       uiout->field_core_addr ("from", gdbarch, solib->addr_low);
       uiout->field_core_addr ("to", gdbarch, solib->addr_high);
     }
-  do_cleanups (tuple_clean_up);
-  do_cleanups (cleanup);
 }
 
 static void
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 7e225db..cb68fd6 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -686,8 +686,7 @@ print_one_inferior (struct inferior *inferior, void *xdata)
       if (!VEC_empty (int, data.cores))
 	{
 	  int *b, *e;
-	  struct cleanup *back_to_2 =
-	    make_cleanup_ui_out_list_begin_end (uiout, "cores");
+	  ui_out_emit_list list_emitter (uiout, "cores");
 
 	  qsort (VEC_address (int, data.cores),
 		 VEC_length (int, data.cores), sizeof (int),
@@ -699,8 +698,6 @@ print_one_inferior (struct inferior *inferior, void *xdata)
 
 	  for (; b != e; ++b)
 	    uiout->field_int (NULL, *b);
-
-	  do_cleanups (back_to_2);
 	}
 
       if (top_data->recurse)
@@ -994,7 +991,6 @@ mi_cmd_data_list_register_names (const char *command, char **argv, int argc)
   struct ui_out *uiout = current_uiout;
   int regnum, numregs;
   int i;
-  struct cleanup *cleanup;
 
   /* Note that the test for a valid register must include checking the
      gdbarch_register_name because gdbarch_num_regs may be allocated
@@ -1006,7 +1002,7 @@ mi_cmd_data_list_register_names (const char *command, char **argv, int argc)
   gdbarch = get_current_arch ();
   numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
 
-  cleanup = make_cleanup_ui_out_list_begin_end (uiout, "register-names");
+  ui_out_emit_list list_emitter (uiout, "register-names");
 
   if (argc == 0)		/* No args, just do all the regs.  */
     {
@@ -1035,7 +1031,6 @@ mi_cmd_data_list_register_names (const char *command, char **argv, int argc)
       else
 	uiout->field_string (NULL, gdbarch_register_name (gdbarch, regnum));
     }
-  do_cleanups (cleanup);
 }
 
 void
@@ -1157,7 +1152,6 @@ mi_cmd_data_list_register_values (const char *command, char **argv, int argc)
   struct gdbarch *gdbarch;
   int regnum, numregs, format;
   int i;
-  struct cleanup *list_cleanup;
   int skip_unavailable = 0;
   int oind = 0;
   enum opt
@@ -1204,7 +1198,7 @@ mi_cmd_data_list_register_values (const char *command, char **argv, int argc)
   gdbarch = get_frame_arch (frame);
   numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
 
-  list_cleanup = make_cleanup_ui_out_list_begin_end (uiout, "register-values");
+  ui_out_emit_list list_emitter (uiout, "register-values");
 
   if (argc - oind == 1)
     {
@@ -1234,7 +1228,6 @@ mi_cmd_data_list_register_values (const char *command, char **argv, int argc)
       else
 	error (_("bad register number"));
     }
-  do_cleanups (list_cleanup);
 }
 
 /* Output one register REGNUM's contents in the desired FORMAT.  If
@@ -1830,10 +1823,9 @@ mi_cmd_list_features (const char *command, char **argv, int argc)
 {
   if (argc == 0)
     {
-      struct cleanup *cleanup = NULL;
       struct ui_out *uiout = current_uiout;
 
-      cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
+      ui_out_emit_list list_emitter (uiout, "features");
       uiout->field_string (NULL, "frozen-varobjs");
       uiout->field_string (NULL, "pending-breakpoints");
       uiout->field_string (NULL, "thread-info");
@@ -1848,7 +1840,6 @@ mi_cmd_list_features (const char *command, char **argv, int argc)
       if (ext_lang_initialized_p (get_ext_lang_defn (EXT_LANG_PYTHON)))
 	uiout->field_string (NULL, "python");
 
-      do_cleanups (cleanup);
       return;
     }
 
@@ -1860,15 +1851,13 @@ mi_cmd_list_target_features (const char *command, char **argv, int argc)
 {
   if (argc == 0)
     {
-      struct cleanup *cleanup = NULL;
       struct ui_out *uiout = current_uiout;
 
-      cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
+      ui_out_emit_list list_emitter (uiout, "features");
       if (mi_async_p ())
 	uiout->field_string (NULL, "async");
       if (target_can_execute_reverse)
 	uiout->field_string (NULL, "reverse");
-      do_cleanups (cleanup);
       return;
     }
 
@@ -2787,12 +2776,9 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
 
   /* Explicitly wholly collected variables.  */
   {
-    struct cleanup *list_cleanup;
     int i;
 
-    list_cleanup = make_cleanup_ui_out_list_begin_end (uiout,
-						       "explicit-variables");
-
+    ui_out_emit_list list_emitter (uiout, "explicit-variables");
     const std::vector<std::string> &wholly_collected
       = clist->wholly_collected ();
     for (size_t i = 0; i < wholly_collected.size (); i++)
@@ -2800,19 +2786,14 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
 	const std::string &str = wholly_collected[i];
 	print_variable_or_computed (str.c_str (), var_print_values);
       }
-
-    do_cleanups (list_cleanup);
   }
 
   /* Computed expressions.  */
   {
-    struct cleanup *list_cleanup;
     char *p;
     int i;
 
-    list_cleanup
-      = make_cleanup_ui_out_list_begin_end (uiout,
-					    "computed-expressions");
+    ui_out_emit_list list_emitter (uiout, "computed-expressions");
 
     const std::vector<std::string> &computed = clist->computed ();
     for (size_t i = 0; i < computed.size (); i++)
@@ -2820,8 +2801,6 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
 	const std::string &str = computed[i];
 	print_variable_or_computed (str.c_str (), comp_print_values);
       }
-
-    do_cleanups (list_cleanup);
   }
 
   /* Registers.  Given pseudo-registers, and that some architectures
@@ -2829,13 +2808,12 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
      the trace frame info, but instead consult the register cache for
      register availability.  */
   {
-    struct cleanup *list_cleanup;
     struct frame_info *frame;
     struct gdbarch *gdbarch;
     int regnum;
     int numregs;
 
-    list_cleanup = make_cleanup_ui_out_list_begin_end (uiout, "registers");
+    ui_out_emit_list list_emitter (uiout, "registers");
 
     frame = get_selected_frame (NULL);
     gdbarch = get_frame_arch (frame);
@@ -2849,8 +2827,6 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
 
 	output_register (frame, regnum, registers_format, 1);
       }
-
-    do_cleanups (list_cleanup);
   }
 
   /* Trace state variables.  */
diff --git a/gdb/mi/mi-symbol-cmds.c b/gdb/mi/mi-symbol-cmds.c
index f9e464d..ea17af7 100644
--- a/gdb/mi/mi-symbol-cmds.c
+++ b/gdb/mi/mi-symbol-cmds.c
@@ -33,7 +33,6 @@ mi_cmd_symbol_list_lines (const char *command, char **argv, int argc)
   char *filename;
   struct symtab *s;
   int i;
-  struct cleanup *cleanup_stack;
   struct ui_out *uiout = current_uiout;
 
   if (argc != 1)
@@ -50,8 +49,8 @@ mi_cmd_symbol_list_lines (const char *command, char **argv, int argc)
      need to perform any other sorting.  */
 
   gdbarch = get_objfile_arch (SYMTAB_OBJFILE (s));
-  cleanup_stack = make_cleanup_ui_out_list_begin_end (uiout, "lines");
 
+  ui_out_emit_list list_emitter (uiout, "lines");
   if (SYMTAB_LINETABLE (s) != NULL && SYMTAB_LINETABLE (s)->nitems > 0)
     for (i = 0; i < SYMTAB_LINETABLE (s)->nitems; i++)
     {
@@ -59,6 +58,4 @@ mi_cmd_symbol_list_lines (const char *command, char **argv, int argc)
       uiout->field_core_addr ("pc", gdbarch, SYMTAB_LINETABLE (s)->item[i].pc);
       uiout->field_int ("line", SYMTAB_LINETABLE (s)->item[i].line);
     }
-
-  do_cleanups (cleanup_stack);
 }
diff --git a/gdb/stack.c b/gdb/stack.c
index 05081fa..477b92f 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1204,7 +1204,6 @@ print_frame (struct frame_info *frame, int print_level,
     {
       struct gdbarch *gdbarch = get_frame_arch (frame);
       int numargs;
-      struct cleanup *args_list_chain;
 
       if (gdbarch_frame_num_args_p (gdbarch))
 	{
@@ -1214,20 +1213,20 @@ print_frame (struct frame_info *frame, int print_level,
       else
 	numargs = -1;
     
-      args_list_chain = make_cleanup_ui_out_list_begin_end (uiout, "args");
-      TRY
-	{
-	  print_frame_args (func, frame, numargs, gdb_stdout);
-	}
-      CATCH (e, RETURN_MASK_ERROR)
-	{
-	}
-      END_CATCH
+      {
+	ui_out_emit_list list_emitter (uiout, "args");
+	TRY
+	  {
+	    print_frame_args (func, frame, numargs, gdb_stdout);
+	  }
+	CATCH (e, RETURN_MASK_ERROR)
+	  {
+	  }
+	END_CATCH
 
-      /* FIXME: ARGS must be a list.  If one argument is a string it
-	  will have " that will not be properly escaped.  */
-      /* Invoke ui_out_tuple_end.  */
-      do_cleanups (args_list_chain);
+	/* FIXME: ARGS must be a list.  If one argument is a string it
+	   will have " that will not be properly escaped.  */
+      }
       QUIT;
     }
   uiout->text (")");
-- 
2.9.3


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [RFA 3/5] Use ui_out_emit_tuple in tracepoint.c
  2017-04-14  2:23 [RFA 0/5] some cleanup removal for ui_out Tom Tromey
  2017-04-14  2:23 ` [RFA 2/5] More uses of ui_out_emit_tuple Tom Tromey
@ 2017-04-14  2:23 ` Tom Tromey
  2017-04-18 18:43   ` Pedro Alves
  2017-04-14  2:23 ` [RFA 5/5] Use ui_out_emit_list Tom Tromey
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2017-04-14  2:23 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some code in tracepoint.c to use ui_out_emit_tuple.  One
of these involved removing an otherwise unrelated cleanup (changing
type to std::string) and the other involved introducing a new block.

gdb/ChangeLog
2017-04-13  Tom Tromey  <tom@tromey.com>

	* tracepoint.c (tvariables_info_1)
	(print_one_static_tracepoint_marker): Use ui_out_emit_tuple.
---
 gdb/ChangeLog    |  5 +++++
 gdb/tracepoint.c | 42 ++++++++++++++++--------------------------
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1ec48a3..ba91cdc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2017-04-13  Tom Tromey  <tom@tromey.com>
 
+	* tracepoint.c (tvariables_info_1)
+	(print_one_static_tracepoint_marker): Use ui_out_emit_tuple.
+
+2017-04-13  Tom Tromey  <tom@tromey.com>
+
 	* stack.c (print_frame_arg): Use ui_out_emit_tuple.
 	* breakpoint.c (print_mention_watchpoint)
 	(print_mention_masked_watchpoint): Use ui_out_emit_tuple.
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index c947c95..808afde 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -506,15 +506,12 @@ tvariables_info_1 (void)
 
   for (ix = 0; VEC_iterate (tsv_s, tvariables, ix, tsv); ++ix)
     {
-      struct cleanup *back_to2;
       const char *c;
-      char *name;
 
-      back_to2 = make_cleanup_ui_out_tuple_begin_end (uiout, "variable");
+      ui_out_emit_tuple tuple_emitter (uiout, "variable");
 
-      name = concat ("$", tsv->name, (char *) NULL);
-      make_cleanup (xfree, name);
-      uiout->field_string ("name", name);
+      std::string name = std::string ("$") + tsv->name;
+      uiout->field_string ("name", name.c_str ());
       uiout->field_string ("initial", plongest (tsv->initial_value));
 
       if (tsv->value_known)
@@ -533,8 +530,6 @@ tvariables_info_1 (void)
       if (c)
         uiout->field_string ("current", c);
       uiout->text ("\n");
-
-      do_cleanups (back_to2);
     }
 
   do_cleanups (back_to);
@@ -3841,7 +3836,6 @@ print_one_static_tracepoint_marker (int count,
   char wrap_indent[80];
   char extra_field_indent[80];
   struct ui_out *uiout = current_uiout;
-  struct cleanup *bkpt_chain;
   VEC(breakpoint_p) *tracepoints;
 
   struct symtab_and_line sal;
@@ -3852,7 +3846,7 @@ print_one_static_tracepoint_marker (int count,
 
   tracepoints = static_tracepoints_here (marker->address);
 
-  bkpt_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "marker");
+  ui_out_emit_tuple tuple_emitter (uiout, "marker");
 
   /* A counter field to help readability.  This is not a stable
      identifier!  */
@@ -3919,24 +3913,22 @@ print_one_static_tracepoint_marker (int count,
 
   if (!VEC_empty (breakpoint_p, tracepoints))
     {
-      struct cleanup *cleanup_chain;
       int ix;
       struct breakpoint *b;
 
-      cleanup_chain = make_cleanup_ui_out_tuple_begin_end (uiout,
-							   "tracepoints-at");
-
-      uiout->text (extra_field_indent);
-      uiout->text (_("Probed by static tracepoints: "));
-      for (ix = 0; VEC_iterate(breakpoint_p, tracepoints, ix, b); ix++)
-	{
-	  if (ix > 0)
-	    uiout->text (", ");
-	  uiout->text ("#");
-	  uiout->field_int ("tracepoint-id", b->number);
-	}
+      {
+	ui_out_emit_tuple tuple_emitter (uiout, "tracepoints-at");
 
-      do_cleanups (cleanup_chain);
+	uiout->text (extra_field_indent);
+	uiout->text (_("Probed by static tracepoints: "));
+	for (ix = 0; VEC_iterate(breakpoint_p, tracepoints, ix, b); ix++)
+	  {
+	    if (ix > 0)
+	      uiout->text (", ");
+	    uiout->text ("#");
+	    uiout->field_int ("tracepoint-id", b->number);
+	  }
+      }
 
       if (uiout->is_mi_like_p ())
 	uiout->field_int ("number-of-tracepoints",
@@ -3945,8 +3937,6 @@ print_one_static_tracepoint_marker (int count,
 	uiout->text ("\n");
     }
   VEC_free (breakpoint_p, tracepoints);
-
-  do_cleanups (bkpt_chain);
 }
 
 static void
-- 
2.9.3


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [RFA 0/5] some cleanup removal for ui_out
@ 2017-04-14  2:23 Tom Tromey
  2017-04-14  2:23 ` [RFA 2/5] More uses of ui_out_emit_tuple Tom Tromey
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Tom Tromey @ 2017-04-14  2:23 UTC (permalink / raw)
  To: gdb-patches

This series converts various (easy) spots to use ui_out_emit_list or
ui_out_emit_tuple.  This removes a number of cleanups.

I've split the less obvious changes out into their own patches for
simpler review.

There are still a number of changes to be made.  Some were in code I
thought I could not readily test (like the Darwin port), and some were
very convoluted (like disasm.c).  Still, this is progress, and a LOC
reduction as well.

Regtested on the buildbot.

Tom


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [RFA 1/5] Use ui_out_emit_tuple
  2017-04-14  2:23 [RFA 0/5] some cleanup removal for ui_out Tom Tromey
                   ` (2 preceding siblings ...)
  2017-04-14  2:23 ` [RFA 5/5] Use ui_out_emit_list Tom Tromey
@ 2017-04-14  2:24 ` Tom Tromey
  2017-04-18 18:42   ` Pedro Alves
  2017-04-14  2:42 ` [RFA 4/5] Use ui_out_emit_tuple in more places in MI Tom Tromey
  2017-04-22 15:44 ` [RFA 0/5] some cleanup removal for ui_out Tom Tromey
  5 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2017-04-14  2:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This patch changes various places to use ui_out_emit_tuple,
eliminating a number of cleanups.  This patch only tackles "easy"
cases, which are ones where the cleanups in question were
block-structured and did not involve any changes other than the
obvious replacement.

2017-04-13  Tom Tromey  <tom@tromey.com>

	* record-btrace.c (record_btrace_insn_history)
	(record_btrace_insn_history_range, record_btrace_call_history)
	(record_btrace_call_history_range): Use ui_out_emit_tuple.
	* thread.c (do_captured_list_thread_ids, print_thread_info_1): Use
	ui_out_emit_tuple.
	* stack.c (print_frame_info): Use ui_out_emit_tuple.
	* solib.c (info_sharedlibrary_command): Use ui_out_emit_tuple.
	* skip.c (skip_info): Use ui_out_emit_tuple.
	* remote.c (show_remote_cmd): Use ui_out_emit_tuple.
	* progspace.c (print_program_space): Use ui_out_emit_tuple.
	* probe.c (info_probes_for_ops): Use ui_out_emit_tuple.
	* osdata.c (info_osdata): Use ui_out_emit_tuple.
	* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
	ui_out_emit_tuple.
	* mi/mi-main.c (print_one_inferior, list_available_thread_groups)
	(output_register, mi_cmd_data_read_memory)
	(mi_cmd_data_read_memory_bytes, mi_load_progress)
	(mi_cmd_trace_frame_collected): Use ui_out_emit_tuple.
	* mi/mi-cmd-var.c (mi_cmd_var_list_children, varobj_update_one):
	Use ui_out_emit_tuple.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_args): Use
	ui_out_emit_tuple.
	* mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
	(mi_cmd_info_gdb_mi_command): Use ui_out_emit_tuple.
	* linux-thread-db.c (info_auto_load_libthread_db): Use
	ui_out_emit_tuple.
	* inferior.c (print_inferior): Use ui_out_emit_tuple.
	* gdb_bfd.c (print_one_bfd): Use ui_out_emit_tuple.
	* disasm.c (do_mixed_source_and_assembly_deprecated)
	(do_mixed_source_and_assembly): Use ui_out_emit_tuple.
	* cp-abi.c (list_cp_abis): Use ui_out_emit_tuple.
	* cli/cli-setshow.c (cmd_show_list): Use ui_out_emit_tuple.
	* breakpoint.c (print_one_breakpoint_location)
	(print_one_breakpoint): Use ui_out_emit_tuple.
	* auto-load.c (print_script, info_auto_load_cmd): Use
	ui_out_emit_tuple.
	* ada-tasks.c (print_ada_task_info): Use ui_out_emit_tuple.
---
 gdb/ChangeLog           | 40 +++++++++++++++++++++++++++++++
 gdb/ada-tasks.c         |  4 +---
 gdb/auto-load.c         | 16 +++----------
 gdb/breakpoint.c        | 17 +++++--------
 gdb/cli/cli-setshow.c   | 15 +++---------
 gdb/cp-abi.c            |  5 +---
 gdb/disasm.c            | 13 +++-------
 gdb/gdb_bfd.c           |  4 +---
 gdb/inferior.c          |  5 +---
 gdb/linux-thread-db.c   |  3 +--
 gdb/mi/mi-cmd-info.c    | 10 ++------
 gdb/mi/mi-cmd-stack.c   |  5 +---
 gdb/mi/mi-cmd-var.c     | 10 ++------
 gdb/mi/mi-main.c        | 63 +++++++++++++++++--------------------------------
 gdb/mi/mi-symbol-cmds.c |  5 ++--
 gdb/osdata.c            | 29 +++++++++++------------
 gdb/probe.c             |  5 +---
 gdb/progspace.c         |  4 +---
 gdb/record-btrace.c     | 22 ++++-------------
 gdb/remote.c            | 11 ++-------
 gdb/skip.c              |  5 +---
 gdb/solib.c             |  6 +----
 gdb/stack.c             |  4 +---
 gdb/thread.c            | 30 ++++++++++-------------
 24 files changed, 126 insertions(+), 205 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 11d77be..688d11f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,43 @@
+2017-04-13  Tom Tromey  <tom@tromey.com>
+
+	* record-btrace.c (record_btrace_insn_history)
+	(record_btrace_insn_history_range, record_btrace_call_history)
+	(record_btrace_call_history_range): Use ui_out_emit_tuple.
+	* thread.c (do_captured_list_thread_ids, print_thread_info_1): Use
+	ui_out_emit_tuple.
+	* stack.c (print_frame_info): Use ui_out_emit_tuple.
+	* solib.c (info_sharedlibrary_command): Use ui_out_emit_tuple.
+	* skip.c (skip_info): Use ui_out_emit_tuple.
+	* remote.c (show_remote_cmd): Use ui_out_emit_tuple.
+	* progspace.c (print_program_space): Use ui_out_emit_tuple.
+	* probe.c (info_probes_for_ops): Use ui_out_emit_tuple.
+	* osdata.c (info_osdata): Use ui_out_emit_tuple.
+	* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
+	ui_out_emit_tuple.
+	* mi/mi-main.c (print_one_inferior, list_available_thread_groups)
+	(output_register, mi_cmd_data_read_memory)
+	(mi_cmd_data_read_memory_bytes, mi_load_progress)
+	(mi_cmd_trace_frame_collected): Use ui_out_emit_tuple.
+	* mi/mi-cmd-var.c (mi_cmd_var_list_children, varobj_update_one):
+	Use ui_out_emit_tuple.
+	* mi/mi-cmd-stack.c (mi_cmd_stack_list_args): Use
+	ui_out_emit_tuple.
+	* mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
+	(mi_cmd_info_gdb_mi_command): Use ui_out_emit_tuple.
+	* linux-thread-db.c (info_auto_load_libthread_db): Use
+	ui_out_emit_tuple.
+	* inferior.c (print_inferior): Use ui_out_emit_tuple.
+	* gdb_bfd.c (print_one_bfd): Use ui_out_emit_tuple.
+	* disasm.c (do_mixed_source_and_assembly_deprecated)
+	(do_mixed_source_and_assembly): Use ui_out_emit_tuple.
+	* cp-abi.c (list_cp_abis): Use ui_out_emit_tuple.
+	* cli/cli-setshow.c (cmd_show_list): Use ui_out_emit_tuple.
+	* breakpoint.c (print_one_breakpoint_location)
+	(print_one_breakpoint): Use ui_out_emit_tuple.
+	* auto-load.c (print_script, info_auto_load_cmd): Use
+	ui_out_emit_tuple.
+	* ada-tasks.c (print_ada_task_info): Use ui_out_emit_tuple.
+
 2017-04-13  Sergio Durigan Junior  <sergiodj@redhat.com>
 
 	PR gdb/21385
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index 624bbdd..ae43da5 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -1073,7 +1073,6 @@ print_ada_task_info (struct ui_out *uiout,
       const struct ada_task_info *const task_info =
 	VEC_index (ada_task_info_s, data->task_list, taskno - 1);
       int parent_id;
-      struct cleanup *chain2;
 
       gdb_assert (task_info != NULL);
 
@@ -1083,7 +1082,7 @@ print_ada_task_info (struct ui_out *uiout,
       if (taskno_arg && taskno != taskno_arg)
         continue;
 
-      chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
       /* Print a star if this task is the current task (or the task
          currently selected).  */
@@ -1143,7 +1142,6 @@ print_ada_task_info (struct ui_out *uiout,
 						   : _("<no name>"));
 
       uiout->text ("\n");
-      do_cleanups (chain2);
     }
 
   do_cleanups (old_chain);
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index edaf264..37bf942 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -1268,9 +1268,8 @@ static void
 print_script (struct loaded_script *script)
 {
   struct ui_out *uiout = current_uiout;
-  struct cleanup *chain;
 
-  chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+  ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
   uiout->field_string ("loaded", script->loaded ? "Yes" : "No");
   uiout->field_string ("script", script->name);
@@ -1284,8 +1283,6 @@ print_script (struct loaded_script *script)
       uiout->field_string ("full_path", script->full_path);
       uiout->text ("\n");
     }
-
-  do_cleanups (chain);
 }
 
 /* Helper for info_auto_load_scripts to sort the scripts by name.  */
@@ -1561,12 +1558,11 @@ info_auto_load_cmd (char *args, int from_tty)
   struct cleanup *infolist_chain;
   struct ui_out *uiout = current_uiout;
 
-  infolist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "infolist");
+  ui_out_emit_tuple tuple_emitter (uiout, "infolist");
 
   for (list = *auto_load_info_cmdlist_get (); list != NULL; list = list->next)
     {
-      struct cleanup *option_chain
-	= make_cleanup_ui_out_tuple_begin_end (uiout, "option");
+      ui_out_emit_tuple option_emitter (uiout, "option");
 
       gdb_assert (!list->prefixlist);
       gdb_assert (list->type == not_set_cmd);
@@ -1574,13 +1570,7 @@ info_auto_load_cmd (char *args, int from_tty)
       uiout->field_string ("name", list->name);
       uiout->text (":  ");
       cmd_func (list, auto_load_info_scripts_pattern_nl, from_tty);
-
-      /* Close the tuple.  */
-      do_cleanups (option_chain);
     }
-
-  /* Close the tuple.  */
-  do_cleanups (infolist_chain);
 }
 
 /* Initialize "info auto-load " commands prefix and return it.  */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 4940ec2..2ff4406 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6619,12 +6619,9 @@ print_one_breakpoint_location (struct breakpoint *b,
   l = b->commands ? b->commands->commands : NULL;
   if (!part_of_multiple && l)
     {
-      struct cleanup *script_chain;
-
       annotate_field (9);
-      script_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "script");
+      ui_out_emit_tuple tuple_emitter (uiout, "script");
       print_command_lines (uiout, l, 4);
-      do_cleanups (script_chain);
     }
 
   if (is_tracepoint (b))
@@ -6679,13 +6676,13 @@ print_one_breakpoint (struct breakpoint *b,
 		      struct bp_location **last_loc, 
 		      int allflag)
 {
-  struct cleanup *bkpt_chain;
   struct ui_out *uiout = current_uiout;
 
-  bkpt_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "bkpt");
+  {
+    ui_out_emit_tuple tuple_emitter (uiout, "bkpt");
 
-  print_one_breakpoint_location (b, NULL, 0, last_loc, allflag);
-  do_cleanups (bkpt_chain);
+    print_one_breakpoint_location (b, NULL, 0, last_loc, allflag);
+  }
 
   /* If this breakpoint has custom print function,
      it's already printed.  Otherwise, print individual
@@ -6708,10 +6705,8 @@ print_one_breakpoint (struct breakpoint *b,
 
 	  for (loc = b->loc; loc; loc = loc->next, ++n)
 	    {
-	      struct cleanup *inner2 =
-		make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+	      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 	      print_one_breakpoint_location (b, loc, n, last_loc, allflag);
-	      do_cleanups (inner2);
 	    }
 	}
     }
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 218e1f3..fb0bd49 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -664,32 +664,27 @@ do_show_command (const char *arg, int from_tty, struct cmd_list_element *c)
 void
 cmd_show_list (struct cmd_list_element *list, int from_tty, const char *prefix)
 {
-  struct cleanup *showlist_chain;
   struct ui_out *uiout = current_uiout;
 
-  showlist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "showlist");
+  ui_out_emit_tuple tuple_emitter (uiout, "showlist");
   for (; list != NULL; list = list->next)
     {
       /* If we find a prefix, run its list, prefixing our output by its
          prefix (with "show " skipped).  */
       if (list->prefixlist && !list->abbrev_flag)
 	{
-	  struct cleanup *optionlist_chain
-	    = make_cleanup_ui_out_tuple_begin_end (uiout, "optionlist");
+	  ui_out_emit_tuple optionlist_emitter (uiout, "optionlist");
 	  const char *new_prefix = strstr (list->prefixname, "show ") + 5;
 
 	  if (uiout->is_mi_like_p ())
 	    uiout->field_string ("prefix", new_prefix);
 	  cmd_show_list (*list->prefixlist, from_tty, new_prefix);
-	  /* Close the tuple.  */
-	  do_cleanups (optionlist_chain);
 	}
       else
 	{
 	  if (list->theclass != no_set_class)
 	    {
-	      struct cleanup *option_chain
-		= make_cleanup_ui_out_tuple_begin_end (uiout, "option");
+	      ui_out_emit_tuple option_emitter (uiout, "option");
 
 	      uiout->text (prefix);
 	      uiout->field_string ("name", list->name);
@@ -698,12 +693,8 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, const char *prefix)
 		do_show_command ((char *) NULL, from_tty, list);
 	      else
 		cmd_func (list, NULL, from_tty);
-	      /* Close the tuple.  */
-	      do_cleanups (option_chain);
 	    }
 	}
     }
-  /* Close the tuple.  */
-  do_cleanups (showlist_chain);
 }
 
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
index 510dfd0..b72f227 100644
--- a/gdb/cp-abi.c
+++ b/gdb/cp-abi.c
@@ -314,12 +314,10 @@ static void
 list_cp_abis (int from_tty)
 {
   struct ui_out *uiout = current_uiout;
-  struct cleanup *cleanup_chain;
   int i;
 
   uiout->text ("The available C++ ABIs are:\n");
-  cleanup_chain = make_cleanup_ui_out_tuple_begin_end (uiout,
-						       "cp-abi-list");
+  ui_out_emit_tuple tuple_emitter (uiout, "cp-abi-list");
   for (i = 0; i < num_cp_abis; i++)
     {
       char pad[14];
@@ -337,7 +335,6 @@ list_cp_abis (int from_tty)
       uiout->field_string ("doc", cp_abis[i]->doc);
       uiout->text ("\n");
     }
-  do_cleanups (cleanup_chain);
 }
 
 /* Set the current C++ ABI, or display the list of options if no
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 734db2b..fde52c3 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -437,18 +437,15 @@ do_mixed_source_and_assembly_deprecated
 		  for (; next_line < mle[i].line; next_line++)
 		    {
 		      struct cleanup *ui_out_list_chain_line;
-		      struct cleanup *ui_out_tuple_chain_line;
 		      
-		      ui_out_tuple_chain_line
-			= make_cleanup_ui_out_tuple_begin_end (uiout,
-							       "src_and_asm_line");
+		      ui_out_emit_tuple tuple_emitter (uiout,
+						       "src_and_asm_line");
 		      print_source_lines (symtab, next_line, next_line + 1,
 					  psl_flags);
 		      ui_out_list_chain_line
 			= make_cleanup_ui_out_list_begin_end (uiout,
 							      "line_asm_insn");
 		      do_cleanups (ui_out_list_chain_line);
-		      do_cleanups (ui_out_tuple_chain_line);
 		    }
 		  /* Print the last line and leave list open for
 		     asm instructions to be added.  */
@@ -680,22 +677,18 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
 		 a bunch of line tuples with no asm entries.  */
 	      int l;
 	      struct cleanup *ui_out_list_chain_line;
-	      struct cleanup *ui_out_tuple_chain_line;
 
 	      gdb_assert (sal.symtab != NULL);
 	      for (l = start_preceding_line_to_display;
 		   l < end_preceding_line_to_display;
 		   ++l)
 		{
-		  ui_out_tuple_chain_line
-		    = make_cleanup_ui_out_tuple_begin_end (uiout,
-							   "src_and_asm_line");
+		  ui_out_emit_tuple tuple_emitter (uiout, "src_and_asm_line");
 		  print_source_lines (sal.symtab, l, l + 1, psl_flags);
 		  ui_out_list_chain_line
 		    = make_cleanup_ui_out_list_begin_end (uiout,
 							  "line_asm_insn");
 		  do_cleanups (ui_out_list_chain_line);
-		  do_cleanups (ui_out_tuple_chain_line);
 		}
 	    }
 	  ui_out_tuple_chain
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 37cf6e2..2230127 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -961,14 +961,12 @@ print_one_bfd (void **slot, void *data)
   bfd *abfd = (struct bfd *) *slot;
   struct gdb_bfd_data *gdata = (struct gdb_bfd_data *) bfd_usrdata (abfd);
   struct ui_out *uiout = (struct ui_out *) data;
-  struct cleanup *inner;
 
-  inner = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+  ui_out_emit_tuple tuple_emitter (uiout, NULL);
   uiout->field_int ("refcount", gdata->refc);
   uiout->field_string ("addr", host_address_to_string (abfd));
   uiout->field_string ("filename", bfd_get_filename (abfd));
   uiout->text ("\n");
-  do_cleanups (inner);
 
   return 1;
 }
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 327590a..a5e993f 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -584,12 +584,10 @@ print_inferior (struct ui_out *uiout, char *requested_inferiors)
   uiout->table_body ();
   for (inf = inferior_list; inf; inf = inf->next)
     {
-      struct cleanup *chain2;
-
       if (!number_is_in_list (requested_inferiors, inf->num))
 	continue;
 
-      chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
       if (inf == current_inferior ())
 	uiout->field_string ("current", "*");
@@ -620,7 +618,6 @@ print_inferior (struct ui_out *uiout, char *requested_inferiors)
 	}
 
       uiout->text ("\n");
-      do_cleanups (chain2);
     }
 
   do_cleanups (old_chain);
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index eda3d7b..86254f8 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1636,7 +1636,7 @@ info_auto_load_libthread_db (char *args, int from_tty)
   /* Note I is incremented inside the cycle, not at its end.  */
   for (i = 0; i < info_count;)
     {
-      struct cleanup *chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
       char *pids_end;
 
       info = array[i];
@@ -1661,7 +1661,6 @@ info_auto_load_libthread_db (char *args, int from_tty)
       uiout->field_string ("pids", pids);
 
       uiout->text ("\n");
-      do_cleanups (chain);
     }
 
   do_cleanups (back_to);
diff --git a/gdb/mi/mi-cmd-info.c b/gdb/mi/mi-cmd-info.c
index 1a96d6f..7da4f90 100644
--- a/gdb/mi/mi-cmd-info.c
+++ b/gdb/mi/mi-cmd-info.c
@@ -59,13 +59,9 @@ mi_cmd_info_ada_exceptions (const char *command, char **argv, int argc)
 
   for (ix = 0; VEC_iterate(ada_exc_info, exceptions, ix, info); ix++)
     {
-      struct cleanup *sub_chain;
-
-      sub_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
       uiout->field_string ("name", info->name);
       uiout->field_core_addr ("address", gdbarch, info->addr);
-
-      do_cleanups (sub_chain);
     }
 
   do_cleanups (old_chain);
@@ -79,7 +75,6 @@ mi_cmd_info_gdb_mi_command (const char *command, char **argv, int argc)
   const char *cmd_name;
   struct mi_cmd *cmd;
   struct ui_out *uiout = current_uiout;
-  struct cleanup *old_chain;
 
   /* This command takes exactly one argument.  */
   if (argc != 1)
@@ -95,9 +90,8 @@ mi_cmd_info_gdb_mi_command (const char *command, char **argv, int argc)
 
   cmd = mi_lookup (cmd_name);
 
-  old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "command");
+  ui_out_emit_tuple tuple_emitter (uiout, "command");
   uiout->field_string ("exists", cmd != NULL ? "true" : "false");
-  do_cleanups (old_chain);
 }
 
 void
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index bd91033..f288817 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -387,13 +387,10 @@ mi_cmd_stack_list_args (const char *command, char **argv, int argc)
 	   fi && (i <= frame_high || frame_high == -1);
 	   i++, fi = get_prev_frame (fi))
 	{
-	  struct cleanup *cleanup_frame;
-
 	  QUIT;
-	  cleanup_frame = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
+	  ui_out_emit_tuple tuple_emitter (uiout, "frame");
 	  uiout->field_int ("level", i);
 	  list_args_or_locals (arguments, print_values, fi, skip_unavailable);
-	  do_cleanups (cleanup_frame);
 	}
     }
   do_cleanups (cleanup_stack_args);
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 78ef8e0..0a4ed62 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -421,11 +421,9 @@ mi_cmd_var_list_children (const char *command, char **argv, int argc)
 	   ix < to && VEC_iterate (varobj_p, children, ix, child);
 	   ++ix)
 	{
-	  struct cleanup *cleanup_child;
+	  ui_out_emit_tuple child_emitter (uiout, "child");
 
-	  cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, "child");
 	  print_varobj (child, print_values, 1 /* print expression */);
-	  do_cleanups (cleanup_child);
 	}
       do_cleanups (cleanup_children);
     }
@@ -778,12 +776,8 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
 	  cleanup = make_cleanup_ui_out_list_begin_end (uiout, "new_children");
 	  for (j = 0; VEC_iterate (varobj_p, r->newobj, j, child); ++j)
 	    {
-	      struct cleanup *cleanup_child;
-
-	      cleanup_child
-		= make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+	      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 	      print_varobj (child, print_values, 1 /* print_expression */);
-	      do_cleanups (cleanup_child);
 	    }
 
 	  do_cleanups (cleanup);
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index c3e7bf7..d309ba3 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -660,8 +660,7 @@ print_one_inferior (struct inferior *inferior, void *xdata)
 		  compare_positive_ints))
     {
       struct collect_cores_data data;
-      struct cleanup *back_to
-	= make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
       uiout->field_fmt ("id", "i%d", inferior->num);
       uiout->field_string ("type", "process");
@@ -706,8 +705,6 @@ print_one_inferior (struct inferior *inferior, void *xdata)
 
       if (top_data->recurse)
 	print_thread_info (uiout, NULL, inferior->pid);
-
-      do_cleanups (back_to);
     }
 
   return 0;
@@ -831,8 +828,6 @@ list_available_thread_groups (VEC (int) *ids, int recurse)
 		    ix_items, item);
        ix_items++)
     {
-      struct cleanup *back_to;
-
       const char *pid = get_osdata_column (item, "pid");
       const char *cmd = get_osdata_column (item, "command");
       const char *user = get_osdata_column (item, "user");
@@ -849,7 +844,7 @@ list_available_thread_groups (VEC (int) *ids, int recurse)
 	continue;
 
 
-      back_to = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
       uiout->field_fmt ("id", "%s", pid);
       uiout->field_string ("type", "process");
@@ -875,21 +870,16 @@ list_available_thread_groups (VEC (int) *ids, int recurse)
 		   VEC_iterate (osdata_item_s, children, ix_child, child);
 		   ++ix_child)
 		{
-		  struct cleanup *back_to_2 =
-		    make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+		  ui_out_emit_tuple tuple_emitter (uiout, NULL);
 		  const char *tid = get_osdata_column (child, "tid");
 		  const char *tcore = get_osdata_column (child, "core");
 
 		  uiout->field_string ("id", tid);
 		  if (tcore)
 		    uiout->field_string ("core", tcore);
-
-		  do_cleanups (back_to_2);
 		}
 	    }
 	}
-
-      do_cleanups (back_to);
     }
 
   do_cleanups (cleanup);
@@ -1257,13 +1247,12 @@ output_register (struct frame_info *frame, int regnum, int format,
 {
   struct ui_out *uiout = current_uiout;
   struct value *val = value_of_register (regnum, frame);
-  struct cleanup *tuple_cleanup;
   struct value_print_options opts;
 
   if (skip_unavailable && !value_entirely_available (val))
     return;
 
-  tuple_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+  ui_out_emit_tuple tuple_emitter (uiout, NULL);
   uiout->field_int ("number", regnum);
 
   if (format == 'N')
@@ -1280,8 +1269,6 @@ output_register (struct frame_info *frame, int regnum, int format,
 	     value_embedded_offset (val), 0,
 	     &stb, 0, val, &opts, current_language);
   uiout->field_stream ("value", stb);
-
-  do_cleanups (tuple_cleanup);
 }
 
 /* Write given values into registers. The registers and values are
@@ -1520,11 +1507,10 @@ mi_cmd_data_read_memory (const char *command, char **argv, int argc)
       {
 	int col;
 	int col_byte;
-	struct cleanup *cleanup_tuple;
 	struct cleanup *cleanup_list_data;
 	struct value_print_options opts;
 
-	cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+	ui_out_emit_tuple tuple_emitter (uiout, NULL);
 	uiout->field_core_addr ("addr", gdbarch, addr + row_byte);
 	/* ui_out_field_core_addr_symbolic (uiout, "saddr", addr +
 	   row_byte); */
@@ -1564,7 +1550,6 @@ mi_cmd_data_read_memory (const char *command, char **argv, int argc)
 	      }
 	    uiout->field_stream ("ascii", stream);
 	  }
-	do_cleanups (cleanup_tuple);
       }
     do_cleanups (cleanup_list);
   }
@@ -1629,7 +1614,7 @@ mi_cmd_data_read_memory_bytes (const char *command, char **argv, int argc)
        VEC_iterate (memory_read_result_s, result, ix, read_result);
        ++ix)
     {
-      struct cleanup *t = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
       char *data, *p;
       int i;
       int alloc_len;
@@ -1649,7 +1634,6 @@ mi_cmd_data_read_memory_bytes (const char *command, char **argv, int argc)
 	}
       uiout->field_string ("contents", data);
       xfree (data);
-      do_cleanups (t);
     }
   do_cleanups (cleanups);
 }
@@ -2385,19 +2369,18 @@ mi_load_progress (const char *section_name,
 		 strcmp (previous_sect_name, section_name) : 1);
   if (new_section)
     {
-      struct cleanup *cleanup_tuple;
-
       xfree (previous_sect_name);
       previous_sect_name = xstrdup (section_name);
 
       if (current_token)
 	fputs_unfiltered (current_token, mi->raw_stdout);
       fputs_unfiltered ("+download", mi->raw_stdout);
-      cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
-      uiout->field_string ("section", section_name);
-      uiout->field_int ("section-size", total_section);
-      uiout->field_int ("total-size", grand_total);
-      do_cleanups (cleanup_tuple);
+      {
+	ui_out_emit_tuple tuple_emitter (uiout, NULL);
+	uiout->field_string ("section", section_name);
+	uiout->field_int ("section-size", total_section);
+	uiout->field_int ("total-size", grand_total);
+      }
       mi_out_put (uiout, mi->raw_stdout);
       fputs_unfiltered ("\n", mi->raw_stdout);
       gdb_flush (mi->raw_stdout);
@@ -2406,19 +2389,18 @@ mi_load_progress (const char *section_name,
   steady_clock::time_point time_now = steady_clock::now ();
   if (time_now - last_update > milliseconds (500))
     {
-      struct cleanup *cleanup_tuple;
-
       last_update = time_now;
       if (current_token)
 	fputs_unfiltered (current_token, mi->raw_stdout);
       fputs_unfiltered ("+download", mi->raw_stdout);
-      cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
-      uiout->field_string ("section", section_name);
-      uiout->field_int ("section-sent", sent_so_far);
-      uiout->field_int ("section-size", total_section);
-      uiout->field_int ("total-sent", total_sent);
-      uiout->field_int ("total-size", grand_total);
-      do_cleanups (cleanup_tuple);
+      {
+	ui_out_emit_tuple tuple_emitter (uiout, NULL);
+	uiout->field_string ("section", section_name);
+	uiout->field_int ("section-sent", sent_so_far);
+	uiout->field_int ("section-size", total_section);
+	uiout->field_int ("total-sent", total_sent);
+	uiout->field_int ("total-size", grand_total);
+      }
       mi_out_put (uiout, mi->raw_stdout);
       fputs_unfiltered ("\n", mi->raw_stdout);
       gdb_flush (mi->raw_stdout);
@@ -2888,12 +2870,11 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
 
     for (i = 0; VEC_iterate (int, tinfo->tvars, i, tvar); i++)
       {
-	struct cleanup *cleanup_child;
 	struct trace_state_variable *tsv;
 
 	tsv = find_trace_state_variable_by_number (tvar);
 
-	cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+	ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
 	if (tsv != NULL)
 	  {
@@ -2911,8 +2892,6 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
 	    uiout->field_skip ("name");
 	    uiout->field_skip ("current");
 	  }
-
-	do_cleanups (cleanup_child);
       }
 
     do_cleanups (list_cleanup);
diff --git a/gdb/mi/mi-symbol-cmds.c b/gdb/mi/mi-symbol-cmds.c
index 6614447..f9e464d 100644
--- a/gdb/mi/mi-symbol-cmds.c
+++ b/gdb/mi/mi-symbol-cmds.c
@@ -33,7 +33,7 @@ mi_cmd_symbol_list_lines (const char *command, char **argv, int argc)
   char *filename;
   struct symtab *s;
   int i;
-  struct cleanup *cleanup_stack, *cleanup_tuple;
+  struct cleanup *cleanup_stack;
   struct ui_out *uiout = current_uiout;
 
   if (argc != 1)
@@ -55,10 +55,9 @@ mi_cmd_symbol_list_lines (const char *command, char **argv, int argc)
   if (SYMTAB_LINETABLE (s) != NULL && SYMTAB_LINETABLE (s)->nitems > 0)
     for (i = 0; i < SYMTAB_LINETABLE (s)->nitems; i++)
     {
-      cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
       uiout->field_core_addr ("pc", gdbarch, SYMTAB_LINETABLE (s)->item[i].pc);
       uiout->field_int ("line", SYMTAB_LINETABLE (s)->item[i].line);
-      do_cleanups (cleanup_tuple);
     }
 
   do_cleanups (cleanup_stack);
diff --git a/gdb/osdata.c b/gdb/osdata.c
index 84c4ed7..b9014dd 100644
--- a/gdb/osdata.c
+++ b/gdb/osdata.c
@@ -381,27 +381,26 @@ info_osdata (const char *type)
                        ix_items, item);
           ix_items++)
        {
-         struct cleanup *old_chain;
          int ix_cols;
          struct osdata_column *col;
 
-         old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "item");
+	 {
+	   ui_out_emit_tuple tuple_emitter (uiout, "item");
 
-         for (ix_cols = 0;
-              VEC_iterate (osdata_column_s, item->columns,
-                           ix_cols, col);
-              ix_cols++)
-	   {
-	     char col_name[32];
+	   for (ix_cols = 0;
+		VEC_iterate (osdata_column_s, item->columns,
+			     ix_cols, col);
+		ix_cols++)
+	     {
+	       char col_name[32];
 
-	     if (ix_cols == col_to_skip)
-	       continue;
+	       if (ix_cols == col_to_skip)
+		 continue;
 
-	     snprintf (col_name, 32, "col%d", ix_cols);
-	     uiout->field_string (col_name, col->value);
-	   }
-	 
-         do_cleanups (old_chain);
+	       snprintf (col_name, 32, "col%d", ix_cols);
+	       uiout->field_string (col_name, col->value);
+	     }
+	 }
 
          uiout->text ("\n");
        }
diff --git a/gdb/probe.c b/gdb/probe.c
index c147810..e65e031 100644
--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -678,10 +678,9 @@ info_probes_for_ops (const char *arg, int from_tty,
 
   for (i = 0; VEC_iterate (bound_probe_s, probes, i, probe); ++i)
     {
-      struct cleanup *inner;
       const char *probe_type = probe->probe->pops->type_name (probe->probe);
 
-      inner = make_cleanup_ui_out_tuple_begin_end (current_uiout, "probe");
+      ui_out_emit_tuple tuple_emitter (current_uiout, "probe");
 
       current_uiout->field_string ("type",probe_type);
       current_uiout->field_string ("provider", probe->probe->provider);
@@ -708,8 +707,6 @@ info_probes_for_ops (const char *arg, int from_tty,
       current_uiout->field_string ("object",
 			   objfile_name (probe->objfile));
       current_uiout->text ("\n");
-
-      do_cleanups (inner);
     }
 
   any_found = !VEC_empty (bound_probe_s, probes);
diff --git a/gdb/progspace.c b/gdb/progspace.c
index 4efbafe..b37701e 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -310,14 +310,13 @@ print_program_space (struct ui_out *uiout, int requested)
 
   ALL_PSPACES (pspace)
     {
-      struct cleanup *chain2;
       struct inferior *inf;
       int printed_header;
 
       if (requested != -1 && requested != pspace->num)
 	continue;
 
-      chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
       if (pspace == current_program_space)
 	uiout->field_string ("current", "*");
@@ -354,7 +353,6 @@ print_program_space (struct ui_out *uiout, int requested)
 	  }
 
       uiout->text ("\n");
-      do_cleanups (chain2);
     }
 
   do_cleanups (old_chain);
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 61fba1e..d4f1bcf 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -725,13 +725,11 @@ record_btrace_insn_history (struct target_ops *self, int size, int flags)
   struct btrace_thread_info *btinfo;
   struct btrace_insn_history *history;
   struct btrace_insn_iterator begin, end;
-  struct cleanup *uiout_cleanup;
   struct ui_out *uiout;
   unsigned int context, covered;
 
   uiout = current_uiout;
-  uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout,
-						       "insn history");
+  ui_out_emit_tuple tuple_emitter (uiout, "insn history");
   context = abs (size);
   if (context == 0)
     error (_("Bad record instruction-history-size."));
@@ -800,7 +798,6 @@ record_btrace_insn_history (struct target_ops *self, int size, int flags)
     }
 
   btrace_set_insn_history (btinfo, &begin, &end);
-  do_cleanups (uiout_cleanup);
 }
 
 /* The to_insn_history_range method of target record-btrace.  */
@@ -812,14 +809,12 @@ record_btrace_insn_history_range (struct target_ops *self,
   struct btrace_thread_info *btinfo;
   struct btrace_insn_history *history;
   struct btrace_insn_iterator begin, end;
-  struct cleanup *uiout_cleanup;
   struct ui_out *uiout;
   unsigned int low, high;
   int found;
 
   uiout = current_uiout;
-  uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout,
-						       "insn history");
+  ui_out_emit_tuple tuple_emitter (uiout, "insn history");
   low = from;
   high = to;
 
@@ -852,8 +847,6 @@ record_btrace_insn_history_range (struct target_ops *self,
 
   btrace_insn_history (uiout, btinfo, &begin, &end, flags);
   btrace_set_insn_history (btinfo, &begin, &end);
-
-  do_cleanups (uiout_cleanup);
 }
 
 /* The to_insn_history_from method of target record-btrace.  */
@@ -1085,14 +1078,12 @@ record_btrace_call_history (struct target_ops *self, int size, int int_flags)
   struct btrace_thread_info *btinfo;
   struct btrace_call_history *history;
   struct btrace_call_iterator begin, end;
-  struct cleanup *uiout_cleanup;
   struct ui_out *uiout;
   unsigned int context, covered;
   record_print_flags flags = (enum record_print_flag) int_flags;
 
   uiout = current_uiout;
-  uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout,
-						       "insn history");
+  ui_out_emit_tuple tuple_emitter (uiout, "insn history");
   context = abs (size);
   if (context == 0)
     error (_("Bad record function-call-history-size."));
@@ -1164,7 +1155,6 @@ record_btrace_call_history (struct target_ops *self, int size, int int_flags)
     }
 
   btrace_set_call_history (btinfo, &begin, &end);
-  do_cleanups (uiout_cleanup);
 }
 
 /* The to_call_history_range method of target record-btrace.  */
@@ -1177,15 +1167,13 @@ record_btrace_call_history_range (struct target_ops *self,
   struct btrace_thread_info *btinfo;
   struct btrace_call_history *history;
   struct btrace_call_iterator begin, end;
-  struct cleanup *uiout_cleanup;
   struct ui_out *uiout;
   unsigned int low, high;
   int found;
   record_print_flags flags = (enum record_print_flag) int_flags;
 
   uiout = current_uiout;
-  uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout,
-						       "func history");
+  ui_out_emit_tuple tuple_emitter (uiout, "func history");
   low = from;
   high = to;
 
@@ -1218,8 +1206,6 @@ record_btrace_call_history_range (struct target_ops *self,
 
   btrace_call_history (uiout, btinfo, &begin, &end, flags);
   btrace_set_call_history (btinfo, &begin, &end);
-
-  do_cleanups (uiout_cleanup);
 }
 
 /* The to_call_history_from method of target record-btrace.  */
diff --git a/gdb/remote.c b/gdb/remote.c
index 694897d..2cd9850 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -13799,11 +13799,10 @@ show_remote_cmd (char *args, int from_tty)
 {
   /* We can't just use cmd_show_list here, because we want to skip
      the redundant "show remote Z-packet" and the legacy aliases.  */
-  struct cleanup *showlist_chain;
   struct cmd_list_element *list = remote_show_cmdlist;
   struct ui_out *uiout = current_uiout;
 
-  showlist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "showlist");
+  ui_out_emit_tuple tuple_emitter (uiout, "showlist");
   for (; list != NULL; list = list->next)
     if (strcmp (list->name, "Z-packet") == 0)
       continue;
@@ -13813,8 +13812,7 @@ show_remote_cmd (char *args, int from_tty)
       continue;
     else
       {
-	struct cleanup *option_chain
-	  = make_cleanup_ui_out_tuple_begin_end (uiout, "option");
+	ui_out_emit_tuple option_emitter (uiout, "option");
 
 	uiout->field_string ("name", list->name);
 	uiout->text (":  ");
@@ -13822,12 +13820,7 @@ show_remote_cmd (char *args, int from_tty)
 	  do_show_command (NULL, from_tty, list);
 	else
 	  cmd_func (list, NULL, from_tty);
-	/* Close the tuple.  */
-	do_cleanups (option_chain);
       }
-
-  /* Close the tuple.  */
-  do_cleanups (showlist_chain);
 }
 
 
diff --git a/gdb/skip.c b/gdb/skip.c
index 26ff000..4bd8a9e 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -395,14 +395,12 @@ skip_info (char *arg, int from_tty)
 
   ALL_SKIPLIST_ENTRIES (e)
     {
-      struct cleanup *entry_chain;
 
       QUIT;
       if (arg != NULL && !number_is_in_list (arg, e->number))
 	continue;
 
-      entry_chain = make_cleanup_ui_out_tuple_begin_end (current_uiout,
-							 "blklst-entry");
+      ui_out_emit_tuple tuple_emitter (current_uiout, "blklst-entry");
       current_uiout->field_int ("number", e->number); /* 1 */
 
       if (e->enabled)
@@ -426,7 +424,6 @@ skip_info (char *arg, int from_tty)
 	"function", e->function ? e->function : "<none>"); /* 6 */
 
       current_uiout->text ("\n");
-      do_cleanups (entry_chain);
     }
 
   do_cleanups (tbl_chain);
diff --git a/gdb/solib.c b/gdb/solib.c
index af94383..491c18a 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1090,14 +1090,12 @@ info_sharedlibrary_command (char *pattern, int from_tty)
 
   ALL_SO_LIBS (so)
     {
-      struct cleanup *lib_cleanup;
-
       if (! so->so_name[0])
 	continue;
       if (pattern && ! re_exec (so->so_name))
 	continue;
 
-      lib_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "lib");
+      ui_out_emit_tuple tuple_emitter (uiout, "lib");
 
       if (so->addr_high != 0)
 	{
@@ -1123,8 +1121,6 @@ info_sharedlibrary_command (char *pattern, int from_tty)
       uiout->field_string ("name", so->so_name);
 
       uiout->text ("\n");
-
-      do_cleanups (lib_cleanup);
     }
 
   do_cleanups (table_cleanup);
diff --git a/gdb/stack.c b/gdb/stack.c
index 1bad88e..32acca1 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -805,8 +805,7 @@ print_frame_info (struct frame_info *frame, int print_level,
       || get_frame_type (frame) == SIGTRAMP_FRAME
       || get_frame_type (frame) == ARCH_FRAME)
     {
-      struct cleanup *uiout_cleanup
-	= make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
+      ui_out_emit_tuple tuple_emitter (uiout, "frame");
 
       annotate_frame_begin (print_level ? frame_relative_level (frame) : 0,
 			    gdbarch, get_frame_pc (frame));
@@ -851,7 +850,6 @@ print_frame_info (struct frame_info *frame, int print_level,
 	do_gdb_disassembly (get_frame_arch (frame), 1,
 			    get_frame_pc (frame), get_frame_pc (frame) + 1);
 
-      do_cleanups (uiout_cleanup);
       return;
     }
 
diff --git a/gdb/thread.c b/gdb/thread.c
index 88fd521..c0776a2 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -719,26 +719,25 @@ do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
 {
   struct thread_info *tp;
   int num = 0;
-  struct cleanup *cleanup_chain;
   int current_thread = -1;
 
   update_thread_list ();
 
-  cleanup_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "thread-ids");
-
-  for (tp = thread_list; tp; tp = tp->next)
-    {
-      if (tp->state == THREAD_EXITED)
-	continue;
+  {
+    ui_out_emit_tuple tuple_emitter (uiout, "thread-ids");
 
-      if (tp->ptid == inferior_ptid)
-	current_thread = tp->global_num;
+    for (tp = thread_list; tp; tp = tp->next)
+      {
+	if (tp->state == THREAD_EXITED)
+	  continue;
 
-      num++;
-      uiout->field_int ("thread-id", tp->global_num);
-    }
+	if (tp->ptid == inferior_ptid)
+	  current_thread = tp->global_num;
 
-  do_cleanups (cleanup_chain);
+	num++;
+	uiout->field_int ("thread-id", tp->global_num);
+      }
+  }
 
   if (current_thread != -1)
     uiout->field_int ("current-thread-id", current_thread);
@@ -1300,14 +1299,13 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
 
   ALL_THREADS_BY_INFERIOR (inf, tp)
     {
-      struct cleanup *chain2;
       int core;
 
       if (!should_print_thread (requested_threads, default_inf_num,
 				global_ids, pid, tp))
 	continue;
 
-      chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
       if (uiout->is_mi_like_p ())
 	{
@@ -1395,8 +1393,6 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
       core = target_core_of_thread (tp->ptid);
       if (uiout->is_mi_like_p () && core != -1)
 	uiout->field_int ("core", core);
-
-      do_cleanups (chain2);
     }
 
   /* Restores the current thread and the frame selected before
-- 
2.9.3


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [RFA 4/5] Use ui_out_emit_tuple in more places in MI
  2017-04-14  2:23 [RFA 0/5] some cleanup removal for ui_out Tom Tromey
                   ` (3 preceding siblings ...)
  2017-04-14  2:24 ` [RFA 1/5] Use ui_out_emit_tuple Tom Tromey
@ 2017-04-14  2:42 ` Tom Tromey
  2017-04-18 18:44   ` Pedro Alves
  2017-04-22 15:44 ` [RFA 0/5] some cleanup removal for ui_out Tom Tromey
  5 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2017-04-14  2:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This patch changes a few more spots in MI to use ui_out_emit_tuple.
These changes required the use of gdb::optional.

gdb/ChangeLog
2017-04-13  Tom Tromey  <tom@tromey.com>

	* mi/mi-main.c (print_variable_or_computed): Use ui_out_emit_tuple.
	* mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_tuple.
	* mi/mi-cmd-stack.c (list_arg_or_local): Use ui_out_emit_tuple.
---
 gdb/ChangeLog         | 6 ++++++
 gdb/mi/mi-cmd-stack.c | 9 +++------
 gdb/mi/mi-cmd-var.c   | 7 +++----
 gdb/mi/mi-main.c      | 7 ++-----
 4 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ba91cdc..e972b4c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2017-04-13  Tom Tromey  <tom@tromey.com>
 
+	* mi/mi-main.c (print_variable_or_computed): Use ui_out_emit_tuple.
+	* mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_tuple.
+	* mi/mi-cmd-stack.c (list_arg_or_local): Use ui_out_emit_tuple.
+
+2017-04-13  Tom Tromey  <tom@tromey.com>
+
 	* tracepoint.c (tvariables_info_1)
 	(print_one_static_tracepoint_marker): Use ui_out_emit_tuple.
 
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index f288817..bd24e5b 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -34,6 +34,7 @@
 #include "extension.h"
 #include <ctype.h>
 #include "mi-parse.h"
+#include "common/gdb_optional.h"
 
 enum what_to_list { locals, arguments, all };
 
@@ -483,7 +484,6 @@ static void
 list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
 		   enum print_values values, int skip_unavailable)
 {
-  struct cleanup *old_chain;
   struct ui_out *uiout = current_uiout;
 
   gdb_assert (!arg->val || !arg->error);
@@ -507,10 +507,9 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
 					 TYPE_LENGTH (value_type (arg->val))))))
     return;
 
-  old_chain = make_cleanup (null_cleanup, NULL);
-
+  gdb::optional<ui_out_emit_tuple> tuple_emitter;
   if (values != PRINT_NO_VALUES || what == all)
-    make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+    tuple_emitter.emplace (uiout, nullptr);
 
   string_file stb;
 
@@ -556,8 +555,6 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
 	stb.printf (_("<error reading variable: %s>"), error_message);
       uiout->field_stream ("value", stb);
     }
-
-  do_cleanups (old_chain);
 }
 
 /* Print a list of the objects for the frame FI in a certain form,
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 0a4ed62..1a7e322 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -30,6 +30,7 @@
 #include "mi-getopt.h"
 #include "gdbthread.h"
 #include "mi-parse.h"
+#include "common/gdb_optional.h"
 
 extern unsigned int varobjdebug;		/* defined in varobj.c.  */
 
@@ -712,10 +713,10 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
   for (i = 0; VEC_iterate (varobj_update_result, changes, i, r); ++i)
     {
       int from, to;
-      struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
 
+      gdb::optional<ui_out_emit_tuple> tuple_emitter;
       if (mi_version (uiout) > 1)
-	make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+	tuple_emitter.emplace (uiout, nullptr);
       uiout->field_string ("name", varobj_get_objname (r->varobj));
 
       switch (r->status)
@@ -784,8 +785,6 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
 	  VEC_free (varobj_p, r->newobj);
 	  r->newobj = NULL;	/* Paranoia.  */
 	}
-
-      do_cleanups (cleanup);
     }
   VEC_free (varobj_update_result, changes);
 }
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index d309ba3..7e225db 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -2656,7 +2656,6 @@ mi_cmd_ada_task_info (const char *command, char **argv, int argc)
 static void
 print_variable_or_computed (const char *expression, enum print_values values)
 {
-  struct cleanup *old_chain;
   struct value *val;
   struct type *type;
   struct ui_out *uiout = current_uiout;
@@ -2670,9 +2669,9 @@ print_variable_or_computed (const char *expression, enum print_values values)
   else
     val = evaluate_expression (expr.get ());
 
-  old_chain = make_cleanup (null_cleanup, NULL);
+  gdb::optional<ui_out_emit_tuple> tuple_emitter;
   if (values != PRINT_NO_VALUES)
-    make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+    tuple_emitter.emplace (uiout, nullptr);
   uiout->field_string ("name", expression);
 
   switch (values)
@@ -2704,8 +2703,6 @@ print_variable_or_computed (const char *expression, enum print_values values)
       }
       break;
     }
-
-  do_cleanups (old_chain);
 }
 
 /* Implement the "-trace-frame-collected" command.  */
-- 
2.9.3


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 2/5] More uses of ui_out_emit_tuple
  2017-04-14  2:23 ` [RFA 2/5] More uses of ui_out_emit_tuple Tom Tromey
@ 2017-04-18 18:42   ` Pedro Alves
  2017-04-19  2:42     ` Tom Tromey
  0 siblings, 1 reply; 16+ messages in thread
From: Pedro Alves @ 2017-04-18 18:42 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 04/14/2017 03:23 AM, Tom Tromey wrote:

> -  do_cleanups (old_chain);
> +    uiout->field_stream ("value", stb);
> +  }
>  
>    annotate_arg_end ();

Looks like the reason that this needed a new scope was
this annotate_arg_end call.

How about instead adding something like this:

struct annotate_arg_emitter
{
  annotate_arg_emitter () { annotate_arg_begin (); }
  ~annotate_arg_emitter () { annotate_arg_end (); }
};

and using it in the function alongside the tuple emitter, like:

    annotate_arg_emitter annotate_arg;
    ui_out_emit_tuple tuple_emitter (uiout, NULL);

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 1/5] Use ui_out_emit_tuple
  2017-04-14  2:24 ` [RFA 1/5] Use ui_out_emit_tuple Tom Tromey
@ 2017-04-18 18:42   ` Pedro Alves
  0 siblings, 0 replies; 16+ messages in thread
From: Pedro Alves @ 2017-04-18 18:42 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 04/14/2017 03:23 AM, Tom Tromey wrote:
> This patch changes various places to use ui_out_emit_tuple,
> eliminating a number of cleanups.  This patch only tackles "easy"
> cases, which are ones where the cleanups in question were
> block-structured and did not involve any changes other than the
> obvious replacement.
> 
> 2017-04-13  Tom Tromey  <tom@tromey.com>
> 
> 	* record-btrace.c (record_btrace_insn_history)
> 	(record_btrace_insn_history_range, record_btrace_call_history)
> 	(record_btrace_call_history_range): Use ui_out_emit_tuple.
> 	* thread.c (do_captured_list_thread_ids, print_thread_info_1): Use
> 	ui_out_emit_tuple.
> 	* stack.c (print_frame_info): Use ui_out_emit_tuple.
> 	* solib.c (info_sharedlibrary_command): Use ui_out_emit_tuple.
> 	* skip.c (skip_info): Use ui_out_emit_tuple.
> 	* remote.c (show_remote_cmd): Use ui_out_emit_tuple.
> 	* progspace.c (print_program_space): Use ui_out_emit_tuple.
> 	* probe.c (info_probes_for_ops): Use ui_out_emit_tuple.
> 	* osdata.c (info_osdata): Use ui_out_emit_tuple.
> 	* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
> 	ui_out_emit_tuple.
> 	* mi/mi-main.c (print_one_inferior, list_available_thread_groups)
> 	(output_register, mi_cmd_data_read_memory)
> 	(mi_cmd_data_read_memory_bytes, mi_load_progress)
> 	(mi_cmd_trace_frame_collected): Use ui_out_emit_tuple.
> 	* mi/mi-cmd-var.c (mi_cmd_var_list_children, varobj_update_one):
> 	Use ui_out_emit_tuple.
> 	* mi/mi-cmd-stack.c (mi_cmd_stack_list_args): Use
> 	ui_out_emit_tuple.
> 	* mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
> 	(mi_cmd_info_gdb_mi_command): Use ui_out_emit_tuple.
> 	* linux-thread-db.c (info_auto_load_libthread_db): Use
> 	ui_out_emit_tuple.
> 	* inferior.c (print_inferior): Use ui_out_emit_tuple.
> 	* gdb_bfd.c (print_one_bfd): Use ui_out_emit_tuple.
> 	* disasm.c (do_mixed_source_and_assembly_deprecated)
> 	(do_mixed_source_and_assembly): Use ui_out_emit_tuple.
> 	* cp-abi.c (list_cp_abis): Use ui_out_emit_tuple.
> 	* cli/cli-setshow.c (cmd_show_list): Use ui_out_emit_tuple.
> 	* breakpoint.c (print_one_breakpoint_location)
> 	(print_one_breakpoint): Use ui_out_emit_tuple.
> 	* auto-load.c (print_script, info_auto_load_cmd): Use
> 	ui_out_emit_tuple.
> 	* ada-tasks.c (print_ada_task_info): Use ui_out_emit_tuple.

LGTM.

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 3/5] Use ui_out_emit_tuple in tracepoint.c
  2017-04-14  2:23 ` [RFA 3/5] Use ui_out_emit_tuple in tracepoint.c Tom Tromey
@ 2017-04-18 18:43   ` Pedro Alves
  0 siblings, 0 replies; 16+ messages in thread
From: Pedro Alves @ 2017-04-18 18:43 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 04/14/2017 03:23 AM, Tom Tromey wrote:
> This changes some code in tracepoint.c to use ui_out_emit_tuple.  One
> of these involved removing an otherwise unrelated cleanup (changing
> type to std::string) and the other involved introducing a new block.
> 
> gdb/ChangeLog
> 2017-04-13  Tom Tromey  <tom@tromey.com>
> 
> 	* tracepoint.c (tvariables_info_1)
> 	(print_one_static_tracepoint_marker): Use ui_out_emit_tuple.

LGTM.

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 5/5] Use ui_out_emit_list
  2017-04-14  2:23 ` [RFA 5/5] Use ui_out_emit_list Tom Tromey
@ 2017-04-18 18:44   ` Pedro Alves
  0 siblings, 0 replies; 16+ messages in thread
From: Pedro Alves @ 2017-04-18 18:44 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 04/14/2017 03:23 AM, Tom Tromey wrote:
> This changes some spots to use ui_out_emit_list.  This only touches
> "easy" cases, where the cleanup was used in a block-structured way.
> There's also one more use of ui_out_emit_tuple in here.
> 
> ChangeLog
> 2017-04-13  Tom Tromey  <tom@tromey.com>
> 
> 	* mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use
> 	ui_out_emit_list.
> 	* stack.c (print_frame): Use ui_out_emit_list.
> 	* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
> 	ui_out_emit_list.
> 	* mi/mi-main.c (print_one_inferior)
> 	(mi_cmd_data_list_register_names)
> 	(mi_cmd_data_list_register_values, mi_cmd_list_features)
> 	(mi_cmd_list_target_features, mi_cmd_trace_frame_collected): Use
> 	ui_out_emit_list.
> 	* mi/mi-interp.c (mi_on_normal_stop_1): Use ui_out_emit_list.
> 	(mi_output_solib_attribs): Use ui_out_emit_list,
> 	ui_out_emit_tuple.
> 	* mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_list.
> 	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
> 	(mi_cmd_stack_list_args, list_args_or_locals): Use
> 	ui_out_emit_list.
> 	* disasm.c (do_assembly_only): Use ui_out_emit_list.
> 	* breakpoint.c (print_solib_event, output_thread_groups): Use
> 	ui_out_emit_list.

LGTM.

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 4/5] Use ui_out_emit_tuple in more places in MI
  2017-04-14  2:42 ` [RFA 4/5] Use ui_out_emit_tuple in more places in MI Tom Tromey
@ 2017-04-18 18:44   ` Pedro Alves
  0 siblings, 0 replies; 16+ messages in thread
From: Pedro Alves @ 2017-04-18 18:44 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 04/14/2017 03:23 AM, Tom Tromey wrote:
> This patch changes a few more spots in MI to use ui_out_emit_tuple.
> These changes required the use of gdb::optional.
> 
> gdb/ChangeLog
> 2017-04-13  Tom Tromey  <tom@tromey.com>
> 
> 	* mi/mi-main.c (print_variable_or_computed): Use ui_out_emit_tuple.
> 	* mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_tuple.
> 	* mi/mi-cmd-stack.c (list_arg_or_local): Use ui_out_emit_tuple.

LGTM.

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 2/5] More uses of ui_out_emit_tuple
  2017-04-18 18:42   ` Pedro Alves
@ 2017-04-19  2:42     ` Tom Tromey
  2017-04-19  9:39       ` Pedro Alves
  0 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2017-04-19  2:42 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Tom Tromey, gdb-patches

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> Looks like the reason that this needed a new scope was
Pedro> this annotate_arg_end call.

Pedro> How about instead adding something like this:
[...]

That does make the patch clearer.  Here's the updated version; I'm not
resending the whole series as nothing else has changed.

I'm running this through the buildbot; OK if it passes?

Tom

commit 7ee4a9c7624658a17fd566b2a236260a5b2e258e
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Apr 12 16:10:02 2017 -0600

    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-18  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.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f5fed2f..52560f7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2017-04-18  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.
+
 2017-04-13  Tom Tromey  <tom@tromey.com>
 
 	* record-btrace.c (record_btrace_insn_history)
diff --git a/gdb/annotate.h b/gdb/annotate.h
index a1454a1..7161689 100644
--- a/gdb/annotate.h
+++ b/gdb/annotate.h
@@ -74,6 +74,17 @@ extern void annotate_arg_name_end (void);
 extern void annotate_arg_value (struct type *);
 extern void annotate_arg_end (void);
 
+/* Wrap calls to annotate_arg_begin and annotate_arg_end in an RAII
+   class. */
+struct annotate_arg_emitter
+{
+  annotate_arg_emitter () { annotate_arg_begin (); }
+  ~annotate_arg_emitter () { annotate_arg_end (); }
+
+  annotate_arg_emitter (const annotate_arg_emitter &) = delete;
+  annotate_arg_emitter &operator= (const annotate_arg_emitter &) = delete;
+};
+
 extern void annotate_source (char *, int, int, int,
 			     struct gdbarch *, CORE_ADDR);
 
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
diff --git a/gdb/stack.c b/gdb/stack.c
index 32acca1..fa47264 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -224,7 +224,6 @@ static void
 print_frame_arg (const struct frame_arg *arg)
 {
   struct ui_out *uiout = current_uiout;
-  struct cleanup *old_chain;
   const char *error_message = NULL;
 
   string_file stb;
@@ -235,9 +234,8 @@ print_frame_arg (const struct frame_arg *arg)
 	      || (!uiout->is_mi_like_p ()
 		  && arg->entry_kind == print_entry_values_compact));
 
-  annotate_arg_begin ();
-
-  old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+  annotate_arg_emitter arg_emitter;
+  ui_out_emit_tuple tuple_emitter (uiout, NULL);
   fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym),
 			   SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI);
   if (arg->entry_kind == print_entry_values_compact)
@@ -305,11 +303,6 @@ print_frame_arg (const struct frame_arg *arg)
     }
 
   uiout->field_stream ("value", stb);
-
-  /* Also invoke ui_out_tuple_end.  */
-  do_cleanups (old_chain);
-
-  annotate_arg_end ();
 }
 
 /* Read in inferior function local SYM at FRAME into ARGP.  Caller is


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 2/5] More uses of ui_out_emit_tuple
  2017-04-19  2:42     ` Tom Tromey
@ 2017-04-19  9:39       ` Pedro Alves
  0 siblings, 0 replies; 16+ messages in thread
From: Pedro Alves @ 2017-04-19  9:39 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 04/19/2017 03:41 AM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
> 
> Pedro> Looks like the reason that this needed a new scope was
> Pedro> this annotate_arg_end call.
> 
> Pedro> How about instead adding something like this:
> [...]
> 
> That does make the patch clearer.  Here's the updated version; I'm not
> resending the whole series as nothing else has changed.
> 
> I'm running this through the buildbot; OK if it passes?

OK.

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 0/5] some cleanup removal for ui_out
  2017-04-14  2:23 [RFA 0/5] some cleanup removal for ui_out Tom Tromey
                   ` (4 preceding siblings ...)
  2017-04-14  2:42 ` [RFA 4/5] Use ui_out_emit_tuple in more places in MI Tom Tromey
@ 2017-04-22 15:44 ` Tom Tromey
  2017-04-27 14:51   ` Simon Marchi
  5 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2017-04-22 15:44 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> This series converts various (easy) spots to use ui_out_emit_list or
Tom> ui_out_emit_tuple.  This removes a number of cleanups.

I am finally going to check this in.
I hadn't done so earlier because my buildbot runs were occasionally
showing some failures.  However, a recent run with a completely
different patch shows the same failures, so I'm going forward on the
theory that these patches of mine aren't causing the problem.

The failures I'm seeing are from gdb.mi/user-selected-context-sync.exp,
though exactly which failures are seen varies by run.

PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop: test_cli_frame: thread 1.2: reset selection to thread 1.2
PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop: test_cli_select_frame: thread 1.2: reset selection to thread 1.2
PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop: test_cli_up_down: reset selection to thread 1.2
PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop: test_mi_stack_select_frame: thread 1.2: reset selection to thread 1.2
PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop: exec_mode=direct: test_cli_in_mi_frame: thread 1.2: reset selection to thread 1.2
PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop: exec_mode=interpreter-exec: test_cli_in_mi_frame: thread 1.2: reset selection to thread 1.2

Tom


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 0/5] some cleanup removal for ui_out
  2017-04-22 15:44 ` [RFA 0/5] some cleanup removal for ui_out Tom Tromey
@ 2017-04-27 14:51   ` Simon Marchi
  2017-04-27 21:23     ` Tom Tromey
  0 siblings, 1 reply; 16+ messages in thread
From: Simon Marchi @ 2017-04-27 14:51 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 2017-04-22 11:44, Tom Tromey wrote:
>>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
> 
> Tom> This series converts various (easy) spots to use ui_out_emit_list 
> or
> Tom> ui_out_emit_tuple.  This removes a number of cleanups.
> 
> I am finally going to check this in.
> I hadn't done so earlier because my buildbot runs were occasionally
> showing some failures.  However, a recent run with a completely
> different patch shows the same failures, so I'm going forward on the
> theory that these patches of mine aren't causing the problem.
> 
> The failures I'm seeing are from gdb.mi/user-selected-context-sync.exp,
> though exactly which failures are seen varies by run.
> 
> PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop:
> test_cli_frame: thread 1.2: reset selection to thread 1.2
> PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop:
> test_cli_select_frame: thread 1.2: reset selection to thread 1.2
> PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop:
> test_cli_up_down: reset selection to thread 1.2
> PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop:
> test_mi_stack_select_frame: thread 1.2: reset selection to thread 1.2
> PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop:
> exec_mode=direct: test_cli_in_mi_frame: thread 1.2: reset selection to
> thread 1.2
> PASS -> FAIL: gdb.mi/user-selected-context-sync.exp: mode=non-stop:
> exec_mode=interpreter-exec: test_cli_in_mi_frame: thread 1.2: reset
> selection to thread 1.2
> 
> Tom

What commit and platform are you able to reproduce it?  I can't 
reproduce, but I'd be interested in looking into it if I manage to do 
it.

Simon


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [RFA 0/5] some cleanup removal for ui_out
  2017-04-27 14:51   ` Simon Marchi
@ 2017-04-27 21:23     ` Tom Tromey
  0 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2017-04-27 21:23 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> What commit and platform are you able to reproduce it?  I can't
Simon> reproduce, but I'd be interested in looking into it if I manage to do
Simon> it.

I don't remember now, and I haven't seen it in any more recent buildbot runs.
If I do see it again, I'll forward the buildbot message to you.

Tom


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-04-27 21:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14  2:23 [RFA 0/5] some cleanup removal for ui_out Tom Tromey
2017-04-14  2:23 ` [RFA 2/5] More uses of ui_out_emit_tuple Tom Tromey
2017-04-18 18:42   ` Pedro Alves
2017-04-19  2:42     ` Tom Tromey
2017-04-19  9:39       ` Pedro Alves
2017-04-14  2:23 ` [RFA 3/5] Use ui_out_emit_tuple in tracepoint.c Tom Tromey
2017-04-18 18:43   ` Pedro Alves
2017-04-14  2:23 ` [RFA 5/5] Use ui_out_emit_list Tom Tromey
2017-04-18 18:44   ` Pedro Alves
2017-04-14  2:24 ` [RFA 1/5] Use ui_out_emit_tuple Tom Tromey
2017-04-18 18:42   ` Pedro Alves
2017-04-14  2:42 ` [RFA 4/5] Use ui_out_emit_tuple in more places in MI Tom Tromey
2017-04-18 18:44   ` Pedro Alves
2017-04-22 15:44 ` [RFA 0/5] some cleanup removal for ui_out Tom Tromey
2017-04-27 14:51   ` Simon Marchi
2017-04-27 21:23     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox