From 9fc6d940ae73525e1e3ef9332452926d18732b14 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 14 Feb 2011 11:26:42 +0000 Subject: [PATCH] gdb/ * c-valprint.c (c_val_print): Print a string with unavailable contents as an array. --- gdb/ChangeLog | 5 +++++ gdb/c-valprint.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e2ba5f5917a..34ebe9b0aaa 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-02-14 Pedro Alves + + * c-valprint.c (c_val_print): Print a string with unavailable + contents as an array. + 2011-02-14 Pedro Alves * value.h (unpack_bits_as_long): Delete declaration. 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))) -- 2.30.2