Re: [RFC/RFA] print arrays with indexes

Daniel Jacobowitz
2005-09-07T13:23:28Z

On Tue, Sep 06, 2005 at 10:39:51PM -0700, Joel Brobecker wrote:
> > So, yes, a language method would be good.
>
> Ok, how about calling it la_print_array_index? The current language_defn
> structure already la_printchar and la_printstr (no "_" between print and
> the object name), but I think using underscores is that much clearer in
> this case.
>
> void (*la_print_array_index) (struct value *index_value,
> struct ui_file *stream,
> int format,
> enum val_prettyprint pretty);
>
> I'll then define a new LA_PRINT_ARRAY_INDEX macro
>
> #define LA_PRINT_ARRAY_INDEX (index_value, stream, format, pretty) \
> (current_language->la_print_array_index(index_value, stream, format, pretty))

Fine with me.

> > > (gdb) set/show print array-indexes
> > >
> > > With a default of "off", to preserve the current behavior.
> >
> > I suppose we've got to :-) I'd turn it on, that's for sure.
>
> There is also Jim's suggestion which has some merits. I'm more of
> an all or nothing kind of guy, so I prefer the approach I've chosen,
> but I am flexible.

I've got no strong opinions on this either way. Thresholds seem
complicated as a UI.

--
Daniel Jacobowitz
CodeSourcery, LLC