|
@@ -10,10 +10,16 @@
|
|
|
|
|
|
fail_count = 0
|
|
fail_count = 0
|
|
|
|
|
|
|
|
+
|
|
|
|
+def gdb_exit(status):
|
|
|
|
+ gdb.execute(f"exit {status}")
|
|
|
|
+
|
|
|
|
+
|
|
class arg_parser(argparse.ArgumentParser):
|
|
class arg_parser(argparse.ArgumentParser):
|
|
def exit(self, status=None, message=""):
|
|
def exit(self, status=None, message=""):
|
|
print("Wrong GDB script test argument! " + message)
|
|
print("Wrong GDB script test argument! " + message)
|
|
- gdb.execute("exit 1")
|
|
|
|
|
|
+ gdb_exit(1)
|
|
|
|
+
|
|
|
|
|
|
def report(cond, msg):
|
|
def report(cond, msg):
|
|
"""Report success/fail of a test"""
|
|
"""Report success/fail of a test"""
|
|
@@ -38,11 +44,11 @@ def main(test, expected_arch=None):
|
|
"connected to {}".format(expected_arch))
|
|
"connected to {}".format(expected_arch))
|
|
except (gdb.error, AttributeError):
|
|
except (gdb.error, AttributeError):
|
|
print("SKIP: not connected")
|
|
print("SKIP: not connected")
|
|
- exit(0)
|
|
|
|
|
|
+ gdb_exit(0)
|
|
|
|
|
|
if gdb.parse_and_eval("$pc") == 0:
|
|
if gdb.parse_and_eval("$pc") == 0:
|
|
print("SKIP: PC not set")
|
|
print("SKIP: PC not set")
|
|
- exit(0)
|
|
|
|
|
|
+ gdb_exit(0)
|
|
|
|
|
|
try:
|
|
try:
|
|
test()
|
|
test()
|
|
@@ -62,4 +68,4 @@ def main(test, expected_arch=None):
|
|
pass
|
|
pass
|
|
|
|
|
|
print("All tests complete: {} failures".format(fail_count))
|
|
print("All tests complete: {} failures".format(fail_count))
|
|
- gdb.execute(f"exit {fail_count}")
|
|
|
|
|
|
+ gdb_exit(fail_count)
|