* p-valprint.c (pascal_val_print): Handle set type if range limits
authorPierre Muller <muller@sourceware.org>
Mon, 17 May 2010 15:29:02 +0000 (15:29 +0000)
committerPierre Muller <muller@sourceware.org>
Mon, 17 May 2010 15:29:02 +0000 (15:29 +0000)
are undefined but size is known.

gdb/ChangeLog
gdb/p-valprint.c

index 33d15ea8897b46d5f225e49da806c0d98481c111..0d2d43c37142b11aa5a555f9cd9327e5fcbaafe5 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-17  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+       * p-valprint.c (pascal_val_print): Handle set type if range limits
+       are undefined but size is known.
+
 2010-05-17  Pedro Alves  <pedro@codesourcery.com>
 
        * procfs.c: Reformat.
index 78cba98d3866e6979c45d9284fd3e1ece43396c7..5f495b5d2bce7e7549f52735bf27e8dd45597770 100644 (file)
@@ -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)
            {
This page took 0.036379 seconds and 4 git commands to generate.