This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] pascal: Handle constant sets with unspecified range limits


  I checked in the following patch
to allow to correctly display values of
constant sets with Free Pascal.
  It will still need a fix in dwarf2read.c 
to work for dwarf debug information.



Pierre Muller
Pascal language support maintainer for GDB

ChangeLog entry:
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.

Index: p-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-valprint.c,v
retrieving revision 1.71
diff -u -p -r1.71 p-valprint.c
--- p-valprint.c        16 May 2010 01:27:02 -0000      1.71
+++ p-valprint.c        17 May 2010 15:19:00 -0000
@@ -480,6 +480,14 @@ pascal_val_print (struct type *type, con
            fputs_filtered ("[", stream);

          i = get_discrete_bounds (range, &low_bound, &high_bound);
+         if (high_bound == low_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 = low_bound + TYPE_LENGTH (type) * TARGET_CHAR_BIT
- 1;

+             TYPE_HIGH_BOUND (range) = high_bound;
+           }
        maybe_bad_bstring:
          if (i < 0)
            {



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]