From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4569 invoked by alias); 12 Apr 2006 16:02:20 -0000 Received: (qmail 4561 invoked by uid 22791); 12 Apr 2006 16:02:20 -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; Wed, 12 Apr 2006 16:02:15 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FThn9-0003i6-A6 for gdb@sources.redhat.com; Wed, 12 Apr 2006 18:02:03 +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 ; Wed, 12 Apr 2006 18:02:03 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Apr 2006 18:02:03 +0200 To: gdb@sources.redhat.com From: Vladimir Prus Subject: printfs output in wrong order in MI Date: Wed, 12 Apr 2006 16:54:00 -0000 Message-ID: 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/msg00145.txt.bz2 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. I'm trying to use 'printf' in order to obtain addresses of all local variables in one command, without round-trips for every local variable. This behaviour of 'printfs' seems to prevent my trick from working. Any ideas why "printf" is so special? - Volodya