#!/usr/bin/env ruby begin require 'net/smtp' $: << File.dirname($0) require 'crashreporter.config' crashed_process = ARGV[0] crashed_pid = Process.ppid command = "gdb -batch -x crashreporter.gdb #{crashed_process} #{crashed_pid} 2> /dev/null" crash_report = 'COULDN\'T GATHER CRASH REPORT' begin crash_report = `#{command}` rescue => error puts("Can't execute debugger: #{error}") end begin message = < error puts("Can't send crash report: #{error}") puts(crash_report) end Process.kill('SIGKILL', Process.ppid) rescue => error puts error end