DBG: added software + hardware breakpoints to the scriptapi
This commit is contained in:
parent
c6c49c8102
commit
61579618b8
|
|
@ -39,4 +39,33 @@ SCRIPT_EXPORT void Script::Debug::StepOut()
|
|||
{
|
||||
DbgCmdExecDirect("StepOut");
|
||||
Wait();
|
||||
}
|
||||
|
||||
SCRIPT_EXPORT bool Script::Debug::SetBreakpoint(duint address)
|
||||
{
|
||||
char command[128] = "";
|
||||
sprintf_s(command, "bp %p", address);
|
||||
return DbgCmdExecDirect(command);
|
||||
}
|
||||
|
||||
SCRIPT_EXPORT bool Script::Debug::DeleteBreakpoint(duint address)
|
||||
{
|
||||
char command[128] = "";
|
||||
sprintf_s(command, "bc %p", address);
|
||||
return DbgCmdExecDirect(command);
|
||||
}
|
||||
|
||||
SCRIPT_EXPORT bool Script::Debug::SetHardwareBreakpoint(duint address, HardwareType type)
|
||||
{
|
||||
char command[128] = "";
|
||||
const char* types[] = { "rw", "w", "x" };
|
||||
sprintf_s(command, "bphws %p, %s", address, types[type]);
|
||||
return DbgCmdExecDirect(command);
|
||||
}
|
||||
|
||||
SCRIPT_EXPORT bool Script::Debug::DeleteHardwareBreakpoint(duint address)
|
||||
{
|
||||
char command[128] = "";
|
||||
sprintf_s(command, "bphwc %p", address);
|
||||
return DbgCmdExecDirect(command);
|
||||
}
|
||||
|
|
@ -7,6 +7,13 @@ namespace Script
|
|||
{
|
||||
namespace Debug
|
||||
{
|
||||
enum HardwareType
|
||||
{
|
||||
HardwareAccess,
|
||||
HardwareWrite,
|
||||
HardwareExecute
|
||||
};
|
||||
|
||||
SCRIPT_EXPORT void Wait();
|
||||
SCRIPT_EXPORT void Run();
|
||||
SCRIPT_EXPORT void Pause();
|
||||
|
|
@ -14,6 +21,10 @@ SCRIPT_EXPORT void Stop();
|
|||
SCRIPT_EXPORT void StepIn();
|
||||
SCRIPT_EXPORT void StepOver();
|
||||
SCRIPT_EXPORT void StepOut();
|
||||
SCRIPT_EXPORT bool SetBreakpoint(duint address);
|
||||
SCRIPT_EXPORT bool DeleteBreakpoint(duint address);
|
||||
SCRIPT_EXPORT bool SetHardwareBreakpoint(duint address, HardwareType type = HardwareExecute);
|
||||
SCRIPT_EXPORT bool DeleteHardwareBreakpoint(duint address);
|
||||
}; //Debug
|
||||
}; //Script
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue