aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-valprint.c
diff options
context:
space:
mode:
authorPaul N. Hilfinger <hilfinger@adacore.com>2004-07-01 10:30:57 +0000
committerPaul N. Hilfinger <hilfinger@adacore.com>2004-07-01 10:30:57 +0000
commit0b5d8877912034b2af0c548afbb794e4dcd07fbd (patch)
treee619934dc3c806b54c401a041e5dc5d6ab8b96d0 /gdb/ada-valprint.c
parent19c1ef65d7309fbce692396866d54e7ede61e7dd (diff)
downloadgdb-0b5d8877912034b2af0c548afbb794e4dcd07fbd.zip
gdb-0b5d8877912034b2af0c548afbb794e4dcd07fbd.tar.gz
gdb-0b5d8877912034b2af0c548afbb794e4dcd07fbd.tar.bz2
* ada-lang.c (decode_packed_array): Minor change to comment.
(ada_value_slice_ptr): New function. (ada_value_slice): New function. (ada_evaluate_subexp): Remove XVS-suffix code from subscripting test. Don't know why it is there. Change slice code to use ada_value_slice_ptr and ada_value_slice, and to avoid dereferencing huge arrays from which one is slicing. (empty_array): Correct to return an array rather than a subrange value. * ada-valprint.c (print_optional_low_bound): Don't print lower bound on empty arrays (let'em use 'FIRST instead).
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r--gdb/ada-valprint.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index c7440e6..55baf10 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -86,10 +86,10 @@ adjust_type_signedness (struct type *type)
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
}
-/* Assuming TYPE is a simple array type, prints its lower bound on STREAM,
- if non-standard (i.e., other than 1 for numbers, other than lower bound
- of index type for enumerated type). Returns 1 if something printed,
- otherwise 0. */
+/* Assuming TYPE is a simple, non-empty array type, prints its lower bound
+ on STREAM, if non-standard (i.e., other than 1 for numbers, other
+ than lower bound of index type for enumerated type). Returns 1
+ if something printed, otherwise 0. */
static int
print_optional_low_bound (struct ui_file *stream, struct type *type)
@@ -105,6 +105,8 @@ print_optional_low_bound (struct ui_file *stream, struct type *type)
if (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
{
low_bound = TYPE_LOW_BOUND (index_type);
+ if (low_bound > TYPE_HIGH_BOUND (index_type))
+ return 0;
index_type = TYPE_TARGET_TYPE (index_type);
}
else