diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/ada-lang.c | 3 | ||||
-rw-r--r-- | gdb/ada-valprint.c | 7 |
3 files changed, 16 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 990bad7..e01b98b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 2015-05-05 Joel Brobecker <brobecker@adacore.com> + * ada-valprint.c (val_print_packed_array_elements): Delete + variable "len". Add a type-length check when comparing two + consecutive elements of the array. Use the element's actual + length in call to value_contents_eq. + * ada-lang.c (ada_value_primitive_packed_val): Always return + a value whose type has been resolved. + +2015-05-05 Joel Brobecker <brobecker@adacore.com> + * ada-lang.c (ada_value_primitive_packed_val): Recompute BIT_SIZE and LEN if the size of the resolved type is smaller than BIT_SIZE * HOST_CHAR_BIT. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index d0aea26..c56e8bb 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -2549,6 +2549,9 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, targ += delta; } + if (is_dynamic_type (value_type (v))) + v = value_from_contents_and_address (value_type (v), value_contents (v), + 0); return v; } diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 720854e..ba12a78 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -129,13 +129,11 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, unsigned int things_printed = 0; unsigned len; struct type *elttype, *index_type; - unsigned eltlen; unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0); struct value *mark = value_mark (); LONGEST low = 0; elttype = TYPE_TARGET_TYPE (type); - eltlen = TYPE_LENGTH (check_typedef (elttype)); index_type = TYPE_INDEX_TYPE (type); { @@ -184,9 +182,12 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, (i * bitsize) / HOST_CHAR_BIT, (i * bitsize) % HOST_CHAR_BIT, bitsize, elttype); + if (TYPE_LENGTH (check_typedef (value_type (v0))) + != TYPE_LENGTH (check_typedef (value_type (v1)))) + break; if (!value_contents_eq (v0, value_embedded_offset (v0), v1, value_embedded_offset (v1), - eltlen)) + TYPE_LENGTH (check_typedef (value_type (v0))))) break; } |