On Thu, Jan 30, 2014 at 12:16:26PM +0500, Ayaz Akram wrote:
> I observed that if i place printf in qemu at certain places like in
> hw./serial.c file, I can see the printing when my guest OS is running on
> qemu, while there are some other places like in pckbd.c (emulation of
> keyboard), where if printf is used, I am not able to see any printing while
> guest OS is running, but when I press ctrl+A and x i can see that
> printing......   Any idea why this different behavior ??

Usually the problem is stdout buffering.  See fflush(3) and use
fprintf(stderr) instead for debugging.  stderr is unbuffered by default
on POSIX systems.  I think on Windows you need to explicitly disable
buffering for stderr.

Stefan

Reply via email to