options_file = config.get('options.py')
if options_file:
scope = { 'options' : options }
- execfile(options_file, scope)
+ exec(compile(open(options_file).read(), options_file, 'exec'), scope)
arguments = options.parse_args()
return options,arguments
# isn't available.
code.InteractiveConsole(scope).interact(banner)
+
+def _check_tracing():
+ if defines.TRACING_ON:
+ return
+
+ fatal("Tracing is not enabled. Compile with TRACING_ON")
+
def main(*args):
import m5
m5.options = options
- def check_tracing():
- if defines.TRACING_ON:
- return
-
- fatal("Tracing is not enabled. Compile with TRACING_ON")
-
# Set the main event queue for the main thread.
event.mainq = event.getEventQueue(0)
event.setEventQueue(event.mainq)
if options.debug_help:
done = True
- check_tracing()
+ _check_tracing()
debug.help()
if options.list_sim_objects:
debug.schedBreak(int(when))
if options.debug_flags:
- check_tracing()
+ _check_tracing()
on_flags = []
off_flags = []
debug.flags[flag].enable()
if options.debug_start:
- check_tracing()
+ _check_tracing()
e = event.create(trace.enable, event.Event.Debug_Enable_Pri)
event.mainq.schedule(e, options.debug_start)
else:
trace.enable()
if options.debug_end:
- check_tracing()
+ _check_tracing()
e = event.create(trace.disable, event.Event.Debug_Enable_Pri)
event.mainq.schedule(e, options.debug_end)
trace.output(options.debug_file)
for ignore in options.debug_ignore:
- check_tracing()
+ _check_tracing()
trace.ignore(ignore)
sys.argv = arguments
t = t.tb_next
pdb.interaction(t.tb_frame,t)
else:
- exec filecode in scope
+ exec(filecode, scope)
# once the script is done
if options.interactive:
raise AttributeError("Could not find file '%s'" % jobfile)
data = {}
- execfile(filename, data)
+ exec(compile(open(filename).read(), filename, 'exec'), data)
if 'conf' not in data:
raise ImportError('cannot import name conf from %s' % jobfile)
return data['conf']