aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-09-29 22:07:37 -0600
committerTom Tromey <tom@tromey.com>2017-10-03 05:33:45 -0600
commitb95de2b7aeb30081345954cb15970a582b49a866 (patch)
treeb562ca7cca16ad171cf074074b89e11311970216 /gdb/utils.h
parent070365117b5727394e271399c5738a27bf9716d5 (diff)
downloadbinutils-b95de2b7aeb30081345954cb15970a582b49a866.zip
binutils-b95de2b7aeb30081345954cb15970a582b49a866.tar.gz
binutils-b95de2b7aeb30081345954cb15970a582b49a866.tar.bz2
Remove set_batch_flag_and_make_cleanup_restore_page_info
This removes set_batch_flag_and_make_cleanup_restore_page_info and make_cleanup_restore_page_info in favor of a new RAII class. This then allows for the removal of make_cleanup_restore_uinteger and make_cleanup_restore_integer ChangeLog 2017-10-03 Tom Tromey <tom@tromey.com> * guile/scm-ports.c (ioscm_with_output_to_port_worker): Update. * top.c (execute_command_to_string): Update. * utils.c (make_cleanup_restore_page_info): Remove. (do_restore_page_info_cleanup): Remove. (set_batch_flag_and_restore_page_info): New. (make_cleanup_restore_page_info): Remove. (set_batch_flag_and_make_cleanup_restore_page_info): Remove. (~set_batch_flag_and_restore_page_info): New (make_cleanup_restore_uinteger): Remove. (make_cleanup_restore_integer): Remove. (struct restore_integer_closure): Remove. (restore_integer): Remove. * utils.h (struct set_batch_flag_and_restore_page_info): New class. (set_batch_flag_and_make_cleanup_restore_page_info): Remove. (make_cleanup_restore_page_info): Remove. (make_cleanup_restore_uinteger) Remove. (make_cleanup_restore_integer) Remove.
Diffstat (limited to 'gdb/utils.h')
-rw-r--r--gdb/utils.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/gdb/utils.h b/gdb/utils.h
index 7b45cc8..022af51 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -211,9 +211,6 @@ extern struct cleanup *(make_cleanup_free_section_addr_info
/* For make_cleanup_close see common/filestuff.h. */
-extern struct cleanup *make_cleanup_restore_integer (int *variable);
-extern struct cleanup *make_cleanup_restore_uinteger (unsigned int *variable);
-
struct target_ops;
extern struct cleanup *make_cleanup_unpush_target (struct target_ops *ops);
@@ -236,9 +233,27 @@ extern void free_current_contents (void *);
extern void init_page_info (void);
-extern struct cleanup *make_cleanup_restore_page_info (void);
-extern struct cleanup *
- set_batch_flag_and_make_cleanup_restore_page_info (void);
+/* Temporarily set BATCH_FLAG and the associated unlimited terminal size.
+ Restore when destroyed. */
+
+struct set_batch_flag_and_restore_page_info
+{
+public:
+
+ set_batch_flag_and_restore_page_info ();
+ ~set_batch_flag_and_restore_page_info ();
+
+ DISABLE_COPY_AND_ASSIGN (set_batch_flag_and_restore_page_info);
+
+private:
+
+ /* Note that this doesn't use scoped_restore, because it's important
+ to control the ordering of operations in the destruction, and it
+ was simpler to avoid introducing a new ad hoc class. */
+ unsigned m_save_lines_per_page;
+ unsigned m_save_chars_per_line;
+ int m_save_batch_flag;
+};
extern struct cleanup *make_bpstat_clear_actions_cleanup (void);