if with_jtag_gdb:
cmd += ['--rbb-port', '0']
os.environ['REMOTE_BITBANG_HOST'] = 'localhost'
- self.infinite_loop = harts[0].compile(
+ self.infinite_loop = target.compile(harts[0],
"programs/checksum.c", "programs/tiny-malloc.c",
"programs/infinite_loop.S", "-DDEFINE_MALLOC", "-DDEFINE_FREE")
cmd.append(self.infinite_loop)
self.child.expect(r"\(gdb\)")
def command(self, command, timeout=6000):
+ """timeout is in seconds"""
self.child.sendline(command)
self.child.expect("\n", timeout=timeout)
self.child.expect(r"\(gdb\)", timeout=timeout)
if compile_args not in BaseTest.compiled:
# pylint: disable=star-args
BaseTest.compiled[compile_args] = \
- self.hart.compile(*compile_args)
+ self.target.compile(self.hart, *compile_args)
self.binary = BaseTest.compiled.get(compile_args)
def classSetup(self):
del self.server
del self.target_process
+ def postMortem(self):
+ pass
+
def run(self):
"""
If compile_args is set, compile a program and set self.binary.
print e.message
header("Traceback")
traceback.print_exc(file=sys.stdout)
+ self.postMortem()
return result
finally:
# FIXME: OpenOCD doesn't handle PRIV now
#self.gdb.p("$priv=3")
+ def postMortem(self):
+ if not self.gdb:
+ return
+ self.gdb.interrupt()
+ self.gdb.command("info registers all", timeout=10)
+
def classTeardown(self):
del self.gdb
BaseTest.classTeardown(self)