From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123399 invoked by alias); 4 Oct 2017 10:25:09 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 123385 invoked by uid 89); 4 Oct 2017 10:25:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (158.69.185.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Oct 2017 10:25:08 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] Add missing-END_CATCH detection/protection (to gdb's TRY/CATCH/END_CATCH) From: sergiodj+buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: Date: Wed, 04 Oct 2017 10:25:00 -0000 X-SW-Source: 2017-q4/txt/msg00336.txt.bz2 *** TEST RESULTS FOR COMMIT a87c142792e4dcbec2bb3825e71f3ace044c2096 *** Author: Pedro Alves 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 * 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.