This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: catch SIGSEGV in the demangler
- From: Tom Tromey <tromey at redhat dot com>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 18 Jan 2013 10:34:13 -0700
- Subject: Re: catch SIGSEGV in the demangler
- References: <87fw23o70u.fsf@fleche.redhat.com> <19236.9665638127$1358374641@news.gmane.org> <87622vd2vd.fsf@fleche.redhat.com>
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> I was thinking of perhaps expanding the scope somewhat.
Tom> One idea I had was to introduce a new RETURN_SEGV to return_reason and
Tom> *not* add this to RETURN_MASK_ALL.
Tom> Then, have a special throw_segv that first looks to see if anything
Tom> expects to catch it, and if not, reset the handler and re-raise the
Tom> signal.
Tom> This way we could let code handle SEGV when appropriate, without tying
Tom> it to the demangler -- but also without catching all SEGVs that occur in
Tom> gdb.
I implemented this and I think it reads a bit better.
Now any code that knows what to do with a SEGV can
TRY_CATCH (except, RETURN_MASK_SEGV) { ... }
... but if nothing on the call stack does this, SEGVs are just allowed
to cause gdb to crash.
Tom