MWE: = Splitted TDBGBreakpoint into TBaseBreakPoint, TIDEBreakpoint and

TDBGBreakPoint

git-svn-id: trunk@3108 -
This commit is contained in:
marc 2002-08-18 08:57:41 +00:00
parent 461b2bcf2b
commit 572d53ea04

View File

@ -118,7 +118,7 @@ type
TGDBMIBreakPoints = class(TDBGBreakPoints) TGDBMIBreakPoints = class(TDBGBreakPoints)
private private
protected protected
procedure DoStateChange; override; procedure DoDebuggerStateChange; override;
procedure SetBreakPoints; procedure SetBreakPoints;
public public
end; end;
@ -129,15 +129,17 @@ type
FBreakID: Integer; FBreakID: Integer;
procedure SetBreakPoint; procedure SetBreakPoint;
procedure ReleaseBreakPoint; procedure ReleaseBreakPoint;
procedure UpdateEnable;
procedure UpdateExpression;
protected protected
procedure DoActionChange; override;
procedure DoEnableChange; override; procedure DoEnableChange; override;
procedure DoExpressionChange; override; procedure DoExpressionChange; override;
procedure InitTargetStart; override;
procedure SetLocation(const ASource: String; const ALine: Integer); override; procedure SetLocation(const ASource: String; const ALine: Integer); override;
public public
constructor Create(ACollection: TCollection); override; constructor Create(ACollection: TCollection); override;
destructor Destroy; override; destructor Destroy; override;
procedure Hit; procedure Hit(var ACanContinue: Boolean);
end; end;
TGDBMILocals = class(TDBGLocals) TGDBMILocals = class(TDBGLocals)
@ -1058,6 +1060,7 @@ var
S, Reason: String; S, Reason: String;
BreakID: Integer; BreakID: Integer;
BreakPoint: TGDBMIBreakPoint; BreakPoint: TGDBMIBreakPoint;
CanContinue: Boolean;
begin begin
Result := True; Result := True;
List := CreateMIValueList(AParams); List := CreateMIValueList(AParams);
@ -1122,14 +1125,15 @@ begin
BreakPoint := TGDBMIBreakPoint(FindBreakpoint(BreakID)); BreakPoint := TGDBMIBreakPoint(FindBreakpoint(BreakID));
if BreakPoint <> nil if BreakPoint <> nil
then begin then begin
BreakPoint.Hit; CanContinue := False;
if (bpaStop in BreakPoint.Actions) BreakPoint.Hit(CanContinue);
if CanContinue
then begin then begin
SetState(dsPause); ExecuteCommand('-exec-continue', False);
ProcessFrame(List.Values['frame']);
end end
else begin else begin
ExecuteCommand('-exec-continue', False); SetState(dsPause);
ProcessFrame(List.Values['frame']);
end; end;
end; end;
Exit; Exit;
@ -1187,9 +1191,9 @@ end;
{ TGDBMIBreakPoints } { TGDBMIBreakPoints }
{ =========================================================================== } { =========================================================================== }
procedure TGDBMIBreakPoints.DoStateChange; procedure TGDBMIBreakPoints.DoDebuggerStateChange;
begin begin
inherited DoStateChange; inherited DoDebuggerStateChange;
if (Debugger <> nil) if (Debugger <> nil)
and (Debugger.State in [dsStop, dsPause]) and (Debugger.State in [dsStop, dsPause])
then SetBreakPoints; then SetBreakPoints;
@ -1224,36 +1228,28 @@ begin
inherited Destroy; inherited Destroy;
end; end;
procedure TGDBMIBreakPoint.DoActionChange;
begin
Changed(False);
end;
procedure TGDBMIBreakPoint.DoEnableChange; procedure TGDBMIBreakPoint.DoEnableChange;
const
CMD: array[Boolean] of String = ('disable', 'enable');
begin begin
if (FBreakID = 0) UpdateEnable;
or (Debugger = nil) inherited;
then Exit;
TGDBMIDebugger(Debugger).ExecuteCommand('-break-%s %d',
[CMD[Enabled], FBreakID], False);
Changed(false);
end; end;
procedure TGDBMIBreakPoint.DoExpressionChange; procedure TGDBMIBreakPoint.DoExpressionChange;
begin begin
Changed(False); UpdateExpression;
inherited;
end; end;
procedure TGDBMIBreakPoint.Hit; procedure TGDBMIBreakPoint.Hit(var ACanContinue: Boolean);
begin begin
SetHitCount(HitCount + 1); DoHit(HitCount + 1, ACanContinue);
if bpaEnableGroup in Actions end;
then EnableGroups;
if bpaDisableGroup in Actions procedure TGDBMIBreakPoint.InitTargetStart;
then DisableGroups; begin
inherited InitTargetStart;
UpdateExpression;
UpdateEnable;
end; end;
procedure TGDBMIBreakPoint.SetBreakpoint; procedure TGDBMIBreakPoint.SetBreakpoint;
@ -1309,6 +1305,22 @@ begin
then SetBreakpoint; then SetBreakpoint;
end; end;
procedure TGDBMIBreakPoint.UpdateEnable;
const
CMD: array[Boolean] of String = ('disable', 'enable');
begin
if (FBreakID = 0)
or (Debugger = nil)
then Exit;
TGDBMIDebugger(Debugger).ExecuteCommand('-break-%s %d',
[CMD[Enabled], FBreakID], False);
end;
procedure TGDBMIBreakPoint.UpdateExpression;
begin
end;
{ =========================================================================== } { =========================================================================== }
{ TGDBMILocals } { TGDBMILocals }
{ =========================================================================== } { =========================================================================== }
@ -1851,6 +1863,10 @@ end;
end. end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.23 2003/06/03 01:35:40 marc
MWE: = Splitted TDBGBreakpoint into TBaseBreakPoint, TIDEBreakpoint and
TDBGBreakPoint
Revision 1.22 2003/06/02 21:37:30 mattias Revision 1.22 2003/06/02 21:37:30 mattias
fixed debugger stop fixed debugger stop