1
0
Fork 0

DBG: allow skipping of INT3 instructions when using run

This commit is contained in:
mrexodia 2016-11-02 01:33:08 +01:00
parent 12fba8887b
commit fa15877303
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 17 additions and 16 deletions

View File

@ -10,6 +10,22 @@
#include "value.h"
#include "TraceRecord.h"
static bool skipInt3Stepping(int argc, char* argv[])
{
if(!bSkipInt3Stepping || dbgisrunning())
return false;
duint cip = GetContextDataEx(hActiveThread, UE_CIP);
unsigned char ch;
MemRead(cip, &ch, sizeof(ch));
if(ch == 0xCC && getLastExceptionInfo().ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
{
dputs(QT_TRANSLATE_NOOP("DBG", "Skipped INT3!"));
cbDebugSkip(argc, argv);
return true;
}
return false;
}
bool cbDebugRunInternal(int argc, char* argv[])
{
// Don't "run" twice if the program is already running
@ -195,6 +211,7 @@ bool cbDebugDetach(int argc, char* argv[])
bool cbDebugRun(int argc, char* argv[])
{
HistoryClear();
skipInt3Stepping(argc, argv);
return cbDebugRunInternal(argc, argv);
}
@ -274,22 +291,6 @@ bool cbDebugContinue(int argc, char* argv[])
return true;
}
static bool skipInt3Stepping(int argc, char* argv[])
{
if(!bSkipInt3Stepping || dbgisrunning())
return false;
duint cip = GetContextDataEx(hActiveThread, UE_CIP);
unsigned char ch;
MemRead(cip, &ch, sizeof(ch));
if(ch == 0xCC && getLastExceptionInfo().ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
{
dputs(QT_TRANSLATE_NOOP("DBG", "Skipped INT3!"));
cbDebugSkip(argc, argv);
return true;
}
return false;
}
bool cbDebugStepInto(int argc, char* argv[])
{
if(skipInt3Stepping(argc, argv))