aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2010-05-20 07:41:40 +0000
committerPierre Muller <muller@sourceware.org>2010-05-20 07:41:40 +0000
commit8148cf8d75e7d4f891976b3a6a85a7203f8c65b2 (patch)
tree7897d9af77e36c695fdace9f327fbe3bb082f6e9 /gdb
parentc1527ce688b585b22389bd939d107ff791ab1e76 (diff)
downloadgdb-8148cf8d75e7d4f891976b3a6a85a7203f8c65b2.zip
gdb-8148cf8d75e7d4f891976b3a6a85a7203f8c65b2.tar.gz
gdb-8148cf8d75e7d4f891976b3a6a85a7203f8c65b2.tar.bz2
* p-valprint.c (pascal_val_print): Call get_array_bounds
to obtain the number of elements in an array.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/p-valprint.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5cba88b..9828c3a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-20 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-valprint.c (pascal_val_print): Call get_array_bounds
+ to obtain the number of elements in an array.
+
2010-05-19 Doug Evans <dje@google.com>
* python.c (gdbpy_print_stack): Ensure output ends with a newline.
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 5f495b5..1c2f36d 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -60,6 +60,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
unsigned int i = 0; /* Number of characters printed */
unsigned len;
+ long low_bound, high_bound;
struct type *elttype;
unsigned eltlen;
int length_pos, length_size, string_pos;
@@ -71,11 +72,11 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
- if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
+ if (get_array_bounds (type, &low_bound, &high_bound))
{
+ len = high_bound - low_bound + 1;
elttype = check_typedef (TYPE_TARGET_TYPE (type));
eltlen = TYPE_LENGTH (elttype);
- len = TYPE_LENGTH (type) / eltlen;
if (options->prettyprint_arrays)
{
print_spaces_filtered (2 + 2 * recurse, stream);