diff --git a/src/dbg/commands/cmd-breakpoint-control.cpp b/src/dbg/commands/cmd-breakpoint-control.cpp index b441718b..f0209744 100644 --- a/src/dbg/commands/cmd-breakpoint-control.cpp +++ b/src/dbg/commands/cmd-breakpoint-control.cpp @@ -1321,7 +1321,7 @@ bool cbDebugSetBPGoto(int argc, char* argv[]) _snprintf(cmd, sizeof(cmd), "SetBreakpointCondition %s, 0", argv[1]); if(!cmddirectexec(cmd)) return false; - _snprintf(cmd, sizeof(cmd), "SetBreakpointCommand %s, \"CIP=%s\"", argv[1], argv[2]); + _snprintf(cmd, sizeof(cmd), "SetBreakpointCommand %s, \"bpgoto(%s)\"", argv[1], argv[2]); if(!cmddirectexec(cmd)) return false; _snprintf(cmd, sizeof(cmd), "SetBreakpointCommandCondition %s, 1", argv[1]); diff --git a/src/dbg/expressionfunctions.cpp b/src/dbg/expressionfunctions.cpp index d1ea5610..f5e85d63 100644 --- a/src/dbg/expressionfunctions.cpp +++ b/src/dbg/expressionfunctions.cpp @@ -127,6 +127,9 @@ void ExpressionFunctions::Init() //Arguments RegisterEasy("arg.get,arg", argget); RegisterEasy("arg.set", argset); + + //Undocumented + RegisterEasy("bpgoto", bpgoto); } bool ExpressionFunctions::Register(const String & name, int argc, const CBEXPRESSIONFUNCTION & cbFunction, void* userdata) diff --git a/src/dbg/exprfunc.cpp b/src/dbg/exprfunc.cpp index 09a11c90..e1fa2035 100644 --- a/src/dbg/exprfunc.cpp +++ b/src/dbg/exprfunc.cpp @@ -377,4 +377,11 @@ namespace Exprfunc valtostring(expr.c_str(), value, true); return oldvalue; } + + duint bpgoto(duint cip) + { + //This is a function to sets CIP without calling DebugUpdateGui. This is a workaround for "bpgoto". + SetContextDataEx(hActiveThread, UE_CIP, cip); + return cip; + } } diff --git a/src/dbg/exprfunc.h b/src/dbg/exprfunc.h index a80cb8e0..04616305 100644 --- a/src/dbg/exprfunc.h +++ b/src/dbg/exprfunc.h @@ -65,4 +65,6 @@ namespace Exprfunc duint argget(duint index); duint argset(duint index, duint value); + + duint bpgoto(duint cip); } \ No newline at end of file