binutils-gdb/gdb/common
Tom Tromey b7b633e9b1 Use RAII to save and restore scalars
This patch replaces many (but not all) uses of
make_cleanup_restore_integer with a simple RAII-based template class.
It also removes the similar restore_execution_direction cleanup in
favor of this new class.  Subsequent patches will replace other
similar cleanups with this class.

The class is typically instantiated using make_scoped_restore.  This
allows for template argument deduction.

2016-10-21  Tom Tromey  <tom@tromey.com>

	* common/scoped_restore.h: New file.
	* utils.h: Include scoped_restore.h.
	* top.c (execute_command_to_string): Use scoped_restore.
	* python/python.c (python_interactive_command): Use
	scoped_restore.
	(python_command, execute_gdb_command): Likewise.
	* printcmd.c (do_one_display): Use scoped_restore.
	* mi/mi-main.c (exec_continue): Use scoped_restore.
	* mi/mi-cmd-var.c (mi_cmd_var_assign): Use scoped_restore.
	* linux-fork.c (checkpoint_command): Use scoped_restore.
	* infrun.c (restore_execution_direction): Remove.
	(fetch_inferior_event): Use scoped_restore.
	* compile/compile.c (compile_file_command): Use
	scoped_restore.
	(compile_code_command, compile_print_command): Likewise.
	* cli/cli-script.c (execute_user_command): Use
	scoped_restore.
	(while_command, if_command, script_from_file): Likewise.
	* arm-tdep.c (arm_insert_single_step_breakpoint): Use
	scoped_restore.
2016-10-21 14:17:31 -06:00
..
agent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
agent.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ax.def GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
break-common.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
btrace-common.c Add method/format information to =record-started 2016-06-06 17:10:18 -04:00
btrace-common.h Add method/format information to =record-started 2016-06-06 17:10:18 -04:00
buffer.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
buffer.h Use struct buffer in gdb_readline_no_editing 2016-03-09 18:25:00 +00:00
cleanups.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
cleanups.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
common-debug.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
common-debug.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
common-defs.h gdb: no longer define __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS 2016-10-18 20:48:37 +01:00
common-exceptions.c Propagate GDB/C++ exceptions across readline using sj/lj-based TRY/CATCH 2016-04-22 16:20:04 +01:00
common-exceptions.h gdb: Remove some C compiler support leftovers 2016-10-06 19:23:37 +01:00
common-regcache.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
common-regcache.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
common-types.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
common-utils.c Add xmalloc_failed() function to common-utils.c in to avoid the need to link in libiberty's xmalloc code. 2016-06-01 11:44:08 +01:00
common-utils.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
common.host GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
common.m4 Fix PR gdb/18653: gdb disturbs inferior's inherited signal dispositions 2016-08-09 20:16:20 +01:00
create-version.sh GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
enum-flags.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
errors.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
errors.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
fileio.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
fileio.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
filestuff.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
filestuff.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
format.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
format.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb_assert.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb_locale.h gdb: Fix build breakage with GCC 4.1 and --disable-nls 2016-09-19 16:55:35 +01:00
gdb_setjmp.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb_signals.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb_sys_time.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb_unique_ptr.h Introduce gdb::unique_ptr 2016-10-18 11:42:35 +01:00
gdb_vecs.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb_vecs.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb_wait.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
host-defs.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mingw-strerror.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
new-op.c gdb: Replace operator new / operator new[] 2016-09-23 16:42:24 +01:00
posix-strerror.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
print-utils.c Centralize thread ID printing 2016-01-13 10:59:14 +00:00
print-utils.h Centralize thread ID printing 2016-01-13 10:59:14 +00:00
ptid.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ptid.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
queue.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
rsp-low.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
rsp-low.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
scoped_restore.h Use RAII to save and restore scalars 2016-10-21 14:17:31 -06:00
signals-state-save-restore.c Quiet ARI gettext checks 2016-08-10 16:06:57 +01:00
signals-state-save-restore.h Fix PR gdb/18653: gdb disturbs inferior's inherited signal dispositions 2016-08-09 20:16:20 +01:00
signals.c Pass SIGLIBRT directly to child processes. 2016-07-15 06:35:37 -07:00
symbol.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
vec.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
vec.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
version.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-xstate.h Add target descriptions for AVX + MPX 2016-04-19 15:44:32 +02:00
xml-utils.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
xml-utils.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00