mirror of https://github.com/PCSX2/pcsx2.git
Added some DebugBreak generation (INT3 / 0xcc) to the PsxRec, for catching null pxsRegs.pc assignments from the recompiler (enabled in DEBUG builds only). These are usually more context-useful breakpoints than the assert() check in psxRecompile.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1948 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
910669f937
commit
4efb1ed9ca
|
@ -681,7 +681,6 @@ static __forceinline s32 recExecuteBlock( s32 eeCycles )
|
|||
// Returns the offset to the next instruction after any cleared memory
|
||||
static __forceinline u32 psxRecClearMem(u32 pc)
|
||||
{
|
||||
BASEBLOCKEX* pexblock;
|
||||
BASEBLOCK* pblock;
|
||||
|
||||
pblock = PSX_GETBLOCK(pc);
|
||||
|
@ -696,8 +695,7 @@ static __forceinline u32 psxRecClearMem(u32 pc)
|
|||
|
||||
jASSUME(blockidx != -1);
|
||||
|
||||
// Variable assignment in the middle of the while statements condition?
|
||||
while (pexblock = recBlocks[blockidx - 1]) {
|
||||
while (BASEBLOCKEX* pexblock = recBlocks[blockidx - 1]) {
|
||||
if (pexblock->startpc + pexblock->size * 4 <= lowerextent)
|
||||
break;
|
||||
|
||||
|
@ -705,8 +703,7 @@ static __forceinline u32 psxRecClearMem(u32 pc)
|
|||
blockidx--;
|
||||
}
|
||||
|
||||
// Same here.
|
||||
while (pexblock = recBlocks[blockidx]) {
|
||||
while (BASEBLOCKEX* pexblock = recBlocks[blockidx]) {
|
||||
if (pexblock->startpc >= upperextent)
|
||||
break;
|
||||
|
||||
|
@ -716,7 +713,8 @@ static __forceinline u32 psxRecClearMem(u32 pc)
|
|||
}
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
for (int i = 0; pexblock = recBlocks[i]; i++)
|
||||
blockidx=0;
|
||||
while(BASEBLOCKEX* pexblock = recBlocks[blockidx++])
|
||||
if (pc >= pexblock->startpc && pc < pexblock->startpc + pexblock->size * 4) {
|
||||
Console::Error("Impossible block clearing failure");
|
||||
jASSUME(0);
|
||||
|
@ -749,11 +747,24 @@ void psxSetBranchReg(u32 reg)
|
|||
assert( x86regs[ESI].type == X86TYPE_PCWRITEBACK );
|
||||
MOV32RtoM((uptr)&psxRegs.pc, ESI);
|
||||
x86regs[ESI].inuse = 0;
|
||||
#ifdef PCSX2_DEBUG
|
||||
xOR( esi, esi );
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
MOV32MtoR(EAX, (uptr)&g_recWriteback);
|
||||
MOV32RtoM((uptr)&psxRegs.pc, EAX);
|
||||
|
||||
#ifdef PCSX2_DEBUG
|
||||
xOR( eax, eax );
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PCSX2_DEBUG
|
||||
xForwardJNZ8 skipAssert;
|
||||
xWrite8( 0xcc );
|
||||
skipAssert.SetTarget();
|
||||
#endif
|
||||
}
|
||||
|
||||
_psxFlushCall(FLUSH_EVERYTHING);
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include "IopMem.h"
|
||||
#include "IopDma.h"
|
||||
|
||||
using namespace x86Emitter;
|
||||
|
||||
extern int g_psxWriteOk;
|
||||
extern u32 g_psxMaxRecMem;
|
||||
|
||||
|
@ -1243,11 +1245,23 @@ void rpsxJALR()
|
|||
assert( x86regs[ESI].type == X86TYPE_PCWRITEBACK );
|
||||
MOV32RtoM((uptr)&psxRegs.pc, ESI);
|
||||
x86regs[ESI].inuse = 0;
|
||||
#ifdef PCSX2_DEBUG
|
||||
xOR( esi, esi );
|
||||
#endif
|
||||
|
||||
}
|
||||
else {
|
||||
MOV32MtoR(EAX, (uptr)&g_recWriteback);
|
||||
MOV32RtoM((uptr)&psxRegs.pc, EAX);
|
||||
#ifdef PCSX2_DEBUG
|
||||
xOR( eax, eax );
|
||||
#endif
|
||||
}
|
||||
#ifdef PCSX2_DEBUG
|
||||
xForwardJNZ8 skipAssert;
|
||||
xWrite8( 0xcc );
|
||||
skipAssert.SetTarget();
|
||||
#endif
|
||||
|
||||
psxSetBranchReg(0xffffffff);
|
||||
}
|
||||
|
|
|
@ -491,7 +491,7 @@ void recEventTest()
|
|||
// dont' remove this check unless doing an official release
|
||||
if( g_globalXMMSaved || g_globalMMXSaved)
|
||||
{
|
||||
DevCon::Error("Pcsx2 Foopah! Frozen regs have not been restored!!!");
|
||||
DevCon::Error("PCSX2 Foopah! Frozen regs have not been restored!!!");
|
||||
DevCon::Error("g_globalXMMSaved = %d,g_globalMMXSaved = %d", g_globalXMMSaved, g_globalMMXSaved);
|
||||
}
|
||||
assert( !g_globalXMMSaved && !g_globalMMXSaved);
|
||||
|
|
|
@ -696,6 +696,6 @@ Global
|
|||
{677B7D11-D5E1-40B3-88B1-9A4DF83D2213} = {2D6F0A62-A247-4CCF-947F-FCD54BE16103}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
AMDCaProjectFile = E:\devpcsx2\fail\wx\CodeAnalyst\pcsx2_suite_2008.caw
|
||||
AMDCaProjectFile = E:\devpcsx2\nommx\CodeAnalyst\pcsx2_suite_2008.caw
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
Loading…
Reference in New Issue