gdb/
authorPedro Alves <palves@redhat.com>
Mon, 14 Feb 2011 11:26:42 +0000 (11:26 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 14 Feb 2011 11:26:42 +0000 (11:26 +0000)
* c-valprint.c (c_val_print): Print a string with unavailable
contents as an array.

gdb/ChangeLog
gdb/c-valprint.c

index e2ba5f5917ae761cabf0c4ede1e28fe2da4ed6b4..34ebe9b0aaa92a4c63f892c1731fe56db9a765e1 100644 (file)
@@ -1,3 +1,8 @@
+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.
index baad597cf023a4977af6763ca6b90ae2a02e699b..138aca6d9705662b7228e730ecdb3097cfe2cfc9 100644 (file)
@@ -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)))