mirror of https://github.com/x64dbg/TitanEngine
fixed a bug with stepping over hardware breakpoints
This commit is contained in:
parent
f44b9b0310
commit
d6cb3e584b
|
|
@ -766,30 +766,7 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
|||
}
|
||||
else //no resetting needed (debugger reached hardware breakpoint or the user stepped)
|
||||
{
|
||||
if(engineStepActive)
|
||||
{
|
||||
DBGCode = DBG_CONTINUE;
|
||||
if(engineStepCount == NULL)
|
||||
{
|
||||
myCustomBreakPoint = (fCustomBreakPoint)(engineStepCallBack);
|
||||
__try
|
||||
{
|
||||
engineStepActive = false;
|
||||
engineStepCallBack = NULL;
|
||||
myCustomBreakPoint();
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SingleStep(engineStepCount, engineStepCallBack);
|
||||
}
|
||||
}
|
||||
else //handle hardware breakpoints
|
||||
{
|
||||
//handle hardware breakpoints
|
||||
hActiveThread = OpenThread(THREAD_GET_CONTEXT|THREAD_SET_CONTEXT, false, DBGEvent.dwThreadId);
|
||||
myDBGContext.ContextFlags = CONTEXT_DEBUG_REGISTERS | CONTEXT_CONTROL;
|
||||
GetThreadContext(hActiveThread, &myDBGContext);
|
||||
|
|
@ -915,6 +892,27 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
|||
if(strstr(DisassembledString, "PUSHF"))
|
||||
PushfBPX = true;
|
||||
}
|
||||
if(engineStepActive)
|
||||
{
|
||||
DBGCode = DBG_CONTINUE;
|
||||
if(engineStepCount == NULL)
|
||||
{
|
||||
myCustomBreakPoint = (fCustomBreakPoint)(engineStepCallBack);
|
||||
__try
|
||||
{
|
||||
engineStepActive = false;
|
||||
engineStepCallBack = NULL;
|
||||
myCustomBreakPoint();
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SingleStep(engineStepCount, engineStepCallBack);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(DBGCode==DBG_EXCEPTION_NOT_HANDLED) //NOTE: only call the chSingleStep callback when the debuggee generated the exception
|
||||
|
|
|
|||
Loading…
Reference in New Issue