'Display crashdump info and save to file
Usage:
MYNAME [reason_text]'

def crashdump(self, *arg):

    (reason,) = normalize_argv(arg, 1)
    if (not reason):
        reason = 'Interactive    dump'
    logname = peda.get_config_filename('crashlog')
    logfd = open(logname, 'a')
    config.Option.set('_teefd', logfd)
    msg(('[%s]' % 'START    OF    CRASH    DUMP'.center(78, '-')))
    msg(('Timestamp:    %s' % time.ctime()))
    msg(('Reason:    %s' % red(reason)))
    pc = peda.getreg('pc')
    if (not peda.is_address(pc)):
        exp = red('EXPLOITABLE')
    else:
        exp = 'Unknown'
    msg(('Exploitability:    %s' % exp))
    self.context_register()
    self.context_code(16)
    self.context_stack()
    msg(('[%s]' % 'backtrace    (innermost    10    frames)'.center(78, '-')), 'blue')
    msg(peda.execute_redirect('backtrace    10'))
    msg(('[%s]\n' % 'END    OF    CRASH    DUMP'.center(78, '-')))
    config.Option.set('_teefd', '')
    logfd.close()
    return
