mirror of https://github.com/PCSX2/pcsx2.git
Add debug versions of Null plugins (helps fix some stack tracing problems having a full set of debug-built DLLs, even if they aren't the source of the crashes).
DevNote: Moved jNO_DEFAULT from the Pcsx2Defs.h, since it's too dependent on the Common libraries. It's now in Assertions.h. Plugins can use __assume(0); directly instead or roll their own. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2326 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
ee6c721b51
commit
94cdfb6a8b
|
@ -81,41 +81,6 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// jNO_DEFAULT -- disables the default case in a switch, which improves switch optimization
|
|
||||||
// under MSVC.
|
|
||||||
//
|
|
||||||
// How it Works: jASSUME turns into an __assume(0) under msvc compilers, which when specified
|
|
||||||
// in the 'default:' case of a switch tells the compiler that the case is unreachable, so
|
|
||||||
// that it will not generate any code, LUTs, or conditionals to handle it.
|
|
||||||
//
|
|
||||||
// * In debug builds the default case will cause an assertion.
|
|
||||||
// * In devel builds the default case will cause a LogicError exception (C++ only)
|
|
||||||
// (either meaning the jNO_DEFAULT has been used incorrectly, and that the default case is in
|
|
||||||
// fact used and needs to be handled).
|
|
||||||
//
|
|
||||||
// MSVC Note: To stacktrace LogicError exceptions, add Exception::LogicError to the C++ First-
|
|
||||||
// Chance Exception list (under Debug->Exceptions menu).
|
|
||||||
//
|
|
||||||
#ifndef jNO_DEFAULT
|
|
||||||
#if defined(__cplusplus) && defined(PCSX2_DEVBUILD)
|
|
||||||
# define jNO_DEFAULT \
|
|
||||||
{ \
|
|
||||||
default: \
|
|
||||||
assert(0); \
|
|
||||||
if( !IsDebugBuild ) throw Exception::LogicError( "Incorrect usage of jNO_DEFAULT detected (default case is not unreachable!)" ); \
|
|
||||||
break; \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
# define jNO_DEFAULT \
|
|
||||||
default: \
|
|
||||||
{ \
|
|
||||||
jASSUME(0); \
|
|
||||||
break; \
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// compile-time assertion; usable at static variable define level.
|
// compile-time assertion; usable at static variable define level.
|
||||||
// (typically used to confirm the correct sizeof() for struct types where size
|
// (typically used to confirm the correct sizeof() for struct types where size
|
||||||
|
|
|
@ -18,26 +18,17 @@
|
||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
// pxAssert / pxAssertDev / pxFail / pxFailDev
|
// pxAssert / pxAssertDev / pxFail / pxFailDev
|
||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
// Standard debug-ony "nothrow" (pxAssert) and devel-style "throw" (pxAssertDev) style
|
// Standard "nothrow" assertions. All assertions act as valid conditional statements that
|
||||||
// assertions. All assertions act as valid conditional statements that return the result
|
// return the result of the specified conditional; useful for handling failed assertions in
|
||||||
// of the specified conditional; useful for handling failed assertions in a "graceful" fashion
|
// a "graceful" fashion when utilizing the "ignore" feature of assertion debugging.
|
||||||
// when utilizing the "ignore" feature of assertion debugging. (Release builds *always* return
|
|
||||||
// true for assertion success, but no actual assertion check is performed).
|
|
||||||
//
|
//
|
||||||
// Performance: All assertion types optimize into __assume() directives in Release builds.
|
// Performance: All assertion types optimize into __assume()/likely() directives in Release
|
||||||
|
// builds. If using assertions as part of a conditional, the conditional code *will* not
|
||||||
|
// be optimized out, so use conditionals with caution.
|
||||||
//
|
//
|
||||||
// pxAssertDev is an assertion tool for Devel builds, intended for sanity checking and/or
|
// pxAssertDev is an assertion tool for Devel builds, intended for sanity checking and/or
|
||||||
// bounds checking variables in areas which are not performance critical.
|
// bounds checking variables in areas which are not performance critical. Another common
|
||||||
//
|
// use is for checking thread affinity on utility functions.
|
||||||
// How it works: pxAssertDev throws an exception of type Exception::LogicError if the assertion
|
|
||||||
// conditional is false. Typically for the end-user, this exception is handled by the general
|
|
||||||
// exception handler defined by the application, which (should eventually) create some state
|
|
||||||
// dumps and other information for troubleshooting purposes.
|
|
||||||
//
|
|
||||||
// From a debugging environment, you can trap your pxAssertDev by either breakpointing the
|
|
||||||
// exception throw code in pxOnAssert, or by adding Exception::LogicError to your First-Chance
|
|
||||||
// Exception catch list (Visual Studio, under the Debug->Exceptions menu/dialog). You should
|
|
||||||
// have LogicErrors enabled as First-Chance exceptions regardless, so do it now. :)
|
|
||||||
//
|
//
|
||||||
// Credits Notes: These macros are based on a combination of wxASSERT, MSVCRT's assert
|
// Credits Notes: These macros are based on a combination of wxASSERT, MSVCRT's assert
|
||||||
// and the ATL's Assertion/Assumption macros. the best of all worlds!
|
// and the ATL's Assertion/Assumption macros. the best of all worlds!
|
||||||
|
@ -93,3 +84,37 @@
|
||||||
extern void pxOnAssert( const wxChar* file, int line, const char* func, const wxChar* cond, const wxChar* msg);
|
extern void pxOnAssert( const wxChar* file, int line, const char* func, const wxChar* cond, const wxChar* msg);
|
||||||
extern void pxOnAssert( const wxChar* file, int line, const char* func, const wxChar* cond, const char* msg);
|
extern void pxOnAssert( const wxChar* file, int line, const char* func, const wxChar* cond, const char* msg);
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// jNO_DEFAULT -- disables the default case in a switch, which improves switch optimization
|
||||||
|
// under MSVC.
|
||||||
|
//
|
||||||
|
// How it Works: jASSUME turns into an __assume(0) under msvc compilers, which when specified
|
||||||
|
// in the 'default:' case of a switch tells the compiler that the case is unreachable, so
|
||||||
|
// that it will not generate any code, LUTs, or conditionals to handle it.
|
||||||
|
//
|
||||||
|
// * In debug builds the default case will cause an assertion.
|
||||||
|
// * In devel builds the default case will cause a LogicError exception (C++ only)
|
||||||
|
// (either meaning the jNO_DEFAULT has been used incorrectly, and that the default case is in
|
||||||
|
// fact used and needs to be handled).
|
||||||
|
//
|
||||||
|
// MSVC Note: To stacktrace LogicError exceptions, add Exception::LogicError to the C++ First-
|
||||||
|
// Chance Exception list (under Debug->Exceptions menu).
|
||||||
|
//
|
||||||
|
#ifndef jNO_DEFAULT
|
||||||
|
|
||||||
|
#if defined(__cplusplus) && defined(PCSX2_DEVBUILD)
|
||||||
|
# define jNO_DEFAULT \
|
||||||
|
default: \
|
||||||
|
{ \
|
||||||
|
pxFailDev( "Incorrect usage of jNO_DEFAULT detected (default case is not unreachable!)" ); \
|
||||||
|
break; \
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
# define jNO_DEFAULT \
|
||||||
|
default: \
|
||||||
|
{ \
|
||||||
|
jASSUME(0); \
|
||||||
|
break; \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
ProjectGUID="{3D0EB14D-32F3-4D82-9C6D-B806ADBB859C}"
|
ProjectGUID="{3D0EB14D-32F3-4D82-9C6D-B806ADBB859C}"
|
||||||
RootNamespace="FWnull"
|
RootNamespace="FWnull"
|
||||||
Keyword="Win32Proj"
|
Keyword="Win32Proj"
|
||||||
|
TargetFrameworkVersion="0"
|
||||||
>
|
>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
|
@ -18,7 +19,7 @@
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Debug|Win32"
|
Name="Debug|Win32"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
InheritedPropertySheets="..\..\..\common\vsprops\plugin_svnroot.vsprops;.\ProjectRootDir.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\IncrementalLinking.vsprops"
|
InheritedPropertySheets="..\..\..\common\vsprops\plugin_svnroot.vsprops;.\ProjectRootDir.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\IncrementalLinking.vsprops;..\..\..\common\vsprops\CodeGen_Debug.vsprops"
|
||||||
CharacterSet="2"
|
CharacterSet="2"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="$(OutDir)\$(ProjectName)-dbg.dll"
|
||||||
ModuleDefinitionFile="FireWireNull.def"
|
ModuleDefinitionFile="FireWireNull.def"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
|
|
|
@ -200,7 +200,7 @@ __forceinline u32 _gifTransfer( GIF_PATH pathidx, const u8* pMem, u32 size )
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
jNO_DEFAULT;
|
default: __assume(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Debug|Win32"
|
Name="Debug|Win32"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
InheritedPropertySheets="..\..\..\common\vsprops\plugin_svnroot.vsprops;.\ProjectRootDir.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\IncrementalLinking.vsprops"
|
InheritedPropertySheets="..\..\..\common\vsprops\plugin_svnroot.vsprops;.\ProjectRootDir.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\IncrementalLinking.vsprops;..\..\..\common\vsprops\CodeGen_Debug.vsprops"
|
||||||
CharacterSet="2"
|
CharacterSet="2"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -52,6 +52,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="$(OutDir)\$(ProjectName)-dbg.dll"
|
||||||
ModuleDefinitionFile="GS.def"
|
ModuleDefinitionFile="GS.def"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
ProjectGUID="{BF7B81A5-E348-4F7C-A69F-F74C8EEEAD70}"
|
ProjectGUID="{BF7B81A5-E348-4F7C-A69F-F74C8EEEAD70}"
|
||||||
RootNamespace="USBnull"
|
RootNamespace="USBnull"
|
||||||
Keyword="Win32Proj"
|
Keyword="Win32Proj"
|
||||||
|
TargetFrameworkVersion="0"
|
||||||
>
|
>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
|
@ -18,7 +19,7 @@
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Debug|Win32"
|
Name="Debug|Win32"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
InheritedPropertySheets="..\..\..\common\vsprops\plugin_svnroot.vsprops;.\ProjectRootDir.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\IncrementalLinking.vsprops"
|
InheritedPropertySheets="..\..\..\common\vsprops\plugin_svnroot.vsprops;.\ProjectRootDir.vsprops;..\..\..\common\vsprops\BaseProperties.vsprops;..\..\..\common\vsprops\IncrementalLinking.vsprops;..\..\..\common\vsprops\CodeGen_Debug.vsprops"
|
||||||
CharacterSet="2"
|
CharacterSet="2"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="$(OutDir)\$(ProjectName)-dbg.dll"
|
||||||
ModuleDefinitionFile="USBnull.def"
|
ModuleDefinitionFile="USBnull.def"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
ProjectGUID="{04439C5F-05FB-4A9C-AAD1-5388C25377DB}"
|
ProjectGUID="{04439C5F-05FB-4A9C-AAD1-5388C25377DB}"
|
||||||
RootNamespace="DEV9null"
|
RootNamespace="DEV9null"
|
||||||
Keyword="Win32Proj"
|
Keyword="Win32Proj"
|
||||||
|
TargetFrameworkVersion="0"
|
||||||
>
|
>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
|
@ -54,7 +55,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
LinkIncremental="2"
|
OutputFile="$(OutDir)\$(ProjectName)-dbg.dll"
|
||||||
ModuleDefinitionFile="DEV9null.def"
|
ModuleDefinitionFile="DEV9null.def"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
|
Loading…
Reference in New Issue