This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Add missing-END_CATCH detection/protection (to gdb's TRY/CATCH/END_CATCH)
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Wed, 04 Oct 2017 06:25:06 -0400
- Subject: [binutils-gdb] Add missing-END_CATCH detection/protection (to gdb's TRY/CATCH/END_CATCH)
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT a87c142792e4dcbec2bb3825e71f3ace044c2096 ***
Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: a87c142792e4dcbec2bb3825e71f3ace044c2096
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.
- Follow-Ups:
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-s390x-m64, branch master
- Failures on Ubuntu-AArch64-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-m64, branch master
- Failures on Ubuntu-AArch64-m64, branch master
- Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, branch master
- Failures on Fedora-i686, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Ubuntu-AArch32-m32, branch master