From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12313 invoked by alias); 13 Apr 2006 07:02:46 -0000 Received: (qmail 12289 invoked by uid 22791); 13 Apr 2006 07:02:45 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Apr 2006 07:02:39 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FTvqX-0002r5-E3 for gdb@sources.redhat.com; Thu, 13 Apr 2006 09:02:29 +0200 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Apr 2006 09:02:29 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Apr 2006 09:02:29 +0200 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: printfs output in wrong order in MI Date: Thu, 13 Apr 2006 08:02:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 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-04/txt/msg00150.txt.bz2 Vladimir Prus wrote: > > Hi, > I'm seing strange behaviour of the "printf" command if used in MI: > > (gdb) > print &i > &"print &i\n" > ~"$1 = (int *) 0xbfc5f484\n" > ^done > (gdb) > printf "%x", &i > &"printf \"%x\", &i\n" > ^done > (gdb) > ~"bfc5f484" > -interpreter-exec console "printf \"%x\", &i" > ^done > (gdb) > ~"bfc5f484" > > The output of 'print' appears before "^done", but the output of "printf" > appears *after* both "^done", and the prompt, which makes it impossible to > reliably catch the output. .... > Any ideas why "printf" is so special? I turns out that using printf "%x\n", &i (that is, adding "\n"), fixes the problem. Still looks like a bug to me, though. - Volodya