From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20742 invoked by alias); 12 Jul 2006 09:33:58 -0000 Received: (qmail 20730 invoked by uid 22791); 12 Jul 2006 09:33:58 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 12 Jul 2006 09:33:55 +0000 Received: from kahikatea.snap.net.nz (p202-124-112-169.snap.net.nz [202.124.112.169]) by viper.snap.net.nz (Postfix) with ESMTP id AA11F76F552; Wed, 12 Jul 2006 21:33:51 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 30AA41D3550; Wed, 12 Jul 2006 21:32:36 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17588.49586.825386.426144@kahikatea.snap.net.nz> Date: Wed, 12 Jul 2006 09:33:00 -0000 To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: RE: mi_load_progress question In-Reply-To: <200607121239.07906.vladimir@codesourcery.com> References: <200607121239.07906.vladimir@codesourcery.com> X-Mailer: VM 7.19 under Emacs 22.0.50.36 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00044.txt.bz2 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