def main():
filename = sys.argv[1]
fptr = open(filename, "r")
source = fptr.read()
fptr.seek(0)
source_lines = format_source_lines(fptr.readlines())
fptr.close()
draw_header("Source")
display_source(source_lines)
code = compile(source, filename, "exec")
vm = BytecodeVM(code, source_lines, filename)
WITH_DEBUGGER = False
if not WITH_DEBUGGER:
draw_header("Disassembly")
dis.dis(code)
# Configure the VM and set the settings based on command line. For now use defaults
config = configure_vm()
config.show_disassembly = True
vm.config = config
vm.execute()
else:
debugger = Debugger(code, source_lines, filename)
debugger.execute(False)
评论列表
文章目录