mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-01 14:19:32 +01:00
FPDServer: Command added to remove breakpoint
git-svn-id: trunk@49017 -
This commit is contained in:
parent
2b2ffb7044
commit
1c9d6064f2
@ -119,6 +119,20 @@ type
|
||||
property Line: integer read FLine write FLine;
|
||||
end;
|
||||
|
||||
{ TFpDebugThreadRemoveBreakpointCommand }
|
||||
|
||||
TFpDebugThreadRemoveBreakpointCommand = class(TFpDebugThreadCommand)
|
||||
private
|
||||
FLocationValue: TDBGPtr;
|
||||
function GetLocation: string;
|
||||
procedure SetLocation(AValue: string);
|
||||
public
|
||||
function Execute(AController: TDbgController; out DoProcessLoop: boolean): boolean; override;
|
||||
class function TextName: string; override;
|
||||
published
|
||||
property Location: string read GetLocation write SetLocation;
|
||||
end;
|
||||
|
||||
{ TFpDebugThreadGetLocationInfoCommand }
|
||||
|
||||
TFpDebugThreadGetLocationInfoCommand = class(TFpDebugThreadCommand)
|
||||
@ -143,6 +157,38 @@ implementation
|
||||
var
|
||||
GFpDebugThreadCommandList: TFpDebugThreadCommandList = nil;
|
||||
|
||||
{ TFpDebugThreadRemoveBreakpointCommand }
|
||||
|
||||
function TFpDebugThreadRemoveBreakpointCommand.GetLocation: string;
|
||||
begin
|
||||
result := FormatAddress(FLocationValue);
|
||||
end;
|
||||
|
||||
procedure TFpDebugThreadRemoveBreakpointCommand.SetLocation(AValue: string);
|
||||
begin
|
||||
FLocationValue := Hex2Dec(AValue);
|
||||
end;
|
||||
|
||||
function TFpDebugThreadRemoveBreakpointCommand.Execute(AController: TDbgController; out DoProcessLoop: boolean): boolean;
|
||||
begin
|
||||
result := false;
|
||||
DoProcessLoop:=false;
|
||||
if not assigned(AController.CurrentProcess) then
|
||||
begin
|
||||
log('Failed to remove breakpoint: No process', dllInfo);
|
||||
exit;
|
||||
end;
|
||||
if (FLocationValue<>0) then
|
||||
result := AController.CurrentProcess.RemoveBreak(FLocationValue)
|
||||
else
|
||||
log('Failed to remove breakpoint: No location given', dllInfo);
|
||||
end;
|
||||
|
||||
class function TFpDebugThreadRemoveBreakpointCommand.TextName: string;
|
||||
begin
|
||||
result := 'removebreakpoint';
|
||||
end;
|
||||
|
||||
{ TFpDebugThreadStopCommand }
|
||||
|
||||
function TFpDebugThreadStopCommand.Execute(AController: TDbgController; out
|
||||
@ -321,7 +367,7 @@ end;
|
||||
|
||||
class function TFpDebugThreadAddBreakpointCommand.TextName: string;
|
||||
begin
|
||||
result := 'breakpoint';
|
||||
result := 'addbreakpoint';
|
||||
end;
|
||||
|
||||
class function TFpDebugThreadCommandList.instance: TFpDebugThreadCommandList;
|
||||
@ -397,6 +443,7 @@ initialization
|
||||
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadStepOutCommand);
|
||||
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadStopCommand);
|
||||
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadAddBreakpointCommand);
|
||||
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadRemoveBreakpointCommand);
|
||||
TFpDebugThreadCommandList.instance.Add(TFpDebugThreadGetLocationInfoCommand);
|
||||
finalization
|
||||
GFpDebugThreadCommandList.Free;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user