def analyze_crash(pretty_print = True): """analyze_crash Resets the olympus core and analyzes crash NOTE: DO NOT RESET THE OLYMPUS IMAGE MANUALLY OR YOU WILL LOSE THE DUMP DATA This function will reset the board Args: pretty_print: if True, prints out the core dump in an easy to read format Returns: Dictionary of the core data Raises: OlympusCommError: A failure of communication was detected """ #reset the core dc = Dionysus_Control() dc.reset_internal_state_machine() time.sleep(.1) #now the dump data is ready to be read oly = Dionysus() core_data = oly.dump_core() core_dict = create_core_dump_dict(core_data) pretty_print_core_dump(core_dict)
mem_only = False long_mem_test = False test = False try: dyn = None if (len(argv) > 0): opts = None opts, args = getopt.getopt(argv, "hdmlt", ["help", "debug", "memory", "long", "test"]) for opt, arg in opts: if opt in ("-h", "--help"): usage() sys.exit() elif opt in ("-d", "--debug"): print "Debug mode" dyn = Dionysus(debug = True) dyn.debug_comm() elif opt in ("-m", "--memory"): mem_only = True elif opt in ("-l", "--long"): long_mem_test = True elif opt in ("-t", "--test"): test = True if dyn is None: dyn = Dionysus(debug = False) except IOError, ex: print "PyFtdi IOError when openning: " + str(ex) except AttributeError, ex: print "PyFtdi Attribute Error when openning: " + str(ex)
long_mem_test = False test = False try: dyn = None if (len(argv) > 0): opts = None opts, args = getopt.getopt( argv, "hdmlt", ["help", "debug", "memory", "long", "test"]) for opt, arg in opts: if opt in ("-h", "--help"): usage() sys.exit() elif opt in ("-d", "--debug"): print "Debug mode" dyn = Dionysus(debug=True) dyn.debug_comm() elif opt in ("-m", "--memory"): mem_only = True elif opt in ("-l", "--long"): long_mem_test = True elif opt in ("-t", "--test"): test = True if dyn is None: dyn = Dionysus(debug=False) except IOError, ex: print "PyFtdi IOError when openning: " + str(ex) except AttributeError, ex: print "PyFtdi Attribute Error when openning: " + str(ex)