aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb-python.exp16
1 files changed, 10 insertions, 6 deletions
diff --git a/gdb/testsuite/lib/gdb-python.exp b/gdb/testsuite/lib/gdb-python.exp
index 1fef27e..c0c0d68 100644
--- a/gdb/testsuite/lib/gdb-python.exp
+++ b/gdb/testsuite/lib/gdb-python.exp
@@ -46,19 +46,23 @@ proc gdb_py_test_multiple { name args } {
return 0
}
-# Return the result of python expression EXPR.
-# DEFAULT is returned if there's an error.
-# This is modelled after get_integer_valueof.
+# Return the result of python expression EXPR. DEFAULT is returned if
+# there's an error. TEST is the test message to use. It can be
+# omitted, in which case a test message is built from EXP. This is
+# modeled after get_integer_valueof.
-proc get_python_valueof { exp default } {
+proc get_python_valueof { exp default {test ""} } {
global gdb_prompt
- set test "get python valueof \"${exp}\""
+ if {$test == ""} {
+ set test "get python valueof \"${exp}\""
+ }
+
set val ${default}
gdb_test_multiple "python print (\"valueof: %s\" % (${exp}))" "$test" {
-re "valueof: (\[^\r\n\]*)\[\r\n\]*$gdb_prompt $" {
set val $expect_out(1,string)
- pass "$test ($val)"
+ pass "$test"
}
timeout {
fail "$test (timeout)"