gdb/
authorPedro Alves <palves@redhat.com>
Mon, 14 Feb 2011 11:32:17 +0000 (11:32 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 14 Feb 2011 11:32:17 +0000 (11:32 +0000)
* valops.c (value_repeat): Use read_value_memory instead of
read_memory.

gdb/testsuite/
* gdb.trace/unavailable.exp (gdb_collect_globals_test): Test that
value repeat handles unavailableness.

gdb/ChangeLog
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.trace/unavailable.exp
gdb/valops.c

index 6cbfdf835552cc05163bfad500177b0b38fc576a..a127078b79ab6f4dfe655731be5052d8ca30d1bb 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-14  Pedro Alves  <pedro@codesourcery.com>
+
+       * valops.c (value_repeat): Use read_value_memory instead of
+       read_memory.
+
 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
 
        * value.h (value_contents_copy, value_contents_copy_raw): Declare.
index 95ad1951c096f7548bf7483eae6201122fb506b5..a9a19c9cade7a501585fa8a146d40a15a064c99b 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-14  Pedro Alves  <pedro@codesourcery.com>
+
+       * gdb.trace/unavailable.exp (gdb_collect_globals_test): Test that
+       value repeat handles unavailableness.
+
 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
 
        * gdb.trace/unavailable.exp (gdb_collect_globals_test): Add new
index 00fb332e43b432e43415ed40d428306381ff8047..18e1043175e912eb5002926d9cb0aaaa6ef058f2 100644 (file)
@@ -155,6 +155,9 @@ proc gdb_collect_globals_test { } {
 
     gdb_test_no_output "set print repeat 10"
 
+    # Check that value repeat handles unavailable-ness.
+    gdb_test "print *tarray@3" " = \\{\\{a = 0, b = <unavailable>\\}, \\{a = 0, b = <unavailable>\\}, \\{a = <unavailable>, b = <unavailable>\\}\\}"
+
     # Static fields
 
     gdb_test "print struct_b.static_struct_a" \
index 1c37fae46a9588e186487750a8c3a683075ad7d8..1f25a32720a55f1657cb6a75e30c28ba7a37061e 100644 (file)
@@ -1456,12 +1456,13 @@ value_repeat (struct value *arg1, int count)
 
   val = allocate_repeat_value (value_enclosing_type (arg1), count);
 
-  read_memory (value_address (arg1),
-              value_contents_all_raw (val),
-              TYPE_LENGTH (value_enclosing_type (val)));
   VALUE_LVAL (val) = lval_memory;
   set_value_address (val, value_address (arg1));
 
+  read_value_memory (val, 0, value_stack (val), value_address (val),
+                    value_contents_all_raw (val),
+                    TYPE_LENGTH (value_enclosing_type (val)));
+
   return val;
 }