diff options
author | Paul Koning <pkoning@equallogic.com> | 2011-10-25 18:35:49 +0000 |
---|---|---|
committer | Paul Koning <pkoning@equallogic.com> | 2011-10-25 18:35:49 +0000 |
commit | 54d8a6445fa1b27e4cd03307af963828cf337f9f (patch) | |
tree | 9964c1554fc5f5ae634120518cad2e4b0cbdc152 /gdb/testsuite | |
parent | 22dbab4672e0b4aa7259b24594bb74d92f1c059e (diff) | |
download | gdb-54d8a6445fa1b27e4cd03307af963828cf337f9f.zip gdb-54d8a6445fa1b27e4cd03307af963828cf337f9f.tar.gz gdb-54d8a6445fa1b27e4cd03307af963828cf337f9f.tar.bz2 |
* gdb.python/py-value.exp: Add testcases for is_lazy attribute,
fetch_lazy method.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-value.exp | 18 |
2 files changed, 21 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9222124..db459a4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-10-25 Paul Koning <paul_koning@dell.com> + + PR python/13327 + + * gdb.python/py-value.exp: Add testcases for is_lazy attribute, + fetch_lazy method. + 2011-10-24 Yao Qi <yao@codesourcery.com> * lib/gdb.exp (can_single_step_to_signal_handler): Return 0 when diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp index 92065c5..59d79ae 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp @@ -236,17 +236,27 @@ 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" + # Test Python lazy value handling + set test "memory error and 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 inval = gdb.parse_and_eval('*(int*)0')" + gdb_test "python print inval.is_lazy" "True" + gdb_test "python inval2 = inval+1" "gdb.MemoryError: Cannot access memory at address 0x0.*" $test + gdb_test "python inval.fetch_lazy ()" "gdb.MemoryError: Cannot access memory at address 0x0.*" $test } gdb_test "python argc_lazy = gdb.parse_and_eval('argc')" + gdb_test "python argc_notlazy = gdb.parse_and_eval('argc')" + gdb_test "python argc_notlazy.fetch_lazy()" + gdb_test "python print argc_lazy.is_lazy" "True" + gdb_test "python print argc_notlazy.is_lazy" "False" gdb_test "print argc" " = 1" "sanity check argc" + gdb_test "python print argc_lazy.is_lazy" "\r\nTrue" gdb_test_no_output "set argc=2" - gdb_test "python print argc_lazy" "\r\n1" + gdb_test "python print argc_notlazy" "\r\n1" + gdb_test "python print argc_lazy" "\r\n2" + gdb_test "python print argc_lazy.is_lazy" "False" # Test string fetches, both partial and whole. gdb_test "print st" "\"divide et impera\"" |