This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] MI and MI2 should have identical behavior on -target-download command
- From: Daniel Jacobowitz <drow at false dot org>
- To: Nick Roberts <nickrob at snap dot net dot nz>
- Cc: Maxim Grigoriev <maxim at tensilica dot com>, gdb-patches at sources dot redhat dot com, Pete MacLiesh <pmac at tensilica dot com>, Marc Gauthier <marc at tensilica dot com>, Ross Morley <ross at tensilica dot com>
- Date: Tue, 21 Aug 2007 09:27:53 -0400
- Subject: Re: [PATCH] MI and MI2 should have identical behavior on -target-download command
- References: <46CA01BF.3000501@hq.tensilica.com> <18122.55169.70021.143467@kahikatea.snap.net.nz>
On Wed, Aug 22, 2007 at 12:16:01AM +1200, Nick Roberts wrote:
> > It fixes a small glitch in GDB MI. MI2 is a default. So
> > MI and MI2 should work identically. The MI2 being set as
> > a default is hard-coded in several places. I think one
> > place was missed:
> >
> > mi/mi-main.c::mi_load_progress().
Sorry, we (specifically Andrew Stubbs) noticed this problem in
November 2005, but no one got around to fixing it.
> > Without this fix, MI "-target-download" command behaves
> > differently on MI versus MI2 not showing loading progress,
> > when "-i=mi2" is used.
> >
> > GDB front-ends developers might want to stick with "-i=mi"
> > assuming they always use a default. It would be a bad idea
> > to force them to use explicit options like "-i=mi2".
>
> What behaviour do you want for mi3?
MI3 should probably print the progress indicator too. Like below.
Anyone disagree with this patch?
--
Daniel Jacobowitz
CodeSourcery
2007-08-21 Maxim Grigoriev <maxim2405@gmail.com>
Daniel Jacobowitz <dan@codesourcery.com>
* mi-main.c (mi_load_progress): Handle MI2 and MI3 interpreters.
Index: mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.101
diff -u -p -r1.101 mi-main.c
--- mi-main.c 10 Aug 2007 21:52:38 -0000 1.101
+++ mi-main.c 21 Aug 2007 13:26:30 -0000
@@ -1465,10 +1465,13 @@ mi_load_progress (const char *section_na
of this function. */
saved_uiout = uiout;
- if (current_interp_named_p (INTERP_MI))
+ if (current_interp_named_p (INTERP_MI)
+ || current_interp_named_p (INTERP_MI2))
uiout = mi_out_new (2);
else if (current_interp_named_p (INTERP_MI1))
uiout = mi_out_new (1);
+ else if (current_interp_named_p (INTERP_MI3))
+ uiout = mi_out_new (3);
else
return;