This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] [C++] Always use setjmp/longjmp for exceptions
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 17 Nov 2015 15:29:24 +0000
- Subject: Re: [PATCH] [C++] Always use setjmp/longjmp for exceptions
- Authentication-results: sourceware.org; auth=none
- References: <1446569291-21711-1-git-send-email-palves at redhat dot com>
On 11/03/2015 04:48 PM, Pedro Alves wrote:
> We currently throw exceptions from signal handlers (e.g., for
> Quit/ctrl-c). But throwing C++ exceptions from signal handlers is
> undefined. (That doesn't restore signal masks, like siglongjmp does,
> and, because asynchronous signals can arrive at any instruction, we'd
> have to build _everything_ with -fasync-unwind-tables to make it
> reliable.) It happens to work on x86_64 GNU/Linux at least, but it's
> likely broken on other ports.
> Until we stop throwing from signal handlers, use setjmp/longjmp based
> exceptions in C++ mode as well.
> 2015-11-03 Pedro Alves <email@example.com>
> * common/common-exceptions.h (GDB_XCPT_SJMP, GDB_XCPT_TRY)
> (GDB_XCPT_RAW_TRY, GDB_XCPT): Define.
> Replace __cplusplus checks with GDB_XCPT checks throughout.
> * common/common-exceptions.c: Replace __cplusplus checks with
> GDB_XCPT checks throughout.
This is now pushed.