From 323a4cf3abb47f6da2b75123fed27bb5e5d816d1 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Fri, 18 Feb 2011 17:15:44 +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 9f935d31355..289c5e29cd6 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-11 Pedro Alves * infrun.c (proceed): Move switching out and in of tfind mode from diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 85ca3543ef0..5ff65e2227b 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -230,7 +230,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, break; } /* 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 4d39bed265b..633a23396c8 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -132,7 +132,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.47.2