From 992c7d700f99002ed455b0588488e0e42719ba81 Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Thu, 19 Jun 2014 09:13:57 +0100 Subject: Demangler crash handler This commit wraps calls to the demangler with a segmentation fault handler. The first time a segmentation fault is caught a core file is generated and the user is prompted to file a bug and offered the choice to exit or to continue their GDB session. A maintainence option is provided to allow the user to disable the crash handler if required. gdb/ 2014-06-19 Gary Benson * configure.ac [AC_CHECK_FUNCS] : New check. * configure: Regenerate. * config.in: Likewise. * main.c (signal.h): New include. (setup_alternate_signal_stack): New function. (captured_main): Call the above. * cp-support.c (signal.h): New include. (catch_demangler_crashes): New flag. (SIGJMP_BUF): New define. (SIGSETJMP): Likewise. (SIGLONGJMP): Likewise. (gdb_demangle_jmp_buf): New static global. (gdb_demangle_attempt_core_dump): Likewise. (gdb_demangle_signal_handler): New function. (gdb_demangle): If catch_demangler_crashes is set, install the above signal handler before calling bfd_demangle, and restore the original signal handler afterwards. Display the offending symbol and call demangler_warning the first time a segmentation fault is caught. (_initialize_cp_support): New maint set/show command. gdb/doc/ 2014-06-19 Gary Benson * gdb.texinfo (Maintenance Commands): Document new "maint set/show catch-demangler-crashes" option. --- gdb/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/configure') diff --git a/gdb/configure b/gdb/configure index 05ebace..a4c0a8c 100755 --- a/gdb/configure +++ b/gdb/configure @@ -10507,7 +10507,7 @@ for ac_func in canonicalize_file_name realpath getrusage getuid getgid \ sigaction sigprocmask sigsetmask socketpair \ ttrace wborder wresize setlocale iconvlist libiconvlist btowc \ setrlimit getrlimit posix_madvise waitpid lstat \ - ptrace64 + ptrace64 sigaltstack do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -- cgit v1.1