OSDN Git Service

* gdb.python/py-value.exp
authorpkoning <pkoning>
Mon, 3 Oct 2011 16:15:18 +0000 (16:15 +0000)
committerpkoning <pkoning>
Mon, 3 Oct 2011 16:15:18 +0000 (16:15 +0000)
(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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-value.exp

index cdd1837..908e469 100644 (file)
@@ -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.
index 35fe0be..92065c5 100644 (file)
@@ -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