forked from len0rd/rockbox
added debug and panic support for the simulator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@357 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9469b0458f
commit
53a7dd242c
5 changed files with 106 additions and 7 deletions
38
uisimulator/win32/debug-win32.c
Normal file
38
uisimulator/win32/debug-win32.c
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002 by Felix Arends
|
||||||
|
*
|
||||||
|
* All files in this archive are subject to the GNU General Public License.
|
||||||
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
char debugmembuf[100];
|
||||||
|
char debugbuf[200];
|
||||||
|
|
||||||
|
void debug( const char *message )
|
||||||
|
{
|
||||||
|
OutputDebugString (message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void debugf(char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start( ap, fmt );
|
||||||
|
wsprintf( debugmembuf, fmt, ap );
|
||||||
|
va_end( ap );
|
||||||
|
debug ( debugmembuf );
|
||||||
|
}
|
43
uisimulator/win32/panic-win32.c
Normal file
43
uisimulator/win32/panic-win32.c
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002 by Felix Arends
|
||||||
|
*
|
||||||
|
* All files in this archive are subject to the GNU General Public License.
|
||||||
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
char panic_buf[128];
|
||||||
|
|
||||||
|
// panic
|
||||||
|
// whatever it says ;)
|
||||||
|
void panic( char *message )
|
||||||
|
{
|
||||||
|
debug( message );
|
||||||
|
PostQuitMessage (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// panicf
|
||||||
|
// formatted panic
|
||||||
|
void panicf( char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start( ap, fmt );
|
||||||
|
wsprintf( panic_buf, fmt, ap );
|
||||||
|
va_end( ap );
|
||||||
|
panic( panic_buf );
|
||||||
|
}
|
|
@ -9,8 +9,8 @@ Global
|
||||||
GlobalSection(ProjectDependencies) = postSolution
|
GlobalSection(ProjectDependencies) = postSolution
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfiguration) = postSolution
|
GlobalSection(ProjectConfiguration) = postSolution
|
||||||
{A81A8EFA-647A-427A-BD04-F6B469752E7A}.Debug.ActiveCfg = Release|Win32
|
{A81A8EFA-647A-427A-BD04-F6B469752E7A}.Debug.ActiveCfg = Debug|Win32
|
||||||
{A81A8EFA-647A-427A-BD04-F6B469752E7A}.Debug.Build.0 = Release|Win32
|
{A81A8EFA-647A-427A-BD04-F6B469752E7A}.Debug.Build.0 = Debug|Win32
|
||||||
{A81A8EFA-647A-427A-BD04-F6B469752E7A}.Release.ActiveCfg = Release|Win32
|
{A81A8EFA-647A-427A-BD04-F6B469752E7A}.Release.ActiveCfg = Release|Win32
|
||||||
{A81A8EFA-647A-427A-BD04-F6B469752E7A}.Release.Build.0 = Release|Win32
|
{A81A8EFA-647A-427A-BD04-F6B469752E7A}.Release.Build.0 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
|
Binary file not shown.
|
@ -19,7 +19,7 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories=""C:\Programming\CVS Checkout\firmware";"C:\Programming\CVS Checkout\firmware\drivers""
|
AdditionalIncludeDirectories=""C:\Programming\CVS Checkout\RockBox\firmware";"C:\Programming\CVS Checkout\RockBox\firmware\drivers";"C:\Programming\CVS Checkout\RockBox\firmware\common""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;ARCHOS_RECORDER;SIMULATOR"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;ARCHOS_RECORDER;SIMULATOR"
|
||||||
MinimalRebuild="TRUE"
|
MinimalRebuild="TRUE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
|
@ -106,18 +106,24 @@
|
||||||
<Filter
|
<Filter
|
||||||
Name="Source Files"
|
Name="Source Files"
|
||||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
||||||
<File
|
|
||||||
RelativePath="..\app.c">
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="button.c">
|
RelativePath="button.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\firmware\chartables.c">
|
RelativePath="..\..\firmware\chartables.c">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="debug-win32.c">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="dir-win32.c">
|
RelativePath="dir-win32.c">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\firmware\disk.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\firmware\test\wavey\harness.c">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="kernel.c">
|
RelativePath="kernel.c">
|
||||||
</File>
|
</File>
|
||||||
|
@ -128,7 +134,16 @@
|
||||||
RelativePath="..\..\firmware\drivers\lcd.c">
|
RelativePath="..\..\firmware\drivers\lcd.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\tetris.c">
|
RelativePath="panic-win32.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\firmware\playlist.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\firmware\settings.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\tree.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="uisw32.c">
|
RelativePath="uisw32.c">
|
||||||
|
@ -137,6 +152,9 @@
|
||||||
<Filter
|
<Filter
|
||||||
Name="Header Files"
|
Name="Header Files"
|
||||||
Filter="h;hpp;hxx;hm;inl;inc">
|
Filter="h;hpp;hxx;hm;inl;inc">
|
||||||
|
<File
|
||||||
|
RelativePath="harness.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="lcd-win32.h">
|
RelativePath="lcd-win32.h">
|
||||||
</File>
|
</File>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue