Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: [PATCH] enable debug prints to be logged in mingw32 builds (was Re: win32 debug simulator)
From: Bill Napier (napier_at_pobox.com)
Date: 2002-09-23


On Mon, 23 Sep 2002 00:16:14 +0200, "Danijel Ilisin" <d.ilisin_at_wtnet.de> said:
> Hi, any hint how i get debug messages on win32 build of the
> uisimulator?

This patch should do it. I was just going to print them to the
command prompt window that you (possibly) started the simulator from,
but it detaches from that window. So instead, it logs the debug
messages to the file "debug.log". Here's the patch:

Index: uisimulator/win32/debug-win32.c
===================================================================
RCS file: /cvsroot/rockbox/uisimulator/win32/debug-win32.c,v
retrieving revision 1.2
diff -u -b -r1.2 debug-win32.c
--- uisimulator/win32/debug-win32.c 6 May 2002 11:08:10 -0000 1.2
+++ uisimulator/win32/debug-win32.c 23 Sep 2002 15:02:04 -0000
@@ -19,13 +19,29 @@
 
 #include <windows.h>
 
+#if defined(__MINGW32__)
+#include <stdio.h>
+#endif
+
 char debugmembuf[100];
 char debugbuf[200];
+static FILE* log_file = NULL;
 
 
 void debug( const char *message )
 {
+#if defined(__MINGW32__)
+ if (log_file==NULL) {
+ log_file = fopen("debug.log","w");
+ if (log_file==NULL) {
+ return;
+ }
+ }
+ fprintf(log_file,message);
+#else
     OutputDebugString (message);
+#endif
 }
 
 void debugf(char *fmt, ...)



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa