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: catch SIGSEGV in the demangler


>>>>> "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


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