DBG: start implementation to "RunQueue" in ASync handler. Issue #0022172

git-svn-id: trunk@37486 -
This commit is contained in:
martin 2012-06-02 19:54:12 +00:00
parent 271950f52e
commit 4d0137d86b

View File

@ -40,7 +40,7 @@ interface
uses
Classes, SysUtils, Controls, Math, Variants, LCLProc, LazClasses, LazLoggerBase, Dialogs,
DebugUtils, Debugger, FileUtil, CmdLineDebugger, GDBTypeInfo, Maps, LCLIntf,
DebugUtils, Debugger, FileUtil, CmdLineDebugger, GDBTypeInfo, Maps, LCLIntf, Forms,
{$IFdef MSWindows}
Windows,
{$ENDIF}
@ -435,6 +435,9 @@ type
procedure CancelAllQueued;
procedure CancelBeforeRun;
procedure CancelAfterStop;
procedure RunQueueASync;
procedure RemoveRunQueueASync;
procedure DoRunQueueFromASync(Data: PtrInt);
function StartDebugging(AContinueCommand: TGDBMIExecCommandType): Boolean;
function StartDebugging(AContinueCommand: TGDBMIExecCommandType; AValues: array of const): Boolean;
function StartDebugging(AContinueCommand: TGDBMIDebuggerCommand = nil): Boolean;
@ -6173,6 +6176,7 @@ begin
LockRelease;
inherited;
ClearCommandQueue;
RemoveRunQueueASync;
FreeAndNil(FCommandQueue);
ClearSourceInfo;
FreeAndNil(FSourceNames);
@ -6232,12 +6236,9 @@ begin
then begin
FRunQueueOnUnlock := False;
// if FCommandQueueExecLock, then queu will be run, by however has that lock
if (FCommandQueueExecLock = 0)
if (FCommandQueueExecLock = 0) and (FCommandQueue.Count > 0)
then begin
c := FCommandQueue.Count > 0;
if c then DebugLnEnter(DBGMI_QUEUE_DEBUG, ['TGDBMIDebugger.UnLockCommandProcessing: Execute RunQueue ']);
RunQueue;
if c then DebugLnExit(DBGMI_QUEUE_DEBUG, ['TGDBMIDebugger.UnLockCommandProcessing: Finished RunQueue']);
RunQueueASync;
end
end;
end;
@ -6495,6 +6496,7 @@ var
Cmd, NestedCurrentCmd, NestedCurrentCmdTmp: TGDBMIDebuggerCommand;
SavedInExecuteCount: LongInt;
begin
RemoveRunQueueASync;
if FCommandQueue.Count = 0
then exit;
@ -6699,6 +6701,23 @@ begin
// do not cancel FCurrentCommand;
end;
procedure TGDBMIDebugger.RunQueueASync;
begin
Application.QueueAsyncCall(@DoRunQueueFromASync, 0);
end;
procedure TGDBMIDebugger.RemoveRunQueueASync;
begin
Application.RemoveAsyncCalls(Self);
end;
procedure TGDBMIDebugger.DoRunQueueFromASync(Data: PtrInt);
begin
DebugLnEnter(DBGMI_QUEUE_DEBUG, ['TGDBMIDebugger.DoRunQueueFromASync: Execute RunQueue ']);
RunQueue;
DebugLnExit(DBGMI_QUEUE_DEBUG, ['TGDBMIDebugger.DoRunQueueFromASync: Finished RunQueue']);
end;
class function TGDBMIDebugger.ExePaths: String;
begin
{$IFdef MSWindows}