+
+# Helper routine for PerfTest::assemble "run" step implementations.
+# Issues the "python ${OBJ}.run()" command, and consumes GDB output
+# line by line. Issues a FAIL if the command fails with a Python
+# error. Issues a PASS on success. MESSAGE is an optional message to
+# be printed. If this is omitted, then the pass/fail messages use the
+# command string as the message.
+
+proc gdb_test_python_run {obj {message ""}} {
+ global gdb_prompt
+
+ set saw_error 0
+ gdb_test_multiple "python ${obj}.run()" $message {
+ -re "Error while executing Python code\\." {
+ set saw_error 1
+ exp_continue
+ }
+ -re "\[^\r\n\]*\r\n" {
+ exp_continue
+ }
+ -re "$gdb_prompt $" {
+ gdb_assert {!$saw_error} $gdb_test_name
+ }
+ }
+}