This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Add missing-END_CATCH detection/protection (to gdb's TRY/CATCH/END_CATCH)
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 4 Oct 2017 12:01:03 -0000
- Subject: [binutils-gdb] Add missing-END_CATCH detection/protection (to gdb's TRY/CATCH/END_CATCH)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=44704526e482d24baa104764495ca376561a85bf
commit 44704526e482d24baa104764495ca376561a85bf
Author: Pedro Alves <palves@redhat.com>
Date: Wed Oct 4 13:00:13 2017 +0100
Add missing-END_CATCH detection/protection (to gdb's TRY/CATCH/END_CATCH)
(Adding missing ChangeLog entry)
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.
Diff:
---
gdb/ChangeLog | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e113e2f..bc58f51 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+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 Sergio Durigan Junior <sergiodj@redhat.com>
* NEWS (Changes since GDB 8.0): Add entry about new