aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index f65fe27..c98e315 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1108,7 +1108,8 @@ maybe_print_array_index (struct type *index_type, LONGEST index,
perhaps we should try to use that notation when appropriate. */
void
-val_print_array_elements (struct type *type, const gdb_byte *valaddr,
+val_print_array_elements (struct type *type,
+ const gdb_byte *valaddr, int embedded_offset,
CORE_ADDR address, struct ui_file *stream,
int recurse,
const struct value *val,
@@ -1171,8 +1172,10 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
rep1 = i + 1;
reps = 1;
- while ((rep1 < len) &&
- !memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
+ while (rep1 < len
+ && memcmp (valaddr + embedded_offset + i * eltlen,
+ valaddr + embedded_offset + rep1 * eltlen,
+ eltlen) == 0)
{
++reps;
++rep1;
@@ -1180,8 +1183,9 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
if (reps > options->repeat_count_threshold)
{
- val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
- stream, recurse + 1, val, options, current_language);
+ val_print (elttype, valaddr, embedded_offset + i * eltlen,
+ address, stream, recurse + 1, val, options,
+ current_language);
annotate_elt_rep (reps);
fprintf_filtered (stream, " <repeats %u times>", reps);
annotate_elt_rep_end ();
@@ -1191,7 +1195,8 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
}
else
{
- val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
+ val_print (elttype, valaddr, embedded_offset + i * eltlen,
+ address,
stream, recurse + 1, val, options, current_language);
annotate_elt ();
things_printed++;