diff options
author | Gary Benson <gbenson@redhat.com> | 2014-06-19 09:13:57 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-06-19 09:13:57 +0100 |
commit | 992c7d700f99002ed455b0588488e0e42719ba81 (patch) | |
tree | c24351fbcff74f41550b27263995ec03be1988ed /gdb/doc | |
parent | eae7090bea9d7f129be7dddf89f8e177cdb2003d (diff) | |
download | gdb-992c7d700f99002ed455b0588488e0e42719ba81.zip gdb-992c7d700f99002ed455b0588488e0e42719ba81.tar.gz gdb-992c7d700f99002ed455b0588488e0e42719ba81.tar.bz2 |
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 <gbenson@redhat.com>
* configure.ac [AC_CHECK_FUNCS] <sigaltstack>: 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 <gbenson@redhat.com>
* gdb.texinfo (Maintenance Commands): Document new
"maint set/show catch-demangler-crashes" option.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index afe9867..b686271 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,6 +1,11 @@ 2014-06-19 Gary Benson <gbenson@redhat.com> * gdb.texinfo (Maintenance Commands): Document new + "maint set/show catch-demangler-crashes" option. + +2014-06-19 Gary Benson <gbenson@redhat.com> + + * gdb.texinfo (Maintenance Commands): Document new "maint demangler-warning" command and new "maint set/show demangler-warning" option. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index a990d6b..8588f73 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -33236,6 +33236,17 @@ Expand symbol tables. If @var{regexp} is specified, only expand symbol tables for file names matching @var{regexp}. +@kindex maint set catch-demangler-crashes +@kindex maint show catch-demangler-crashes +@cindex demangler crashes +@item maint set catch-demangler-crashes [on|off] +@itemx maint show catch-demangler-crashes +Control whether @value{GDBN} should attempt to catch crashes in the +symbol name demangler. The default is to attempt to catch crashes. +If enabled, the first time a crash is caught, a core file is created, +the offending symbol is displayed and the user is presented with the +option to terminate the current session. + @kindex maint cplus first_component @item maint cplus first_component @var{name} Print the first C@t{++} class/namespace component of @var{name}. |