Prevent problems with section alignment by not shrinking the .rsrc section.
[deliverable/binutils-gdb.git] / gdb / ui-out.c
index ec44ab6916a1690c0ce5321552383936d35737e9..60d18eee2bb0829213c84d836459edff41dc0ff3 100644 (file)
@@ -117,8 +117,7 @@ current_level (struct ui_out *uiout)
 /* Create a new level, of TYPE.  Return the new level's index.  */
 static int
 push_level (struct ui_out *uiout,
-           enum ui_out_type type,
-           const char *id)
+           enum ui_out_type type)
 {
   struct ui_out_level *current;
 
@@ -315,7 +314,7 @@ specified after table_body."));
     verify_field (uiout, &fldno, &width, &align);
   }
 
-  new_level = push_level (uiout, type, id);
+  new_level = push_level (uiout, type);
 
   /* If the push puts us at the same level as a table row entry, we've
      got a new table row.  Put the header pointer back to the start.  */
@@ -426,16 +425,13 @@ ui_out_field_stream (struct ui_out *uiout,
                     const char *fldname,
                     struct ui_file *stream)
 {
-  long length;
-  char *buffer = ui_file_xstrdup (stream, &length);
-  struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
+  std::string buffer = ui_file_as_string (stream);
 
-  if (length > 0)
-    ui_out_field_string (uiout, fldname, buffer);
+  if (!buffer.empty ())
+    ui_out_field_string (uiout, fldname, buffer.c_str ());
   else
     ui_out_field_skip (uiout, fldname);
   ui_file_rewind (stream);
-  do_cleanups (old_cleanup);
 }
 
 /* Used to omit a field.  */
@@ -902,7 +898,7 @@ ui_out_query_field (struct ui_out *uiout, int colno,
   return 0;
 }
 
-/* Initalize private members at startup.  */
+/* Initialize private members at startup.  */
 
 struct ui_out *
 ui_out_new (const struct ui_out_impl *impl, void *data,
@@ -953,24 +949,6 @@ ui_out_destroy (struct ui_out *uiout)
   xfree (uiout);
 }
 
-/* Cleanup that restores a previous current uiout.  */
-
-static void
-restore_current_uiout_cleanup (void *arg)
-{
-  struct ui_out *saved_uiout = (struct ui_out *) arg;
-
-  current_uiout = saved_uiout;
-}
-
-/* See ui-out.h.  */
-
-struct cleanup *
-make_cleanup_restore_current_uiout (void)
-{
-  return make_cleanup (restore_current_uiout_cleanup, current_uiout);
-}
-
 /* Standard gdb initialization hook.  */
 
 void
This page took 0.024029 seconds and 4 git commands to generate.