FpDebug: rename TFpInternalBreakpointBase into TFpDbgBreakpoint / Make other packages use TFpDbgBreakpoint instead of internal class.

git-svn-id: trunk@61987 -
This commit is contained in:
martin 2019-10-05 11:09:44 +00:00
parent 804425c111
commit a631e91e53
6 changed files with 37 additions and 37 deletions

View File

@ -53,7 +53,7 @@ type
procedure ShowCode; procedure ShowCode;
procedure GControllerExceptionEvent(var continue: boolean; const ExceptionClass, ExceptionMessage: string); procedure GControllerExceptionEvent(var continue: boolean; const ExceptionClass, ExceptionMessage: string);
procedure GControllerCreateProcessEvent(var continue: boolean); procedure GControllerCreateProcessEvent(var continue: boolean);
procedure GControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpInternalBreakpoint); procedure GControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpDbgBreakpoint);
procedure GControllerProcessExitEvent(ExitCode: DWord); procedure GControllerProcessExitEvent(ExitCode: DWord);
procedure GControllerDebugInfoLoaded(Sender: TObject); procedure GControllerDebugInfoLoaded(Sender: TObject);
protected protected
@ -221,7 +221,7 @@ begin
continue:=false; continue:=false;
end; end;
procedure TFPDLoop.GControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpInternalBreakpoint); procedure TFPDLoop.GControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpDbgBreakpoint);
begin begin
if assigned(Breakpoint) then if assigned(Breakpoint) then
writeln(Format(sBreakpointReached, ['' {FormatAddress(Breakpoint.Location)}])) writeln(Format(sBreakpointReached, ['' {FormatAddress(Breakpoint.Location)}]))

View File

@ -99,7 +99,7 @@ type
TFpServerDbgController = class(TDbgController) TFpServerDbgController = class(TDbgController)
private type private type
TBreakPointIdMap = specialize TFPGMap<Integer, TFpInternalBreakpoint>; TBreakPointIdMap = specialize TFPGMap<Integer, TFpDbgBreakpoint>;
function DoBreakPointCompare(Key1, Key2: Pointer): Integer; function DoBreakPointCompare(Key1, Key2: Pointer): Integer;
private private
FBreakPointIdCnt: Integer; FBreakPointIdCnt: Integer;
@ -108,10 +108,10 @@ type
constructor Create; override; constructor Create; override;
destructor Destroy; override; destructor Destroy; override;
function AddInternalBreakPointToId(ABrkPoint: TFpInternalBreakpoint): Integer; function AddInternalBreakPointToId(ABrkPoint: TFpInternalBreakpoint): Integer;
function GetInternalBreakPointFromId(AnId: Integer): TFpInternalBreakpoint; function GetInternalBreakPointFromId(AnId: Integer): TFpDbgBreakpoint;
function GetIdFromInternalBreakPoint(ABrkPoint: TFpInternalBreakpoint): Integer; function GetIdFromInternalBreakPoint(ABrkPoint: TFpDbgBreakpoint): Integer;
procedure RemoveInternalBreakPoint(AnId: Integer); procedure RemoveInternalBreakPoint(AnId: Integer);
//procedure RemoveInternalBreakPoint(ABrkPoint: TFpInternalBreakpoint); //procedure RemoveInternalBreakPoint(ABrkPoint: TFpDbgBreakpoint);
procedure ClearInternalBreakPoint; procedure ClearInternalBreakPoint;
end; end;
@ -166,7 +166,7 @@ type
procedure FreeConsoleOutputThread; procedure FreeConsoleOutputThread;
protected protected
// Handlers for the FController-events // Handlers for the FController-events
procedure FControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpInternalBreakpoint); procedure FControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpDbgBreakpoint);
procedure FControllerProcessExitEvent(ExitCode: DWord); procedure FControllerProcessExitEvent(ExitCode: DWord);
procedure FControllerCreateProcessEvent(var continue: boolean); procedure FControllerCreateProcessEvent(var continue: boolean);
procedure FControllerDebugInfoLoaded(Sender: TObject); procedure FControllerDebugInfoLoaded(Sender: TObject);
@ -264,14 +264,14 @@ begin
end; end;
function TFpServerDbgController.GetInternalBreakPointFromId(AnId: Integer function TFpServerDbgController.GetInternalBreakPointFromId(AnId: Integer
): TFpInternalBreakpoint; ): TFpDbgBreakpoint;
begin begin
if not FBreakPointIdMap.TryGetData(AnId, Result) then if not FBreakPointIdMap.TryGetData(AnId, Result) then
Result := nil; Result := nil;
end; end;
function TFpServerDbgController.GetIdFromInternalBreakPoint( function TFpServerDbgController.GetIdFromInternalBreakPoint(
ABrkPoint: TFpInternalBreakpoint): Integer; ABrkPoint: TFpDbgBreakpoint): Integer;
begin begin
Result := FBreakPointIdMap.IndexOfData(ABrkPoint); Result := FBreakPointIdMap.IndexOfData(ABrkPoint);
end; end;
@ -434,7 +434,7 @@ begin
end; end;
procedure TFpDebugThread.FControllerHitBreakpointEvent(var continue: boolean; procedure TFpDebugThread.FControllerHitBreakpointEvent(var continue: boolean;
const Breakpoint: TFpInternalBreakpoint); const Breakpoint: TFpDbgBreakpoint);
var var
ADebugEvent: TFpDebugEvent; ADebugEvent: TFpDebugEvent;
AnId: Integer; AnId: Integer;

View File

@ -746,7 +746,7 @@ end;
function TFpDebugThreadRemoveBreakpointCommand.Execute(AController: TFpServerDbgController; out DoProcessLoop: boolean): boolean; function TFpDebugThreadRemoveBreakpointCommand.Execute(AController: TFpServerDbgController; out DoProcessLoop: boolean): boolean;
var var
Brk: TFpInternalBreakpoint; Brk: TFpDbgBreakpoint;
begin begin
result := false; result := false;
DoProcessLoop:=false; DoProcessLoop:=false;

View File

@ -251,9 +251,9 @@ type
function GetEnumerator: TBreakLocationMapEnumerator; function GetEnumerator: TBreakLocationMapEnumerator;
end; end;
{ TFpInternalBreakpointBase } { TFpDbgBreakpoint }
TFpInternalBreakpointBase = class(TObject) TFpDbgBreakpoint = class(TObject)
public public
function Hit(const AThreadID: Integer; ABreakpointAddress: TDBGPtr): Boolean; virtual; abstract; function Hit(const AThreadID: Integer; ABreakpointAddress: TDBGPtr): Boolean; virtual; abstract;
procedure SetBreak; virtual; abstract; procedure SetBreak; virtual; abstract;
@ -262,7 +262,7 @@ type
{ TFpInternalBreakpoint } { TFpInternalBreakpoint }
TFpInternalBreakpoint = class(TFpInternalBreakpointBase) TFpInternalBreakpoint = class(TFpDbgBreakpoint)
private private
FProcess: TDbgProcess; FProcess: TDbgProcess;
FLocation: TDBGPtrArray; FLocation: TDBGPtrArray;
@ -395,7 +395,7 @@ type
function FindContext(AAddress: TDbgPtr): TFpDbgInfoContext; deprecated 'use FindContext(thread,stack)'; function FindContext(AAddress: TDbgPtr): TFpDbgInfoContext; deprecated 'use FindContext(thread,stack)';
function GetLib(const AHandle: THandle; out ALib: TDbgLibrary): Boolean; function GetLib(const AHandle: THandle; out ALib: TDbgLibrary): Boolean;
function GetThread(const AID: Integer; out AThread: TDbgThread): Boolean; function GetThread(const AID: Integer; out AThread: TDbgThread): Boolean;
procedure RemoveBreak(const ABreakPoint: TFpInternalBreakpoint); procedure RemoveBreak(const ABreakPoint: TFpDbgBreakpoint);
procedure DoBeforeBreakLocationMapChange; procedure DoBeforeBreakLocationMapChange;
function HasBreak(const ALocation: TDbgPtr): Boolean; // TODO: remove, once an address can have many breakpoints function HasBreak(const ALocation: TDbgPtr): Boolean; // TODO: remove, once an address can have many breakpoints
procedure RemoveThread(const AID: DWord); procedure RemoveThread(const AID: DWord);
@ -1430,7 +1430,7 @@ begin
end; end;
end; end;
procedure TDbgProcess.RemoveBreak(const ABreakPoint: TFpInternalBreakpoint); procedure TDbgProcess.RemoveBreak(const ABreakPoint: TFpDbgBreakpoint);
begin begin
if ABreakPoint=FCurrentBreakpoint then if ABreakPoint=FCurrentBreakpoint then
FCurrentBreakpoint := nil; FCurrentBreakpoint := nil;

View File

@ -17,7 +17,7 @@ uses
type type
TOnCreateProcessEvent = procedure(var continue: boolean) of object; TOnCreateProcessEvent = procedure(var continue: boolean) of object;
TOnHitBreakpointEvent = procedure(var continue: boolean; const Breakpoint: TFpInternalBreakpoint) of object; TOnHitBreakpointEvent = procedure(var continue: boolean; const Breakpoint: TFpDbgBreakpoint) of object;
TOnExceptionEvent = procedure(var continue: boolean; const ExceptionClass, ExceptionMessage: string) of object; TOnExceptionEvent = procedure(var continue: boolean; const ExceptionClass, ExceptionMessage: string) of object;
TOnProcessExitEvent = procedure(ExitCode: DWord) of object; TOnProcessExitEvent = procedure(ExitCode: DWord) of object;

View File

@ -83,7 +83,7 @@ type
FDbgController: TDbgController; FDbgController: TDbgController;
FFpDebugThread: TFpDebugThread; FFpDebugThread: TFpDebugThread;
FQuickPause: boolean; FQuickPause: boolean;
FRaiseExceptionBreakpoint: TFpInternalBreakpoint; FRaiseExceptionBreakpoint: TFpDbgBreakpoint;
FMemConverter: TFpDbgMemConvertorLittleEndian; FMemConverter: TFpDbgMemConvertorLittleEndian;
FMemReader: TDbgMemReader; FMemReader: TDbgMemReader;
FMemManager: TFpDbgMemManager; FMemManager: TFpDbgMemManager;
@ -91,7 +91,7 @@ type
{$ifdef linux} {$ifdef linux}
FCacheLine: cardinal; FCacheLine: cardinal;
FCacheFileName: string; FCacheFileName: string;
FCacheBreakpoint: TFpInternalBreakpoint; FCacheBreakpoint: TFpDbgBreakpoint;
FCacheLocation: TDBGPtr; FCacheLocation: TDBGPtr;
FCacheBoolean: boolean; FCacheBoolean: boolean;
FCachePointer: pointer; FCachePointer: pointer;
@ -103,7 +103,7 @@ type
function SetSoftwareExceptionBreakpoint: boolean; function SetSoftwareExceptionBreakpoint: boolean;
procedure HandleSoftwareException(out AnExceptionLocation: TDBGLocationRec; var continue: boolean); procedure HandleSoftwareException(out AnExceptionLocation: TDBGLocationRec; var continue: boolean);
procedure FreeDebugThread; procedure FreeDebugThread;
procedure FDbgControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpInternalBreakpoint); procedure FDbgControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpDbgBreakpoint);
procedure FDbgControllerCreateProcessEvent(var {%H-}continue: boolean); procedure FDbgControllerCreateProcessEvent(var {%H-}continue: boolean);
procedure FDbgControllerProcessExitEvent(AExitCode: DWord); procedure FDbgControllerProcessExitEvent(AExitCode: DWord);
procedure FDbgControllerExceptionEvent(var continue: boolean; const ExceptionClass, ExceptionMessage: string); procedure FDbgControllerExceptionEvent(var continue: boolean; const ExceptionClass, ExceptionMessage: string);
@ -156,9 +156,9 @@ type
procedure DoFreeBreakpoint; procedure DoFreeBreakpoint;
procedure DoFindContext; procedure DoFindContext;
{$endif linux} {$endif linux}
function AddBreak(const ALocation: TDbgPtr): TFpInternalBreakpoint; overload; function AddBreak(const ALocation: TDbgPtr): TFpDbgBreakpoint; overload;
function AddBreak(const AFileName: String; ALine: Cardinal): TFpInternalBreakpoint; overload; function AddBreak(const AFileName: String; ALine: Cardinal): TFpDbgBreakpoint; overload;
procedure FreeBreakpoint(const ABreakpoint: TFpInternalBreakpoint); procedure FreeBreakpoint(const ABreakpoint: TFpDbgBreakpoint);
function ReadData(const AAdress: TDbgPtr; const ASize: Cardinal; out AData): Boolean; inline; function ReadData(const AAdress: TDbgPtr; const ASize: Cardinal; out AData): Boolean; inline;
function ReadAddress(const AAdress: TDbgPtr; out AData: TDBGPtr): Boolean; function ReadAddress(const AAdress: TDbgPtr; out AData: TDBGPtr): Boolean;
procedure PrepareCallStackEntryList(AFrameRequired: Integer = -1; AThread: TDbgThread = nil); inline; procedure PrepareCallStackEntryList(AFrameRequired: Integer = -1; AThread: TDbgThread = nil); inline;
@ -270,7 +270,7 @@ type
private private
FSetBreakFlag: boolean; FSetBreakFlag: boolean;
FResetBreakFlag: boolean; FResetBreakFlag: boolean;
FInternalBreakpoint: FpDbgClasses.TFpInternalBreakpoint; FInternalBreakpoint: FpDbgClasses.TFpDbgBreakpoint;
FIsSet: boolean; FIsSet: boolean;
procedure SetBreak; procedure SetBreak;
procedure ResetBreak; procedure ResetBreak;
@ -289,11 +289,11 @@ type
FDelayedRemoveBreakpointList: TObjectList; FDelayedRemoveBreakpointList: TObjectList;
protected protected
procedure DoStateChange(const AOldState: TDBGState); override; procedure DoStateChange(const AOldState: TDBGState); override;
procedure AddBreakpointToDelayedRemoveList(ABreakpoint: FpDbgClasses.TFpInternalBreakpoint); procedure AddBreakpointToDelayedRemoveList(ABreakpoint: FpDbgClasses.TFpDbgBreakpoint);
public public
constructor Create(const ADebugger: TDebuggerIntf; const ABreakPointClass: TDBGBreakPointClass); constructor Create(const ADebugger: TDebuggerIntf; const ABreakPointClass: TDBGBreakPointClass);
destructor Destroy; override; destructor Destroy; override;
function Find(AIntBReakpoint: FpDbgClasses.TFpInternalBreakpoint): TDBGBreakPoint; function Find(AIntBReakpoint: FpDbgClasses.TFpDbgBreakpoint): TDBGBreakPoint;
end; end;
procedure Register; procedure Register;
@ -814,7 +814,7 @@ end;
procedure TFPBreakpoints.DoStateChange(const AOldState: TDBGState); procedure TFPBreakpoints.DoStateChange(const AOldState: TDBGState);
var var
ABrkPoint: FpDbgClasses.TFpInternalBreakpoint; ABrkPoint: FpDbgClasses.TFpDbgBreakpoint;
i: Integer; i: Integer;
begin begin
inherited DoStateChange(AOldState); inherited DoStateChange(AOldState);
@ -824,7 +824,7 @@ begin
debuglnEnter(DBG_BREAKPOINTS, ['TFPBreakpoints.DoStateChange REMOVE DELAYED']); debuglnEnter(DBG_BREAKPOINTS, ['TFPBreakpoints.DoStateChange REMOVE DELAYED']);
for i := FDelayedRemoveBreakpointList.Count-1 downto 0 do for i := FDelayedRemoveBreakpointList.Count-1 downto 0 do
begin begin
ABrkPoint := FpDbgClasses.TFpInternalBreakpoint(FDelayedRemoveBreakpointList[i]); ABrkPoint := FpDbgClasses.TFpDbgBreakpoint(FDelayedRemoveBreakpointList[i]);
TFpDebugDebugger(Debugger).FDbgController.CurrentProcess.RemoveBreak(ABrkPoint); TFpDebugDebugger(Debugger).FDbgController.CurrentProcess.RemoveBreak(ABrkPoint);
TFpDebugDebugger(Debugger).FreeBreakpoint(ABrkPoint); TFpDebugDebugger(Debugger).FreeBreakpoint(ABrkPoint);
ABrkPoint := nil; ABrkPoint := nil;
@ -835,7 +835,7 @@ begin
end; end;
end; end;
procedure TFPBreakpoints.AddBreakpointToDelayedRemoveList(ABreakpoint: FpDbgClasses.TFpInternalBreakpoint); procedure TFPBreakpoints.AddBreakpointToDelayedRemoveList(ABreakpoint: FpDbgClasses.TFpDbgBreakpoint);
begin begin
FDelayedRemoveBreakpointList.Add(ABreakpoint); FDelayedRemoveBreakpointList.Add(ABreakpoint);
end; end;
@ -852,7 +852,7 @@ begin
inherited Destroy; inherited Destroy;
end; end;
function TFPBreakpoints.Find(AIntBReakpoint: FpDbgClasses.TFpInternalBreakpoint): TDBGBreakPoint; function TFPBreakpoints.Find(AIntBReakpoint: FpDbgClasses.TFpDbgBreakpoint): TDBGBreakPoint;
var var
i: integer; i: integer;
begin begin
@ -1691,7 +1691,7 @@ begin
end; end;
procedure TFpDebugDebugger.FDbgControllerHitBreakpointEvent( procedure TFpDebugDebugger.FDbgControllerHitBreakpointEvent(
var continue: boolean; const Breakpoint: TFpInternalBreakpoint); var continue: boolean; const Breakpoint: TFpDbgBreakpoint);
var var
ABreakPoint: TDBGBreakPoint; ABreakPoint: TDBGBreakPoint;
ALocationAddr: TDBGLocationRec; ALocationAddr: TDBGLocationRec;
@ -1738,7 +1738,7 @@ begin
if assigned(ABreakPoint) then if assigned(ABreakPoint) then
ABreakPoint.Hit(&continue); ABreakPoint.Hit(&continue);
end; end;
end end
else if FQuickPause then else if FQuickPause then
begin begin
@ -1751,8 +1751,8 @@ begin
ALocationAddr := GetLocation; ALocationAddr := GetLocation;
// if &continue then SetState(dsInternalPause) else // if &continue then SetState(dsInternalPause) else
SetState(dsPause); SetState(dsPause);
DoCurrent(ALocationAddr); DoCurrent(ALocationAddr);
if &continue then begin if &continue then begin
// wait for any watches for Snapshots // wait for any watches for Snapshots
@ -2076,7 +2076,7 @@ end;
{$endif linux} {$endif linux}
function TFpDebugDebugger.AddBreak(const ALocation: TDbgPtr function TFpDebugDebugger.AddBreak(const ALocation: TDbgPtr
): TFpInternalBreakpoint; ): TFpDbgBreakpoint;
begin begin
{$ifdef linux} {$ifdef linux}
FCacheLocation:=ALocation; FCacheLocation:=ALocation;
@ -2088,7 +2088,7 @@ begin
end; end;
function TFpDebugDebugger.AddBreak(const AFileName: String; ALine: Cardinal function TFpDebugDebugger.AddBreak(const AFileName: String; ALine: Cardinal
): TFpInternalBreakpoint; ): TFpDbgBreakpoint;
begin begin
{$ifdef linux} {$ifdef linux}
FCacheFileName:=AFileName; FCacheFileName:=AFileName;
@ -2101,7 +2101,7 @@ begin
end; end;
procedure TFpDebugDebugger.FreeBreakpoint( procedure TFpDebugDebugger.FreeBreakpoint(
const ABreakpoint: TFpInternalBreakpoint); const ABreakpoint: TFpDbgBreakpoint);
begin begin
{$ifdef linux} {$ifdef linux}
if ABreakpoint = nil then exit; if ABreakpoint = nil then exit;