summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2011-02-14 11:26:42 +0000
committerPedro Alves <pedro@codesourcery.com>2011-02-14 11:26:42 +0000
commita6e3210db7ee98f70ce97bf7fae59ee1ab011fb6 (patch)
tree2691202c2bde46fac8ba863c03c905fde8a84fc7 /gdb
parent7e8fe5629367d9a70d642b1def35436611490b39 (diff)
downloadgdb-a6e3210db7ee98f70ce97bf7fae59ee1ab011fb6.tar.gz
gdb/
* c-valprint.c (c_val_print): Print a string with unavailable contents as an array.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/c-valprint.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e2ba5f5917a..34ebe9b0aaa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2011-02-14 Pedro Alves <pedro@codesourcery.com>
+ * c-valprint.c (c_val_print): Print a string with unavailable
+ contents as an array.
+
+2011-02-14 Pedro Alves <pedro@codesourcery.com>
+
* value.h (unpack_bits_as_long): Delete declaration.
(unpack_value_bits_as_long): Declare.
(unpack_value_field_as_long): Declare.
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index baad597cf02..138aca6d970 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -187,6 +187,8 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
long as the entire array is valid. */
if (c_textual_element_type (unresolved_elttype,
options->format)
+ && value_bytes_available (original_value, embedded_offset,
+ TYPE_LENGTH (type))
&& value_bits_valid (original_value,
TARGET_CHAR_BIT * embedded_offset,
TARGET_CHAR_BIT * TYPE_LENGTH (type)))