/* General utility routines for GDB, the GNU debugger.
- Copyright (C) 1986-2016 Free Software Foundation, Inc.
+ Copyright (C) 1986-2017 Free Software Foundation, Inc.
This file is part of GDB.
return make_cleanup (do_freeargv, arg);
}
-static void
-do_bfd_close_cleanup (void *arg)
-{
- gdb_bfd_unref ((bfd *) arg);
-}
-
-struct cleanup *
-make_cleanup_bfd_unref (bfd *abfd)
-{
- return make_cleanup (do_bfd_close_cleanup, abfd);
-}
-
/* Helper function which does the work for make_cleanup_fclose. */
static void
return make_cleanup (do_obstack_free, obstack);
}
-static void
-do_ui_file_delete (void *arg)
-{
- ui_file_delete ((struct ui_file *) arg);
-}
-
-struct cleanup *
-make_cleanup_ui_file_delete (struct ui_file *arg)
-{
- return make_cleanup (do_ui_file_delete, arg);
-}
-
/* Helper function for make_cleanup_ui_out_redirect_pop. */
static void
{
struct ui_out *uiout = (struct ui_out *) arg;
- if (ui_out_redirect (uiout, NULL) < 0)
- warning (_("Cannot restore redirection of the current output protocol"));
+ uiout->redirect (NULL);
}
/* Return a new cleanup that pops the last redirection by ui_out_redirect
return make_cleanup (do_unpush_target, ops);
}
-/* Helper for make_cleanup_htab_delete compile time checking the types. */
-
-static void
-do_htab_delete_cleanup (void *htab_voidp)
-{
- htab_t htab = (htab_t) htab_voidp;
-
- htab_delete (htab);
-}
-
-/* Return a new cleanup that deletes HTAB. */
-
-struct cleanup *
-make_cleanup_htab_delete (htab_t htab)
-{
- return make_cleanup (do_htab_delete_cleanup, htab);
-}
-
/* Helper for make_cleanup_value_free_to_mark. */
static void
}
void
-error_stream (struct ui_file *stream)
+error_stream (const string_file &stream)
{
- std::string message = ui_file_as_string (stream);
-
- error (("%s"), message.c_str ());
+ error (("%s"), stream.c_str ());
}
/* Emit a message and abort. */
|| batch_flag
|| (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX)
|| top_level_interpreter () == NULL
- || ui_out_is_mi_like_p (interp_ui_out (top_level_interpreter ())))
+ || interp_ui_out (top_level_interpreter ())->is_mi_like_p ())
{
fputs_unfiltered (linebuffer, stream);
return;