diff options
Diffstat (limited to 'gdb/testsuite/gdb.python/py-value.exp')
-rw-r--r-- | gdb/testsuite/gdb.python/py-value.exp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp index 5395f8c..fb489e1 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp @@ -74,7 +74,7 @@ proc test_value_creation {} { } # Test address attribute is None in a non-addressable value - gdb_test "python print ('result = %s' % i.address)" "= None" "Test address attribute in non-addressable value" + gdb_test "python print ('result = %s' % i.address)" "= None" "test address attribute in non-addressable value" } proc test_value_numeric_ops {} { @@ -250,10 +250,10 @@ proc test_value_in_inferior {} { } # Smoke-test is_optimized_out attribute - gdb_test "python print ('result = %s' % arg0.is_optimized_out)" "= False" "Test is_optimized_out attribute" + gdb_test "python print ('result = %s' % arg0.is_optimized_out)" "= False" "test is_optimized_out attribute" # Test address attribute - gdb_test "python print ('result = %s' % arg0.address)" "= 0x\[\[:xdigit:\]\]+" "Test address attribute" + gdb_test "python print ('result = %s' % arg0.address)" "= 0x\[\[:xdigit:\]\]+" "test address attribute" # Test displaying a variable that is temporarily at a bad address. # But if we can examine what's at memory address 0, then we'll also be @@ -295,16 +295,16 @@ proc test_value_in_inferior {} { gdb_test "print st" "\"divide et impera\"" gdb_py_test_silent_cmd "python st = gdb.history (0)" "get value from history" 1 gdb_test "python print (st.string ())" "divide et impera" "Test string with no length" - gdb_test "python print (st.string (length = -1))" "divide et impera" "Test string (length = -1) is all of the string" + gdb_test "python print (st.string (length = -1))" "divide et impera" "test string (length = -1) is all of the string" gdb_test "python print (st.string (length = 6))" "divide" - gdb_test "python print (\"---\"+st.string (length = 0)+\"---\")" "------" "Test string (length = 0) is empty" - gdb_test "python print (len(st.string (length = 0)))" "0" "Test length is 0" + gdb_test "python print (\"---\"+st.string (length = 0)+\"---\")" "------" "test string (length = 0) is empty" + gdb_test "python print (len(st.string (length = 0)))" "0" "test length is 0" # Fetch a string that has embedded nulls. gdb_test "print nullst" "\"divide\\\\000et\\\\000impera\".*" gdb_py_test_silent_cmd "python nullst = gdb.history (0)" "get value from history" 1 - gdb_test "python print (nullst.string ())" "divide" "Test string to first null" + gdb_test "python print (nullst.string ())" "divide" "test string to first null" # Python cannot print strings that contain the null (\0) character. # For the purposes of this test, use repr() gdb_py_test_silent_cmd "python nullst = nullst.string (length = 9)" "get string beyond null" 1 @@ -325,18 +325,18 @@ proc test_lazy_strings {} { gdb_py_test_silent_cmd "python sptr = gdb.history (0)" "Get value from history" 1 gdb_py_test_silent_cmd "python lstr = sptr.lazy_string()" "Aquire lazy string" 1 - gdb_test "python print (lstr.type)" "const char \*." "Test lazy-string type name equality" - gdb_test "python print (sptr.type)" "const char \*." "Test string type name equality" + gdb_test "python print (lstr.type)" "const char \*." "test lazy-string type name equality" + gdb_test "python print (sptr.type)" "const char \*." "test string type name equality" # Prevent symbol on address 0x0 being printed. gdb_test_no_output "set print symbol off" gdb_test "print sn" "0x0" gdb_py_test_silent_cmd "python snptr = gdb.history (0)" "Get value from history" 1 - gdb_test "python snstr = snptr.lazy_string(length=5)" ".*Cannot create a lazy string with address.*" "Test lazy string" + gdb_test "python snstr = snptr.lazy_string(length=5)" ".*Cannot create a lazy string with address.*" "test lazy string" gdb_py_test_silent_cmd "python snstr = snptr.lazy_string(length=0)" "Succesfully create a lazy string" 1 - gdb_test "python print (snstr.length)" "0" "Test lazy string length" - gdb_test "python print (snstr.address)" "0" "Test lazy string address" + gdb_test "python print (snstr.length)" "0" "test lazy string length" + gdb_test "python print (snstr.address)" "0" "test lazy string address" } @@ -389,7 +389,7 @@ proc test_value_after_death {} { gdb_test "kill" "" "kill the inferior" \ "Kill the program being debugged. .y or n. $" \ "y" - gdb_test "file" "" "Discard the symbols" \ + gdb_test "file" "" "discard the symbols" \ "Discard symbol table from.*y or n. $" \ "y" @@ -428,7 +428,7 @@ proc test_subscript_regression {exefile lang} { "Obtain address" 1 gdb_py_test_silent_cmd "python rptr = gdb.history(0)" \ "Obtains value from GDB" 1 - gdb_test "python print (rptr\[0\])" "2" "Check pointer passed as reference" + gdb_test "python print (rptr\[0\])" "2" "check pointer passed as reference" # Just the most basic test of dynamic_cast -- it is checked in # the C++ tests. @@ -454,19 +454,19 @@ proc test_subscript_regression {exefile lang} { "Create a value for subscript test" 1 # Try to access an int with a subscript. This should fail. - gdb_test "python print (intv)" "1" "Baseline print of an int Python value" + gdb_test "python print (intv)" "1" "baseline print of an int Python value" gdb_test "python print (intv\[0\])" "gdb.error: Cannot subscript requested type.*" \ "Attempt to access an integer with a subscript" # Try to access a string with a subscript. This should pass. - gdb_test "python print (stringv)" "foo." "Baseline print of a string Python value" - gdb_test "python print (stringv\[0\])" "f." "Attempt to access a string with a subscript" + gdb_test "python print (stringv)" "foo." "baseline print of a string Python value" + gdb_test "python print (stringv\[0\])" "f." "attempt to access a string with a subscript" # Try to access an int array via a pointer with a subscript. This should pass. gdb_py_test_silent_cmd "print p" "Build pointer to array" 1 gdb_py_test_silent_cmd "python pointer = gdb.history(0)" "" 1 - gdb_test "python print (pointer\[0\])" "1" "Access array via pointer with int subscript" - gdb_test "python print (pointer\[intv\])" "2" "Access array via pointer with value subscript" + gdb_test "python print (pointer\[0\])" "1" "access array via pointer with int subscript" + gdb_test "python print (pointer\[intv\])" "2" "access array via pointer with value subscript" # Try to access a single dimension array with a subscript to the # result. This should fail. @@ -477,7 +477,7 @@ proc test_subscript_regression {exefile lang} { # dimensions. This should pass. gdb_py_test_silent_cmd "print {\"fu \",\"foo\",\"bar\"}" "Build array" 1 gdb_py_test_silent_cmd "python marray = gdb.history(0)" "" 1 - gdb_test "python print (marray\[1\]\[2\])" "o." "Test multiple subscript" + gdb_test "python print (marray\[1\]\[2\])" "o." "test multiple subscript" } # A few tests of gdb.parse_and_eval. @@ -500,10 +500,10 @@ proc test_value_hash {} { "three = gdb.Value(3)" "" \ "vdict = {one:\"one str\",two:\"two str\",three:\"three str\"}" "" \ "end" - gdb_test "python print (vdict\[one\])" "one str" "Test dictionary hash" - gdb_test "python print (vdict\[two\])" "two str" "Test dictionary hash" - gdb_test "python print (vdict\[three\])" "three str" "Test dictionary hash" - gdb_test "python print (one.__hash__() == hash(one))" "True" "Test inbuilt hash" + gdb_test "python print (vdict\[one\])" "one str" "test dictionary hash" + gdb_test "python print (vdict\[two\])" "two str" "test dictionary hash" + gdb_test "python print (vdict\[three\])" "three str" "test dictionary hash" + gdb_test "python print (one.__hash__() == hash(one))" "True" "test inbuilt hash" } # Build C version of executable. C++ is built later. |