Skip to content

Commit efd35a5

Browse files
committed
evalCall prevent singlestep, which can remove our breakpoints
1 parent fc4cc29 commit efd35a5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

hld/Debugger.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ class Debugger {
171171
this.api = api;
172172
eval = new Eval(module, api, jit);
173173
eval.resumeDebug = evalResumeDebug;
174+
eval.setSingleStep = singleStep;
174175
if( !api.start() )
175176
return false;
176177
wait(); // wait first break
@@ -289,7 +290,7 @@ class Debugger {
289290
while( true ) {
290291
cmd = api.wait(customTimeout == null ? 1000 : Math.ceil(customTimeout * 1000));
291292

292-
if( cmd.r == Breakpoint && (nextStep >= 0 || onStep) ) {
293+
if( cmd.r == Breakpoint && !onEvalCall && (nextStep >= 0 || onStep) ) {
293294
// On Linux, singlestep is not reset
294295
cmd.r = SingleStep;
295296
singleStep(cmd.tid,false);

hld/Eval.hx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,12 @@ class Eval {
490490
if( !api.write(eip, buffer, asmSize) )
491491
throw "assert";
492492
api.flush(eip, asmSize);
493+
var isSingleStep = (api.readRegister(currentThread, EFlags).toInt() & 256) == 256;
494+
if( isSingleStep )
495+
setSingleStep(currentThread, false);
493496
resumeDebug();
497+
if( isSingleStep )
498+
setSingleStep(currentThread, true);
494499
// restore
495500
api.write(eip, prevAsm, asmSize);
496501
api.flush(eip, asmSize);
@@ -509,6 +514,10 @@ class Eval {
509514
throw "Not implemented";
510515
}
511516

517+
public dynamic function setSingleStep(tid : Int, set : Bool) {
518+
throw "Not implemented";
519+
}
520+
512521
function getNum( v : Value ) : Float {
513522
return switch( v.v ) {
514523
case VInt(i): i;

0 commit comments

Comments
 (0)