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]

Re: [RFC] logic change in m2-valprint.c


On Sun, Jul 01, 2007 at 08:54:19AM -0700, Michael Snyder wrote:
> > It can't be backwards; this is trying to print "1" or "1, 2" but your
> > change would make it print ", 1" and ", 12".
> >
> > I think it's also trying to shorten ranges to "{1..3, 6..7}".  The
> > bug's got to be in there somewhere.  Why's the code dead?  I'm not
> > seeing it... element_seen can be reset by the bit clear case, and then
> > we'll get into the test you're changing again.
> 
> 'Cause we're not in a loop, and it's not a static variable.
> The code is serial.  At entry we set empty_set to one, and
> then we test to see if it's zero.  It can't be zero.

How sure are you sure we're not in a loop? :-)

      for (i = low_bound; i <= high_bound; i++)
        {
          bitval = value_bit_index (TYPE_FIELD_TYPE (type, field),
                                    (TYPE_FIELD_BITPOS (type, field) /
				    8) +
                                    valaddr + embedded_offset, i);
          if (bitval < 0)
            error (_("bit test is out of range"));
          else if (bitval > 0)
            {
              previous_high = i;
              if (! element_seen)
                {
                  if (! empty_set)
                    fprintf_filtered (stream, ", ");


-- 
Daniel Jacobowitz
CodeSourcery


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