This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: mi_load_progress question
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 12 Jul 2006 21:32:34 +1200
- Subject: RE: mi_load_progress question
- References: <200607121239.07906.vladimir@codesourcery.com>
Vladimir Prus writes:
>
> Hi,
> I see some strange logic in the mi_load_progress function (file mi/mi-main.c).
> That function is responsible for printing progress report when downloading
> program to target, and the code in question is:
>
> if (current_interp_named_p (INTERP_MI))
> uiout = mi_out_new (2);
> else if (current_interp_named_p (INTERP_MI1))
> uiout = mi_out_new (1);
> else
> return;
>
> When I run gdb with "--i=mi2", this code exists with "return", producing to
> progress information. Is this desired behaviour?
Looking through the change history, other values didn't exist when the original
code was written. So I guess it's not desired behaviour.
if (current_interp_named_p (INTERP_MI1))
uiout = mi_out_new (1);
else 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_MI3))
uiout = mi_out_new (3);
else
return;
would work (until new MI levels are introduced!). It would be best to generalise
this and similar code to make it future proof.
--
Nick http://www.inet.net.nz/~nickrob