fixed a bug with type-specific memory breakpoint that were removed even if their type was not triggered

This commit is contained in:
mr.exodia 2013-11-19 22:07:51 +01:00
parent 36eb6d9bc1
commit fffbdfac89
9 changed files with 13 additions and 3 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
/TitanEngine/obj
/TitanEngine/x64
/TitanEngine/Release
Release/*/*
*.layout
*.depend
*.sdf

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -17337,7 +17337,8 @@ __declspec(dllexport) void TITCALL DebugLoop()
{
if(BreakPointBuffer[MaximumBreakPoints].MemoryBpxRestoreOnHit != 1)
{
RemoveMemoryBPX(BreakPointBuffer[MaximumBreakPoints].BreakPointAddress, BreakPointBuffer[MaximumBreakPoints].BreakPointSize);
if(DBGEvent.u.Exception.ExceptionRecord.ExceptionInformation[0] == 0) //read operation
RemoveMemoryBPX(BreakPointBuffer[MaximumBreakPoints].BreakPointAddress, BreakPointBuffer[MaximumBreakPoints].BreakPointSize);
}
else
{
@ -17378,7 +17379,8 @@ __declspec(dllexport) void TITCALL DebugLoop()
{
if(BreakPointBuffer[MaximumBreakPoints].MemoryBpxRestoreOnHit != 1) //remove breakpoint
{
RemoveMemoryBPX(BreakPointBuffer[MaximumBreakPoints].BreakPointAddress, BreakPointBuffer[MaximumBreakPoints].BreakPointSize);
if(DBGEvent.u.Exception.ExceptionRecord.ExceptionInformation[0] == 1) //write operation
RemoveMemoryBPX(BreakPointBuffer[MaximumBreakPoints].BreakPointAddress, BreakPointBuffer[MaximumBreakPoints].BreakPointSize);
}
else //restore breakpoint after trap flag
{
@ -17419,7 +17421,8 @@ __declspec(dllexport) void TITCALL DebugLoop()
{
if(BreakPointBuffer[MaximumBreakPoints].MemoryBpxRestoreOnHit != 1)
{
RemoveMemoryBPX(BreakPointBuffer[MaximumBreakPoints].BreakPointAddress, BreakPointBuffer[MaximumBreakPoints].BreakPointSize);
if(DBGEvent.u.Exception.ExceptionRecord.ExceptionInformation[0] == 0 && (ULONG_PTR)DBGEvent.u.Exception.ExceptionRecord.ExceptionAddress >= BreakPointBuffer[MaximumBreakPoints].BreakPointAddress && (ULONG_PTR)DBGEvent.u.Exception.ExceptionRecord.ExceptionAddress <= BreakPointBuffer[MaximumBreakPoints].BreakPointAddress + BreakPointBuffer[MaximumBreakPoints].BreakPointSize) //read operation
RemoveMemoryBPX(BreakPointBuffer[MaximumBreakPoints].BreakPointAddress, BreakPointBuffer[MaximumBreakPoints].BreakPointSize);
}
else
{

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="Workspace">
<Project filename="TitanEngine.cbp" />
</Workspace>
</CodeBlocks_workspace_file>