aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-02-14 11:32:17 +0000
committerPedro Alves <palves@redhat.com>2011-02-14 11:32:17 +0000
commit24e6bceefbdf681e3e4101a44835a29afe33f902 (patch)
treea7f258878d68bf2665e9af03d8a3afad7c2e2920
parent39d37385568d667a2f5fab7e10adda5813a54467 (diff)
downloadgdb-24e6bceefbdf681e3e4101a44835a29afe33f902.zip
gdb-24e6bceefbdf681e3e4101a44835a29afe33f902.tar.gz
gdb-24e6bceefbdf681e3e4101a44835a29afe33f902.tar.bz2
gdb/
* 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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.trace/unavailable.exp3
-rw-r--r--gdb/valops.c7
4 files changed, 17 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6cbfdf8..a127078 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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.
* value.c (value_contents_copy_raw, value_contents_copy): New
functions.
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 95ad195..a9a19c9 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
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
tests for building arrays from unavailable values, subscripting
non-memory rvalue unvailable arrays, and accessing fields or
diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp
index 00fb332..18e1043 100644
--- a/gdb/testsuite/gdb.trace/unavailable.exp
+++ b/gdb/testsuite/gdb.trace/unavailable.exp
@@ -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" \
diff --git a/gdb/valops.c b/gdb/valops.c
index 1c37fae..1f25a32 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -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;
}