To backtrace crashed thread from Linux core_pattern handler a special operation
similar to PTRACE_ATTACH needs to be done. This is implemented as a demo in
eu-stack's core_pattern function invoked by eu-stack's --core-pattern option.
The code of core_pattern function has been suggested by Oleg Nesterov.
src/
2014-11-26 Jan Kratochvil <jan.kratochvil@redhat.com>
* stack.c: Include sys/ptrace.h and sys/wait.h.
(OPT_CORE_PATTERN, opt_core_pattern, core_pattern): New.
(parse_opt): Handle OPT_CORE_PATTERN. Check opt_core_pattern option
validity. Call core_pattern. Pass it as assume_ptrace_stopped.
(main): Add "core-pattern" to options.