This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] print arrays with indexes
On Sun, Sep 18, 2005 at 10:08:13PM +0300, Eli Zaretskii wrote:
> > Date: Sat, 17 Sep 2005 22:41:09 -0700
> > From: Joel Brobecker <email@example.com>
> > > My first reaction was that it would be confusing. We'd have a variable
> > > to hold the threshold, and it would always show up in "show" or "help"
> > > output, but most of the time its value would be ignored. The trickier
> > > something is to document accurately, the more likely it is to confuse
> > > users.
> > I also do not have a strong opinion, but I admit that having one
> > knob seems a bit simpler to me (in terms of the user interface).
> Okay, but I still am missing something: we already have a couple of
> "set SOMETHING" commands that use the convention that setting a limit
> to zero (or -1 in one case) means unlimited. Can't we use this in the
> case in point, rather than inventing a new add_* interface? Given
Yes, we do have a lot of such interfaces. The problem is that this one
has two special values, not just one: always on, always off, and off if
the number of elements is above a certain limit.
We could do "0 is on, N is threshold, UINT_MAX is off", but in that
case, I'd rather give 0 and UINT_MAX names of "on" and "off" so that
"show" output is more intelligible. We already do this for
var_uinteger and var_integer, which show up as "unlimited".
> that we already have so many different add_command interfaces (and
> all but 2 of them are undocumented), I'd rather not introduce yet
> another interface unless we really have to.
Well, then, perhaps this would be a good time for us to document them?
:-) If Joel doesn't have time, I'll do it.