This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] logic change in m2-valprint.c
> Date: Mon, 2 Jul 2007 21:11:47 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> On Mon, Jul 02, 2007 at 05:05:12PM -0700, Michael Snyder wrote:
> > is nowhere else for it to be set false), and there is no second
> > time -- we will never enter this block again because we will set
> > "element_seen" to true (and there is nowhere else for it to be
> > set false again).
> >
> > Was that clear?
>
> Clear, but not right.
>
> 152 element_seen = 0;
>
> On entry, empty_set = 1 and element_seen = 0. We see an element,
> which causes us set empty_set = 0 and element_seen = 1. Then we see a
> clear bit in the set and set element_seen to 0 and not change
> empty_set. Then we see a set bit, and element_seen == 0 with
> empty_set == 0. We print the comma.
>
> I would test it, but I don't have an M-2 compiler and the expression
> parser can't create sets. Am I missing something?
Dunno, but it is obvious that this bit of code is in need of a rewrite.