All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Win32 stdio not working if SDL is enabled
Date: Thu, 13 Aug 2015 19:48:47 +0200	[thread overview]
Message-ID: <55CCD87F.2020400@weilnetz.de> (raw)
In-Reply-To: <20150813120643.GF430@redhat.com>

Am 13.08.2015 um 14:06 schrieb Daniel P. Berrange:
> When debugging some patches on Windows, I discovered that nothing printed
> to stderr ever appears on the console. Eventually I discovered that if I
> build with --disable-sdl, then stderr appears just fine.
> 
> Looking at the code in vl.c I see a hack for SDL introduced in
> 
>   commit 59a36a2f6728081050afc6ec97d0018467999f79
>   Author: Stefan Weil <weil@mail.berlios.de>
>   Date:   Thu Jun 18 20:11:03 2009 +0200
> 
>     Win32: Fix compilation with SDL.
> 
> 
> If I mostly kill the hack from vl.c, and just leave a plain '#undef main'
> then I get working console stderr once again.
> 

Hi Daniel,

that's a feature of SDL 1.2: stdout and stderr are by default
redirected to files stdout.txt and stderr.txt in the executable's
directory.

This redirection can be disabled by an environment variable
(SDL_STDIO_REDIRECT="no"). On my Linux machines, I always
set this variable, so when I run QEMU for Windows with
wine32 or wine64, stdout and stderr work.

Printing to stdout / stderr on Windows can be an adventure:
depending on your shell (command.exe, cmd.exe, MinGW shell,
MinGW rxvt, Cygwin shell, ...) it works different, and I also
had application crashes when a GUI application which was
not started from a shell tried to print to stdout.

>From a user's point of view, maybe a better solution than
the current one would be a GTK console window which displays
any output to stdout / stderr.

Regards
Stefan

  parent reply	other threads:[~2015-08-13 17:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 12:06 [Qemu-devel] Win32 stdio not working if SDL is enabled Daniel P. Berrange
2015-08-13 12:14 ` Pavel Fedin
2015-08-13 14:18 ` Daniel P. Berrange
2015-08-13 17:48 ` Stefan Weil [this message]
2015-08-14 11:14   ` Daniel P. Berrange
2015-08-14 12:15     ` Daniel P. Berrange
2015-08-14 14:59       ` Liviu Ionescu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55CCD87F.2020400@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.