From patchwork Thu Apr 21 23:50:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11848 Received: (qmail 68157 invoked by alias); 21 Apr 2016 23:50:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 67846 invoked by uid 89); 21 Apr 2016 23:50:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=foreign X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Apr 2016 23:50:45 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31526811A7 for ; Thu, 21 Apr 2016 23:50:44 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3LNoelw001710 for ; Thu, 21 Apr 2016 19:50:43 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 3/3] Switch gdb's TRY/CATCH to C++ try/catch Date: Fri, 22 Apr 2016 00:50:40 +0100 Message-Id: <1461282640-30425-4-git-send-email-palves@redhat.com> In-Reply-To: <1461282640-30425-1-git-send-email-palves@redhat.com> References: <1461282640-30425-1-git-send-email-palves@redhat.com> The exceptions-across-readline issue was fixed by the previous commit. Let's try this again. gdb/ChangeLog: 2016-04-21 Pedro Alves * common/common-exceptions.h (GDB_XCPT_TRY): Remove mention of the foreign frames issue. [__cplusplus] (GDB_XCPT): Define as GDB_XCPT_TRY. --- gdb/common/common-exceptions.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h index 4a9f675..ed1cf5e 100644 --- a/gdb/common/common-exceptions.h +++ b/gdb/common/common-exceptions.h @@ -122,9 +122,7 @@ struct gdb_exception the only mode supported when GDB is built as a C program. */ #define GDB_XCPT_SJMP 1 -/* Make GDB exceptions use try/catch behind the scenes. Can't be made - the default until we handle exceptions crossing foreign frames - (gdb -> readline callback -> gdb -> error). */ +/* Make GDB exceptions use try/catch behind the scenes. */ #define GDB_XCPT_TRY 2 /* Specify this mode to build with TRY/CATCH mapped directly to raw @@ -133,8 +131,11 @@ struct gdb_exception spurious code between the TRY and the CATCH block. */ #define GDB_XCPT_RAW_TRY 3 -/* Always use setjmp/longmp, even in C++ mode. */ -#define GDB_XCPT GDB_XCPT_SJMP +#ifdef __cplusplus +# define GDB_XCPT GDB_XCPT_TRY +#else +# define GDB_XCPT GDB_XCPT_SJMP +#endif /* Functions to drive the sjlj-based exceptions state machine. Though declared here by necessity, these functions should be considered