From 7a081a30fdfabd82e038396825f02f04fa448c00 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Mon, 17 May 2010 15:29:02 +0000 Subject: [PATCH] * p-valprint.c (pascal_val_print): Handle set type if range limits are undefined but size is known. --- gdb/ChangeLog | 5 +++++ gdb/p-valprint.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 33d15ea8897..0d2d43c3714 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-05-17 Pierre Muller + + * p-valprint.c (pascal_val_print): Handle set type if range limits + are undefined but size is known. + 2010-05-17 Pedro Alves * procfs.c: Reformat. diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 78cba98d386..5f495b5d2bc 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -480,6 +480,14 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, fputs_filtered ("[", stream); i = get_discrete_bounds (range, &low_bound, &high_bound); + if (low_bound == 0 && high_bound == -1 && TYPE_LENGTH (type) > 0) + { + /* If we know the size of the set type, we can figure out the + maximum value. */ + i = 0; + high_bound = TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1; + TYPE_HIGH_BOUND (range) = high_bound; + } maybe_bad_bstring: if (i < 0) {