From 13163d8050012d1c79f1ec764c1f621aa47f1c27 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Fri, 18 Feb 2011 14:17:38 +0000 Subject: [PATCH] * c-valprint.c (c_val_print): Add embedded_offset to address for arrays of unspecified length. * p-valprint.c (pascal_val_print): Likewise. --- gdb/ChangeLog | 6 ++++++ gdb/c-valprint.c | 2 +- gdb/p-valprint.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c349212a3c..c55cc8f346 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2011-02-18 Pierre Muller + + * c-valprint.c (c_val_print): Add embedded_offset to address + for arrays of unspecified length. + * p-valprint.c (pascal_val_print): Likewise. + 2011-02-18 Yao Qi * gdb/arm-tdep.c (arm_displaced_step_copy_insn): Move code to ... diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 8e4f932674..76579d2116 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -240,7 +240,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, } /* Array of unspecified length: treat like pointer to first elt. */ - addr = address; + addr = address + embedded_offset; goto print_unpacked_pointer; case TYPE_CODE_MEMBERPTR: diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index fc50e2a314..ee765421ee 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -128,7 +128,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, break; } /* Array of unspecified length: treat like pointer to first elt. */ - addr = address; + addr = address + embedded_offset; goto print_unpacked_pointer; case TYPE_CODE_PTR: -- 2.34.1