mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 20:56:31 +02:00
FpDebug: rename TFpInternalBreakpointBase into TFpDbgBreakpoint / Make other packages use TFpDbgBreakpoint instead of internal class.
git-svn-id: trunk@61987 -
This commit is contained in:
parent
804425c111
commit
a631e91e53
@ -53,7 +53,7 @@ type
|
||||
procedure ShowCode;
|
||||
procedure GControllerExceptionEvent(var continue: boolean; const ExceptionClass, ExceptionMessage: string);
|
||||
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 GControllerDebugInfoLoaded(Sender: TObject);
|
||||
protected
|
||||
@ -221,7 +221,7 @@ begin
|
||||
continue:=false;
|
||||
end;
|
||||
|
||||
procedure TFPDLoop.GControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpInternalBreakpoint);
|
||||
procedure TFPDLoop.GControllerHitBreakpointEvent(var continue: boolean; const Breakpoint: TFpDbgBreakpoint);
|
||||
begin
|
||||
if assigned(Breakpoint) then
|
||||
writeln(Format(sBreakpointReached, ['' {FormatAddress(Breakpoint.Location)}]))
|
||||
|
@ -99,7 +99,7 @@ type
|
||||
|
||||
TFpServerDbgController = class(TDbgController)
|
||||
private type
|
||||
TBreakPointIdMap = specialize TFPGMap<Integer, TFpInternalBreakpoint>;
|
||||
TBreakPointIdMap = specialize TFPGMap<Integer, TFpDbgBreakpoint>;
|
||||
function DoBreakPointCompare(Key1, Key2: Pointer): Integer;
|
||||
private
|
||||
FBreakPointIdCnt: Integer;
|
||||
@ -108,10 +108,10 @@ type
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
function AddInternalBreakPointToId(ABrkPoint: TFpInternalBreakpoint): Integer;
|
||||
function GetInternalBreakPointFromId(AnId: Integer): TFpInternalBreakpoint;
|
||||
function GetIdFromInternalBreakPoint(ABrkPoint: TFpInternalBreakpoint): Integer;
|
||||
function GetInternalBreakPointFromId(AnId: Integer): TFpDbgBreakpoint;
|
||||
function GetIdFromInternalBreakPoint(ABrkPoint: TFpDbgBreakpoint): Integer;
|
||||
procedure RemoveInternalBreakPoint(AnId: Integer);
|
||||
//procedure RemoveInternalBreakPoint(ABrkPoint: TFpInternalBreakpoint);
|
||||
//procedure RemoveInternalBreakPoint(ABrkPoint: TFpDbgBreakpoint);
|
||||
procedure ClearInternalBreakPoint;
|
||||
end;
|
||||
|
||||
@ -166,7 +166,7 @@ type
|
||||
procedure FreeConsoleOutputThread;
|
||||
protected
|
||||
// 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 FControllerCreateProcessEvent(var continue: boolean);
|
||||
procedure FControllerDebugInfoLoaded(Sender: TObject);
|
||||
@ -264,14 +264,14 @@ begin
|
||||
end;
|
||||
|
||||
function TFpServerDbgController.GetInternalBreakPointFromId(AnId: Integer
|
||||
): TFpInternalBreakpoint;
|
||||
): TFpDbgBreakpoint;
|
||||
begin
|
||||
if not FBreakPointIdMap.TryGetData(AnId, Result) then
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function TFpServerDbgController.GetIdFromInternalBreakPoint(
|
||||
ABrkPoint: TFpInternalBreakpoint): Integer;
|
||||
ABrkPoint: TFpDbgBreakpoint): Integer;
|
||||
begin
|
||||
Result := FBreakPointIdMap.IndexOfData(ABrkPoint);
|
||||
end;
|
||||
@ -434,7 +434,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFpDebugThread.FControllerHitBreakpointEvent(var continue: boolean;
|
||||
const Breakpoint: TFpInternalBreakpoint);
|
||||
const Breakpoint: TFpDbgBreakpoint);
|
||||
var
|
||||
ADebugEvent: TFpDebugEvent;
|
||||
AnId: Integer;
|
||||
|
@ -746,7 +746,7 @@ end;
|
||||
|
||||
function TFpDebugThreadRemoveBreakpointCommand.Execute(AController: TFpServerDbgController; out DoProcessLoop: boolean): boolean;
|
||||
var
|
||||
Brk: TFpInternalBreakpoint;
|
||||
Brk: TFpDbgBreakpoint;
|
||||
begin
|
||||
result := false;
|
||||
DoProcessLoop:=false;
|
||||
|
@ -251,9 +251,9 @@ type
|
||||
function GetEnumerator: TBreakLocationMapEnumerator;
|
||||
end;
|
||||
|
||||
{ TFpInternalBreakpointBase }
|
||||
{ TFpDbgBreakpoint }
|
||||
|
||||
TFpInternalBreakpointBase = class(TObject)
|
||||
TFpDbgBreakpoint = class(TObject)
|
||||
public
|
||||
function Hit(const AThreadID: Integer; ABreakpointAddress: TDBGPtr): Boolean; virtual; abstract;
|
||||
procedure SetBreak; virtual; abstract;
|
||||
@ -262,7 +262,7 @@ type
|
||||
|
||||
{ TFpInternalBreakpoint }
|
||||
|
||||
TFpInternalBreakpoint = class(TFpInternalBreakpointBase)
|
||||
TFpInternalBreakpoint = class(TFpDbgBreakpoint)
|
||||
private
|
||||
FProcess: TDbgProcess;
|
||||
FLocation: TDBGPtrArray;
|
||||
@ -395,7 +395,7 @@ type
|
||||
function FindContext(AAddress: TDbgPtr): TFpDbgInfoContext; deprecated 'use FindContext(thread,stack)';
|
||||
function GetLib(const AHandle: THandle; out ALib: TDbgLibrary): Boolean;
|
||||
function GetThread(const AID: Integer; out AThread: TDbgThread): Boolean;
|
||||
procedure RemoveBreak(const ABreakPoint: TFpInternalBreakpoint);
|
||||
procedure RemoveBreak(const ABreakPoint: TFpDbgBreakpoint);
|
||||
procedure DoBeforeBreakLocationMapChange;
|
||||
function HasBreak(const ALocation: TDbgPtr): Boolean; // TODO: remove, once an address can have many breakpoints
|
||||
procedure RemoveThread(const AID: DWord);
|
||||
@ -1430,7 +1430,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDbgProcess.RemoveBreak(const ABreakPoint: TFpInternalBreakpoint);
|
||||
procedure TDbgProcess.RemoveBreak(const ABreakPoint: TFpDbgBreakpoint);
|
||||
begin
|
||||
if ABreakPoint=FCurrentBreakpoint then
|
||||
FCurrentBreakpoint := nil;
|
||||
|
@ -17,7 +17,7 @@ uses
|
||||
type
|
||||
|
||||
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;
|
||||
TOnProcessExitEvent = procedure(ExitCode: DWord) of object;
|
||||
|
||||
|
@ -83,7 +83,7 @@ type
|
||||
FDbgController: TDbgController;
|
||||
FFpDebugThread: TFpDebugThread;
|
||||
FQuickPause: boolean;
|
||||
FRaiseExceptionBreakpoint: TFpInternalBreakpoint;
|
||||
FRaiseExceptionBreakpoint: TFpDbgBreakpoint;
|
||||
FMemConverter: TFpDbgMemConvertorLittleEndian;
|
||||
FMemReader: TDbgMemReader;
|
||||
FMemManager: TFpDbgMemManager;
|
||||
@ -91,7 +91,7 @@ type
|
||||
{$ifdef linux}
|
||||
FCacheLine: cardinal;
|
||||
FCacheFileName: string;
|
||||
FCacheBreakpoint: TFpInternalBreakpoint;
|
||||
FCacheBreakpoint: TFpDbgBreakpoint;
|
||||
FCacheLocation: TDBGPtr;
|
||||
FCacheBoolean: boolean;
|
||||
FCachePointer: pointer;
|
||||
@ -103,7 +103,7 @@ type
|
||||
function SetSoftwareExceptionBreakpoint: boolean;
|
||||
procedure HandleSoftwareException(out AnExceptionLocation: TDBGLocationRec; var continue: boolean);
|
||||
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 FDbgControllerProcessExitEvent(AExitCode: DWord);
|
||||
procedure FDbgControllerExceptionEvent(var continue: boolean; const ExceptionClass, ExceptionMessage: string);
|
||||
@ -156,9 +156,9 @@ type
|
||||
procedure DoFreeBreakpoint;
|
||||
procedure DoFindContext;
|
||||
{$endif linux}
|
||||
function AddBreak(const ALocation: TDbgPtr): TFpInternalBreakpoint; overload;
|
||||
function AddBreak(const AFileName: String; ALine: Cardinal): TFpInternalBreakpoint; overload;
|
||||
procedure FreeBreakpoint(const ABreakpoint: TFpInternalBreakpoint);
|
||||
function AddBreak(const ALocation: TDbgPtr): TFpDbgBreakpoint; overload;
|
||||
function AddBreak(const AFileName: String; ALine: Cardinal): TFpDbgBreakpoint; overload;
|
||||
procedure FreeBreakpoint(const ABreakpoint: TFpDbgBreakpoint);
|
||||
function ReadData(const AAdress: TDbgPtr; const ASize: Cardinal; out AData): Boolean; inline;
|
||||
function ReadAddress(const AAdress: TDbgPtr; out AData: TDBGPtr): Boolean;
|
||||
procedure PrepareCallStackEntryList(AFrameRequired: Integer = -1; AThread: TDbgThread = nil); inline;
|
||||
@ -270,7 +270,7 @@ type
|
||||
private
|
||||
FSetBreakFlag: boolean;
|
||||
FResetBreakFlag: boolean;
|
||||
FInternalBreakpoint: FpDbgClasses.TFpInternalBreakpoint;
|
||||
FInternalBreakpoint: FpDbgClasses.TFpDbgBreakpoint;
|
||||
FIsSet: boolean;
|
||||
procedure SetBreak;
|
||||
procedure ResetBreak;
|
||||
@ -289,11 +289,11 @@ type
|
||||
FDelayedRemoveBreakpointList: TObjectList;
|
||||
protected
|
||||
procedure DoStateChange(const AOldState: TDBGState); override;
|
||||
procedure AddBreakpointToDelayedRemoveList(ABreakpoint: FpDbgClasses.TFpInternalBreakpoint);
|
||||
procedure AddBreakpointToDelayedRemoveList(ABreakpoint: FpDbgClasses.TFpDbgBreakpoint);
|
||||
public
|
||||
constructor Create(const ADebugger: TDebuggerIntf; const ABreakPointClass: TDBGBreakPointClass);
|
||||
destructor Destroy; override;
|
||||
function Find(AIntBReakpoint: FpDbgClasses.TFpInternalBreakpoint): TDBGBreakPoint;
|
||||
function Find(AIntBReakpoint: FpDbgClasses.TFpDbgBreakpoint): TDBGBreakPoint;
|
||||
end;
|
||||
|
||||
procedure Register;
|
||||
@ -814,7 +814,7 @@ end;
|
||||
|
||||
procedure TFPBreakpoints.DoStateChange(const AOldState: TDBGState);
|
||||
var
|
||||
ABrkPoint: FpDbgClasses.TFpInternalBreakpoint;
|
||||
ABrkPoint: FpDbgClasses.TFpDbgBreakpoint;
|
||||
i: Integer;
|
||||
begin
|
||||
inherited DoStateChange(AOldState);
|
||||
@ -824,7 +824,7 @@ begin
|
||||
debuglnEnter(DBG_BREAKPOINTS, ['TFPBreakpoints.DoStateChange REMOVE DELAYED']);
|
||||
for i := FDelayedRemoveBreakpointList.Count-1 downto 0 do
|
||||
begin
|
||||
ABrkPoint := FpDbgClasses.TFpInternalBreakpoint(FDelayedRemoveBreakpointList[i]);
|
||||
ABrkPoint := FpDbgClasses.TFpDbgBreakpoint(FDelayedRemoveBreakpointList[i]);
|
||||
TFpDebugDebugger(Debugger).FDbgController.CurrentProcess.RemoveBreak(ABrkPoint);
|
||||
TFpDebugDebugger(Debugger).FreeBreakpoint(ABrkPoint);
|
||||
ABrkPoint := nil;
|
||||
@ -835,7 +835,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFPBreakpoints.AddBreakpointToDelayedRemoveList(ABreakpoint: FpDbgClasses.TFpInternalBreakpoint);
|
||||
procedure TFPBreakpoints.AddBreakpointToDelayedRemoveList(ABreakpoint: FpDbgClasses.TFpDbgBreakpoint);
|
||||
begin
|
||||
FDelayedRemoveBreakpointList.Add(ABreakpoint);
|
||||
end;
|
||||
@ -852,7 +852,7 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TFPBreakpoints.Find(AIntBReakpoint: FpDbgClasses.TFpInternalBreakpoint): TDBGBreakPoint;
|
||||
function TFPBreakpoints.Find(AIntBReakpoint: FpDbgClasses.TFpDbgBreakpoint): TDBGBreakPoint;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
@ -1691,7 +1691,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFpDebugDebugger.FDbgControllerHitBreakpointEvent(
|
||||
var continue: boolean; const Breakpoint: TFpInternalBreakpoint);
|
||||
var continue: boolean; const Breakpoint: TFpDbgBreakpoint);
|
||||
var
|
||||
ABreakPoint: TDBGBreakPoint;
|
||||
ALocationAddr: TDBGLocationRec;
|
||||
@ -1738,7 +1738,7 @@ begin
|
||||
|
||||
if assigned(ABreakPoint) then
|
||||
ABreakPoint.Hit(&continue);
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else if FQuickPause then
|
||||
begin
|
||||
@ -1751,8 +1751,8 @@ begin
|
||||
ALocationAddr := GetLocation;
|
||||
|
||||
// if &continue then SetState(dsInternalPause) else
|
||||
SetState(dsPause);
|
||||
DoCurrent(ALocationAddr);
|
||||
SetState(dsPause);
|
||||
DoCurrent(ALocationAddr);
|
||||
|
||||
if &continue then begin
|
||||
// wait for any watches for Snapshots
|
||||
@ -2076,7 +2076,7 @@ end;
|
||||
{$endif linux}
|
||||
|
||||
function TFpDebugDebugger.AddBreak(const ALocation: TDbgPtr
|
||||
): TFpInternalBreakpoint;
|
||||
): TFpDbgBreakpoint;
|
||||
begin
|
||||
{$ifdef linux}
|
||||
FCacheLocation:=ALocation;
|
||||
@ -2088,7 +2088,7 @@ begin
|
||||
end;
|
||||
|
||||
function TFpDebugDebugger.AddBreak(const AFileName: String; ALine: Cardinal
|
||||
): TFpInternalBreakpoint;
|
||||
): TFpDbgBreakpoint;
|
||||
begin
|
||||
{$ifdef linux}
|
||||
FCacheFileName:=AFileName;
|
||||
@ -2101,7 +2101,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFpDebugDebugger.FreeBreakpoint(
|
||||
const ABreakpoint: TFpInternalBreakpoint);
|
||||
const ABreakpoint: TFpDbgBreakpoint);
|
||||
begin
|
||||
{$ifdef linux}
|
||||
if ABreakpoint = nil then exit;
|
||||
|
Loading…
Reference in New Issue
Block a user