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 | |
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')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-value.exp | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index cdd1837..908e469 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-10-03 Paul Koning <paul_koning@dell.com> + Jan Kratochvil <jan.kratochvil@redhat.com> + + * 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. + 2011-10-02 Joel Brobecker <brobecker@adacore.com> * gdb.base/save-bp.exp, gdb.base/save-bp.c: New files. 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 |