This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] A few ui_out formatting bugs with commands-on-breakpoints
- To: Jason Molenda <jason-swarelist at molenda dot com>
- Subject: Re: [RFA] A few ui_out formatting bugs with commands-on-breakpoints
- From: Fernando Nasser <fnasser at redhat dot com>
- Date: Sat, 08 Sep 2001 14:02:27 -0400
- CC: gdb-patches at sources dot redhat dot com
- Organization: Red Hat Canada
- References: <20010907234014.A10697@shell17.ba.best.com>
Hi Jason,
You are the second person to submit a patch to fix this in a couple of
days.
Unfortunately your patch breaks the MI. I believe Jackie's patch is
closer
to the right fix.
But thanks for the submission anyway. Keep updating your sources as I
believe
this will be fixed soon.
Best regards,
Fernando
Jason Molenda wrote:
>
> Hi, it looks like there were a few small oversights in the ui
> support of printing-commands-on-breakpoints. With the current gdb,
> you enter these commands:
>
> (gdb) b main
> (gdb) comm
> > if $testval == 0
> > print "true"
> > else
> > print "false"
> > end
> > print "done"
> > end
> (gdb)
>
> And this is how it's printed:
>
> (gdb) info br
> Num Type Disp Enb Address What
> 1 breakpoint keep y 0x08071a9e in main at ../../src3/gdb/main.c:714
> if if $testval == 0
> print "true"
> elseelse
> print "false"
> end end
> print "done"
> (gdb)
>
> Not quite ideal. :-) With the attached patch, the output is
>
> (gdb) info br
> Num Type Disp Enb Address What
> 1 breakpoint keep y 0x08070f30 in captured_command_loop
> at ../../src2/gdb/main.c:1
> if $testval == 0
> print "true"
> else
> print "false"
> end
> print "done"
> (gdb)
>
> The 'while' command has a similar problem. There aren't any
> testsuite regressions with this change.
>
> My only concern is that I'm unfamiliar with the UI_OUT suite of
> functions. Are certain ui_out functions are preferred over others?
> For instance, we have "end" printed out by both ui_out_field_string()
> and by ui_out_text(). I removed the first occurrence in each case,
> but who knows, maybe there's a reason to do it the other way. From
> what I can tell in the uiout doco, it's six of one and half a dozen
> of the other.
>
> Jason
>
> ------------------------------------------------------------------------
>
> paName: pa
> Type: Plain Text (text/plain)
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9