This is the mail archive of the
mailing list for the GDB project.
Re: printfs output in wrong order in MI
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: gdb at sources dot redhat dot com
- Date: Thu, 13 Apr 2006 11:02:23 +0400
- Subject: Re: printfs output in wrong order in MI
- References: <firstname.lastname@example.org>
Vladimir Prus wrote:
> I'm seing strange behaviour of the "printf" command if used in MI:
> print &i
> &"print &i\n"
> ~"$1 = (int *) 0xbfc5f484\n"
> printf "%x", &i
> &"printf \"%x\", &i\n"
> -interpreter-exec console "printf \"%x\", &i"
> 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,