diff options
author | Paul Koning <pkoning@equallogic.com> | 2011-10-03 16:15:26 +0000 |
---|---|---|
committer | Paul Koning <pkoning@equallogic.com> | 2011-10-03 16:15:26 +0000 |
commit | aa2071bd242e144dc6764517a0a6117b6a5a1661 (patch) | |
tree | 9686978a6fd3c54ab05a17052d8b17550c0c750e /gdb/testsuite/gdb.python | |
parent | 3fcaed3833ab21b4d36489b7662084a5a9f1e12e (diff) | |
download | gdb-aa2071bd242e144dc6764517a0a6117b6a5a1661.zip gdb-aa2071bd242e144dc6764517a0a6117b6a5a1661.tar.gz gdb-aa2071bd242e144dc6764517a0a6117b6a5a1661.tar.bz2 |
* gdb.python/py-value.exp
(python inval = gdb.parse_and_eval('*(int*)0'))
(python argc_lazy = gdb.parse_and_eval('argc'), sanity check argc)
(set argc=2, python print argc_lazy): New tests.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r-- | gdb/testsuite/gdb.python/py-value.exp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp index 35fe0be..92065c5 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp @@ -236,6 +236,18 @@ proc test_value_in_inferior {} { gdb_test "python print gdb.parse_and_eval('*(int*)0')" "gdb.MemoryError: Cannot access memory at address 0x0.*" $test } + # Test Python values are not lazy. + set test "memory error occurs even for possibly lazy values" + if {$can_read_0} { + untested $test + } else { + gdb_test "python inval = gdb.parse_and_eval('*(int*)0')" "gdb.MemoryError: Cannot access memory at address 0x0.*" $test + } + gdb_test "python argc_lazy = gdb.parse_and_eval('argc')" + gdb_test "print argc" " = 1" "sanity check argc" + gdb_test_no_output "set argc=2" + gdb_test "python print argc_lazy" "\r\n1" + # Test string fetches, both partial and whole. gdb_test "print st" "\"divide et impera\"" gdb_py_test_silent_cmd "python st = gdb.history (0)" "get value from history" 1 |