This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/2] Demangler crash handler
- From: Gary Benson <gbenson at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 14 May 2014 10:15:15 +0100
- Subject: Re: [PATCH 0/2] Demangler crash handler
- Authentication-results: sourceware.org; auth=none
- References: <20140509100656 dot GA4760 at blade dot nx> <201405091120 dot s49BKO1f010622 at glazunov dot sibelius dot xs4all dot nl> <20140509153305 dot GA13345 at blade dot nx> <CAP9bCMRmZOcMtdKfZZHVCdYat3MqiaK8-RWGzJ3SQW7MViSr6w at mail dot gmail dot com> <20140513102035 dot GA17805 at blade dot nx> <87vbt9foyc dot fsf at fleche dot redhat dot com>
Tom Tromey wrote:
> >>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:
>
> Gary> char *
> Gary> gdb_demangle (const char *name, int options)
> Gary> {
> [...]
> Gary> + sigaction (SIGSEGV, &sa, &old_sa);
> [...]
> Gary> + crash_signal = SIGSETJMP (gdb_demangle_jmp_buf);
> [...]
> Gary> + sigaction (SIGSEGV, &old_sa, NULL);
>
> This adds two calls to sigaction and a call to sigsetjmp to every
> demangling invocation.
>
> I wonder whether the performance cost of this is noticeable; and if
> so, how large the effect is.
I tested this before I mailed the patch: it's not noticable.
FWIW I did time gdb -nx -batch \
/usr/lib64/libreoffice/program/soffice.bin \
-ex "start" -ex "complete b" > /dev/null
Cheers,
Gary
--
http://gbenson.net/