DBG: plugin callback for tracing
This commit is contained in:
parent
c25aefffd3
commit
a3a9dbbbe9
|
|
@ -3,6 +3,7 @@
|
|||
#include "module.h"
|
||||
#include "memory.h"
|
||||
#include "threading.h"
|
||||
#include "plugin_loader.h"
|
||||
|
||||
TraceRecordManager TraceRecord;
|
||||
|
||||
|
|
|
|||
|
|
@ -182,6 +182,12 @@ typedef struct
|
|||
bool retval;
|
||||
} PLUG_CB_FILTERSYMBOL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
duint cip;
|
||||
bool stop;
|
||||
} PLUG_CB_TRACEEXECUTE;
|
||||
|
||||
//enums
|
||||
typedef enum
|
||||
{
|
||||
|
|
@ -209,6 +215,7 @@ typedef enum
|
|||
CB_LOADDB, //PLUG_CB_LOADSAVEDB
|
||||
CB_SAVEDB, //PLUG_CB_LOADSAVEDB
|
||||
CB_FILTERSYMBOL, //PLUG_CB_FILTERSYMBOL
|
||||
CB_TRACEEXECUTE, //PLUG_CB_TRACEEXECUTE
|
||||
CB_LAST
|
||||
} CBTYPE;
|
||||
|
||||
|
|
|
|||
|
|
@ -1093,10 +1093,15 @@ void cbRtrStep()
|
|||
static void cbTXCNDStep(bool bStepInto, void (*callback)())
|
||||
{
|
||||
hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId);
|
||||
if(traceCondition && traceCondition->ContinueTrace())
|
||||
auto CIP = GetContextDataEx(hActiveThread, UE_CIP);
|
||||
PLUG_CB_TRACEEXECUTE info;
|
||||
info.cip = CIP;
|
||||
info.stop = false;
|
||||
plugincbcall(CB_TRACEEXECUTE, &info);
|
||||
if(!info.stop && traceCondition && traceCondition->ContinueTrace())
|
||||
{
|
||||
if(bTraceRecordEnabledDuringTrace)
|
||||
_dbg_dbgtraceexecute(GetContextDataEx(hActiveThread, UE_CIP));
|
||||
_dbg_dbgtraceexecute(CIP);
|
||||
(bStepInto ? StepInto : StepOver)(callback);
|
||||
}
|
||||
else
|
||||
|
|
@ -1126,6 +1131,10 @@ static void cbTXXTStep(bool bStepInto, bool bInto, void (*callback)())
|
|||
hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId);
|
||||
// Trace record
|
||||
duint CIP = GetContextDataEx(hActiveThread, UE_CIP);
|
||||
PLUG_CB_TRACEEXECUTE info;
|
||||
info.cip = CIP;
|
||||
info.stop = false;
|
||||
plugincbcall(CB_TRACEEXECUTE, &info);
|
||||
if(!traceCondition)
|
||||
{
|
||||
_dbg_dbgtraceexecute(CIP);
|
||||
|
|
@ -1133,7 +1142,7 @@ static void cbTXXTStep(bool bStepInto, bool bInto, void (*callback)())
|
|||
cbRtrFinalStep();
|
||||
return;
|
||||
}
|
||||
if(!traceCondition->ContinueTrace() || (TraceRecord.getTraceRecordType(CIP) != TraceRecordManager::TraceRecordNone && (TraceRecord.getHitCount(CIP) == 0) ^ bInto))
|
||||
if(info.stop || !traceCondition->ContinueTrace() || (TraceRecord.getTraceRecordType(CIP) != TraceRecordManager::TraceRecordNone && (TraceRecord.getHitCount(CIP) == 0) ^ bInto))
|
||||
{
|
||||
_dbg_dbgtraceexecute(CIP);
|
||||
auto steps = dbgcleartracecondition();
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ bool pluginload(const char* pluginName, bool loadall)
|
|||
regExport("CBLOADDB", CB_LOADDB);
|
||||
regExport("CBSAVEDB", CB_SAVEDB);
|
||||
regExport("CBFILTERSYMBOL", CB_FILTERSYMBOL);
|
||||
regExport("CBTRACEEXECUTE", CB_TRACEEXECUTE);
|
||||
|
||||
//init plugin
|
||||
if(!pluginData.pluginit(&pluginData.initStruct))
|
||||
|
|
|
|||
Loading…
Reference in New Issue