Exemplo n.º 1
0
Arquivo: sim.py Projeto: stefanct/aua
            c.reset()
        
        elif input[0] == "t" or input[0] == "trace":
            if len(input) > 1:
                if input[1] == "on" or input[1] == "On" or input[1] == "1":
                    c.set_trace(1)
                    print "Trace is now on."
                elif input[1] == "off" or input[1] == "Off" or input[1] == "0":
                    c.set_trace(0)
                    print "Trace is now off."
            else:
                print "You must set trace to \"on\" or \"off\"."
        
        elif input[0] == "w" or input[0] == "watch":
            if len(input) > 1:
                c.add_watchpoint(input[1:])
            else:
                watchpoints = c.list_watchpoints()
                if len(watchpoints) > 0:
                    for i in range(len(watchpoints)):
                        print i+1, "\t", hex(watchpoints[i])
                        
                else:
                    print "No watchpoints have been set yet."
        
        else:
            print "Unknown command, see h[elp] for a list of valid commands."

    input = raw_input('> ').split()