binutils-gdb/gdb/cli
Pedro Alves a87c142792 Add missing-END_CATCH detection/protection (to gdb's TRY/CATCH/END_CATCH)
While we still have cleanups (i.e., make_cleanup & co), we must be
sure to add END_CATCH at the end of a TRY/CATCH/END_CATCH construct.
However, it's currently too easy to miss adding the END_CATCH, because
the code compiles anyway without it.  I realized this when I noticed
that another patch I was working on missed several adding END_CATCH in
several new TRY/CATCH uses.

This commit fixes that by making TRY open a new scope that is only
closed by END_CATCH.  This way, if you forget to add the END_CATCH,
then compilation fails due to the unbalanced curly braces.

This caught a couple places where we were missing END_CATCH in current
master, also fixed by the patch.

gdb/ChangeLog:
2017-10-04  Pedro Alves  <palves@redhat.com>

	* cli/cli-cmds.c (complete_command): Add missing END_CATCH.
	* common/common-exceptions.h (TRY): Open an outermost scope.
	Expand intro comment.
	(CATCH): Reindent.
	(END_CATCH): Close the outermost scope.
	* completer.c (complete_line_internal): Add missing END_CATCH.
2017-10-04 10:06:42 +01:00
..
cli-cmds.c Add missing-END_CATCH detection/protection (to gdb's TRY/CATCH/END_CATCH) 2017-10-04 10:06:42 +01:00
cli-cmds.h Constify cd_command 2017-09-27 08:44:51 -06:00
cli-decode.c Constify not_just_help_class_command 2017-09-27 08:44:15 -06:00
cli-decode.h Constify not_just_help_class_command 2017-09-27 08:44:15 -06:00
cli-dump.c Constify commands in cli-dump.c 2017-09-27 08:44:31 -06:00
cli-interp.c Remove unnecessary function prototypes. 2017-09-09 11:02:37 -07:00
cli-interp.h C++-fy struct interp/cli_interp/tui_interp/mi_interp 2017-02-03 16:30:04 +00:00
cli-logging.c Constify some commands in cli-logging.c 2017-09-27 08:44:32 -06:00
cli-script.c Constify user_defined_command 2017-09-27 08:44:31 -06:00
cli-script.h Move command lines types/declarations to cli-script.h 2017-09-04 19:09:12 +02:00
cli-setshow.c Rename _const functions to use overloading instead 2017-09-11 15:46:12 -06:00
cli-setshow.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
cli-utils.c Make extract_arg return a std::string 2017-09-11 15:46:14 -06:00
cli-utils.h Make extract_arg return a std::string 2017-09-11 15:46:14 -06:00