Skip to content

Commit

Permalink
Fix continue for Linux without break Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Apr 12, 2024
1 parent 5beaa00 commit a7e947f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/HLAdapter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class HLAdapter extends DebugSession {
var dbg : hld.Debugger;
var startTime : Float;
var timer : haxe.Timer;
var shouldRun : Bool;

var varsValues : Map<Int,VarValue>;
var ptrValues : Array<hld.Debugger.Address>;
Expand All @@ -52,6 +53,7 @@ class HLAdapter extends DebugSession {
ptrValues = [];
watchedPtrs = [];
inst = this;
shouldRun = false;
}

override function initializeRequest(response:InitializeResponse, args:InitializeRequestArguments) {
Expand Down Expand Up @@ -332,9 +334,12 @@ class HLAdapter extends DebugSession {
debug("init done");
timer = new haxe.Timer(16);
timer.run = function() {
if( dbg == null || dbg.stoppedThread != null )
if( dbg == null )
return;
run();
if( shouldRun || dbg.stoppedThread == null ) {
shouldRun = false;
run();
}
};
}

Expand Down Expand Up @@ -897,7 +902,7 @@ class HLAdapter extends DebugSession {
override function continueRequest(response:ContinueResponse, args:ContinueArguments) {
debug("Continue");
sendResponse(response);
safe(() -> handleWait(dbg.run()));
shouldRun = true;
}

override function sourceRequest(response:SourceResponse, args:SourceArguments) {
Expand Down

0 comments on commit a7e947f

Please sign in to comment.