This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [C++] Always use setjmp/longjmp for exceptions


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.
> 
> gdb/ChangeLog:
> 2015-11-03  Pedro Alves  <palves@redhat.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.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]