From 878f0f5faea194ce152ba4d43ee65da81b89a530 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Thu, 13 Jun 2024 11:30:47 +0200 Subject: [PATCH] Fix evalCall overwrite stack --- hld/Debugger.hx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hld/Debugger.hx b/hld/Debugger.hx index a3bc7a8..bca3d43 100644 --- a/hld/Debugger.hx +++ b/hld/Debugger.hx @@ -179,7 +179,7 @@ class Debugger { function evalResumeDebug() { resume(); - wait(); + wait(false, true); } function close() { @@ -282,7 +282,7 @@ class Debugger { return fields; } - function wait( onStep = false ) : Api.WaitResult { + function wait( onStep = false, onEvalCall = false ) : Api.WaitResult { var cmd = null; var condition : String = null; watchBreak = null; @@ -369,6 +369,10 @@ class Debugger { } stoppedThread = cmd.tid; + // Do not overwrite stack on evalCall + if( onEvalCall ) + return cmd.r; + // in thread-disabled we don't know the main thread id in HL: // first stop is on a special thread in windows // wait for second stop with is user-specific