This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: "show user" output
- To: Fernando Nasser <fnasser at redhat dot com>
- Subject: Re: RFA: "show user" output
- From: Jackie Smith Cashion <jsmith at redhat dot com>
- Date: Fri, 07 Sep 2001 12:59:27 -0500
- CC: GDB Patches <gdb-patches at sources dot redhat dot com>
- References: <3B97F051.7D3E36C2@redhat.com> <3B98D43B.777559DD@redhat.com>
The output looks okay when I run the modified GDB. I must admit it's not
clear to me which ui_out function to use for which purpose. Here's how I
made my decisions:
while: I removed the call to ui_out_text since it does not output the
rest of the "while" command line.
while end: It is important to output the indenting spaces before the
keyword, so I removed the call to ui_out_field_string that came before
the ui_out_spaces.
if: I removed the call to ui_out_text since it does not output the rest
of the "if" command line.
else: Since ui_out_text had been used above to output "end" which like
"else" has no command line arguments, I kept the call to ui_out_text
here.
if end: I removed the call to ui_out_field_string that came before the
ui_out_spaces.
I guess the question is whether ui_out_text or ui_out_field_string
should be used to print a simple string with no additional arguments. Is
there a general rule?
Jackie
Fernando Nasser wrote:
>
> Have you checked the MI output before and after your patch?
>
> In particular, this bit suggests that in this last chunk you've removed
> the
> "good" else/end and left the "bad" ones ;-)
>
> > *************** print_command_lines (struct ui_out *uiou
> > *** 197,208 ****
> > {
> > if (depth)
> > ui_out_spaces (uiout, 2 * depth);
> > - ui_out_field_string (uiout, NULL, "else");
> > ui_out_text (uiout, "else\n");
> > print_command_lines (uiout, list->body_list[1], depth + 1);
> > }
> >
> > - ui_out_field_string (uiout, NULL, "end");
> > if (depth)
> > ui_out_spaces (uiout, 2 * depth);
> > ui_out_text (uiout, "end\n");
> > --- 194,203 ----
>
> Regards,
> Fernando
>
> --
> Fernando Nasser
> Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario M4P 2C9
--
Jackie Smith Cashion
email: jsmith@redhat.com
phone: 931 438 2432