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 0/6] Remove some uses of is_mi_like_p


On 04/30/2018 03:07 PM, Tom Tromey wrote:
> I think in the long run it would be good to remove
> ui_out::is_mi_like_p.  This series removes some unnecessary uses of
> it.  This is a mild improvement because it means there will be less
> temptation for people to copy bad examples from the existing code.

The series looks fine to me.

> Relatedly, I had an idea for how to change cli_out so that most
> (perhaps not all -- there are some tricky cases) uses of is_mi_like_p
> could be removed, and also provide new features like user control over
> display and colorizing.
> 
> The basic idea is first to realize that table names are fixed by the
> MI spec, and so can be relied on by cli_out.  Then, whereever there is
> a sequence involving textual output mixed with ui_out field output,
> the whole sequence could be replaced with a format string that
> references the field names.

I'm not sure what you mean exactly, but I've wished before that
we could write ui-out field output mixed in with plain text with
something like:

  ui_out->field_fmt (_("Field 1 is 0x%pF, at 0x%pF\n"),
                     ui_field_int ("field1", var1),
                     ui_field_func ("func_name", var2));

That's allow proper i18n, and would allow things like colorizing.

I guess that this is something like what you mean, only you
probably have it more thought through.

Thanks,
Pedro Alves


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