Send 'winedbg --auto' output to stderr

Francois Gouget fgouget at codeweavers.com
Wed Apr 14 18:23:45 CDT 2004


winedbg now always send its output to stdout. However, when invoked as 
'winedbg --auto' it should send its output to stderr so that stack 
traces can be collected together with the regular log messages.


Changelog:

  * programs/winedbg/winedbg.c

    Francois Gouget <fgouget at codeweavers.com>

    Have winedbg send its output to stderr when invoked with the --auto 
option.


-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
Index: programs/winedbg/winedbg.c
===================================================================
RCS file: /var/cvs/wine/programs/winedbg/winedbg.c,v
retrieving revision 1.18
diff -u -r1.18 winedbg.c
--- a/programs/winedbg/winedbg.c	3 Feb 2004 00:14:12 -0000	1.18
+++ b/programs/winedbg/winedbg.c	14 Apr 2004 23:08:06 -0000
@@ -57,9 +57,10 @@
 
 DBG_INTVAR DEBUG_IntVars[DBG_IV_LAST];
 
+static HANDLE hOutput;
 void	DEBUG_OutputA(const char* buffer, int len)
 {
-    WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buffer, len, NULL, NULL);
+    WriteFile(hOutput, buffer, len, NULL, NULL);
 }
 
 void	DEBUG_OutputW(const WCHAR* buffer, int len)
@@ -1067,6 +1068,9 @@
     DWORD	retv = 0;
     unsigned    gdb_flags = 0;
 
+    /* Initialize the output */
+    hOutput=GetStdHandle(STD_OUTPUT_HANDLE);
+
     /* Initialize the type handling stuff. */
     DEBUG_InitTypes();
     DEBUG_InitCVDataTypes();
@@ -1081,6 +1085,7 @@
         {
             if (local_mode != none_mode) return DEBUG_Usage();
             local_mode = automatic_mode;
+            hOutput=GetStdHandle(STD_ERROR_HANDLE);
             /* force some internal variables */
             DBG_IVAR(BreakOnDllLoad) = 0;
             argc--; argv++;


More information about the wine-patches mailing list