FpDebugServer: Added TFpDebugThreadQuitDebugServerCommand to quit application

git-svn-id: trunk@49061 -
This commit is contained in:
joost 2015-05-17 11:15:46 +00:00
parent 48e5ae3ac0
commit 71acdc189d
2 changed files with 30 additions and 0 deletions

View File

@ -15,6 +15,7 @@ uses
DbgIntfBaseTypes,
strutils,
debugthread,
CustApp,
SysUtils;
type
@ -27,6 +28,15 @@ type
function GetCommandByName(ATextName: string): TFpDebugThreadCommandClass;
end;
{ TFpDebugThreadQuitDebugServerCommand }
TFpDebugThreadQuitDebugServerCommand = class(TFpDebugThreadCommand)
public
function PreExecute(AController: TDbgController; out DoQueueCommand: boolean): boolean; override;
function Execute(AController: TDbgController; out DoProcessLoop: boolean): boolean; override;
class function TextName: string; override;
end;
{ TFpDebugThreadSetFilenameCommand }
TFpDebugThreadSetFilenameCommand = class(TFpDebugThreadCommand)
@ -157,6 +167,24 @@ implementation
var
GFpDebugThreadCommandList: TFpDebugThreadCommandList = nil;
{ TFpDebugThreadQuitDebugServerCommand }
function TFpDebugThreadQuitDebugServerCommand.PreExecute(AController: TDbgController; out DoQueueCommand: boolean): boolean;
begin
DoQueueCommand:=false;
CustomApplication.Terminate;
end;
function TFpDebugThreadQuitDebugServerCommand.Execute(AController: TDbgController; out DoProcessLoop: boolean): boolean;
begin
// Do nothing
end;
class function TFpDebugThreadQuitDebugServerCommand.TextName: string;
begin
result := 'quitdebugserver';
end;
{ TFpDebugThreadRemoveBreakpointCommand }
function TFpDebugThreadRemoveBreakpointCommand.GetLocation: string;
@ -433,6 +461,7 @@ begin
end;
initialization
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadQuitDebugServerCommand);
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadSetFilenameCommand);
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadRunCommand);
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadContinueCommand);

View File

@ -181,6 +181,7 @@ var
Application: TFPDServerApplication;
begin
Application:=TFPDServerApplication.Create(nil);
CustomApplication:=Application;
Application.Title:='FPDebug Server';
Application.Run;
Application.Free;