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: [RFA] print arrays with indexes


> Date: Tue, 20 Sep 2005 00:30:58 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sources.redhat.com
> 
> Something we haven't really formally decided though, is the significance
> of the threashold. Is it:
> 
>   1. If array size > threshold, then print indexes
>   2. If array size < threshold, then print indexes

The second, I think: it makes sense to ask for arrays that are not too
large to be printed with additional info.

> Now, the sticky part: How to implement this new interface.
> 
> I'll argue that it's best to implement something new. I don't like
> hijacking an old interface to unsigned integer and adding some aliases
> to a couple of values. My reasoning is that saying that OFF is an alias
> for UINT_MAX will make sense for certain cases while it actually won't
> for other cases. Actually, which value to use for OFF will depend on
> the what the threashold actually means.

If you accept my view above, then threshold value of zero means
unlimited.  We already have several set/show commands that behave this
way, so I don't see any problem with having yet another.

> I vote for a new API.

I don't see any reason for a new API.

> I think we should also review the usage of the current ones, probably
> cleanup a bit some of the ones that were on the road to obsolescence
> (IIRC), maybe rationalize a bit more our API if needed, and add some
> documentation. But that should be a separate thread. I don't think I
> will be able to handle all of this, but I can certainly help.

That sounds like a lot of unnecessary work for such an obscure
feature, IMHO.


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