From acb5e8bc8c7c5942c8c0de5e2a3ca5ad254fc2be Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 3 Sep 2012 20:47:24 +0000 Subject: [PATCH] Debugger: Ensure Queue is not blocked by LineInfo Request. (If a LineInfoRequest was queued the DebuggerCurrentLine could not search the stack, as commands were not immediately run git-svn-id: trunk@38509 - --- debugger/gdbmidebugger.pp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/debugger/gdbmidebugger.pp b/debugger/gdbmidebugger.pp index d1f936392b..0e48172e6d 100644 --- a/debugger/gdbmidebugger.pp +++ b/debugger/gdbmidebugger.pp @@ -6136,7 +6136,16 @@ begin FGetLineSymbolsCmdObj.OnExecuted := @DoGetLineSymbolsFinished; FGetLineSymbolsCmdObj.OnDestroy := @DoGetLineSymbolsDestroyed; FGetLineSymbolsCmdObj.Priority := GDCMD_PRIOR_LINE_INFO; - TGDBMIDebugger(Debugger).QueueCommand(FGetLineSymbolsCmdObj); + (* TGDBMIDebugger(Debugger).FCommandQueueExecLock > 0 + Force queue, if locked. This will set the RunLevel + This can be called in AsyncCAll (TApplication), while in QueueExecuteLock (this does not run on unlock) + Without ForceQueue, the queue is virtually locked until the current command finishes. + But ExecCommand must be able to unlock + Reproduce: Trigger Exception in app startup (lfm loading). Stack is not searched. + *) + TGDBMIDebugger(Debugger).QueueCommand(FGetLineSymbolsCmdObj, + TGDBMIDebugger(Debugger).FCommandQueueExecLock > 0 + ); (* DoEvaluationFinished may be called immediately at this point *) end; @@ -10995,7 +11004,7 @@ end; procedure TGDBMIDebuggerCommand.ProcessFrame(const ALocation: TDBGLocationRec); begin - FTheDebugger.DoCurrent(ALocation); + FTheDebugger.DoCurrent(ALocation); // TODO: only selected callers FTheDebugger.FCurrentLocation := ALocation; end;