mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 09:19:32 +02:00
MWE: = Splitted TDBGBreakpoint into TBaseBreakPoint, TIDEBreakpoint and
TDBGBreakPoint git-svn-id: trunk@4226 -
This commit is contained in:
parent
2929675a0b
commit
134c587eef
@ -74,20 +74,20 @@ type
|
||||
procedure popDeleteAllClick(Sender: TObject);
|
||||
private
|
||||
FBaseDirectory: string;
|
||||
FBreakPoints: TDBGBreakPoints;
|
||||
FBreakpointsNotification: TDBGBreakPointsNotification;
|
||||
FBreakPoints: TIDEBreakPoints;
|
||||
FBreakpointsNotification: TIDEBreakPointsNotification;
|
||||
FStates: TBreakPointsDlgStates;
|
||||
procedure BreakPointAdd(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure BreakPointUpdate(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure BreakPointRemove(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure BreakPointAdd(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
procedure BreakPointUpdate(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
procedure BreakPointRemove(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
procedure SetBaseDirectory(const AValue: string);
|
||||
procedure SetBreakPoints(const AValue: TDBGBreakPoints);
|
||||
procedure SetBreakPoints(const AValue: TIDEBreakPoints);
|
||||
|
||||
procedure UpdateItem(const AnItem: TListItem;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
procedure UpdateAll;
|
||||
protected
|
||||
procedure DoEndUpdate; override;
|
||||
@ -98,14 +98,14 @@ type
|
||||
destructor Destroy; override;
|
||||
public
|
||||
property BaseDirectory: string read FBaseDirectory write SetBaseDirectory;
|
||||
property BreakPoints: TDBGBreakPoints read FBreakPoints write SetBreakPoints;
|
||||
property BreakPoints: TIDEBreakPoints read FBreakPoints write SetBreakPoints;
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
procedure TBreakPointsDlg.BreakPointAdd(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure TBreakPointsDlg.BreakPointAdd(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
var
|
||||
Item: TListItem;
|
||||
n: Integer;
|
||||
@ -122,8 +122,8 @@ begin
|
||||
UpdateItem(Item, ABreakPoint);
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.BreakPointUpdate(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure TBreakPointsDlg.BreakPointUpdate(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
var
|
||||
Item: TListItem;
|
||||
begin
|
||||
@ -141,8 +141,8 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.BreakPointRemove(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure TBreakPointsDlg.BreakPointRemove(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
begin
|
||||
lvBreakPoints.Items.FindData(ABreakpoint).Free;
|
||||
end;
|
||||
@ -154,7 +154,7 @@ begin
|
||||
UpdateAll;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.SetBreakPoints(const AValue: TDBGBreakPoints);
|
||||
procedure TBreakPointsDlg.SetBreakPoints(const AValue: TIDEBreakPoints);
|
||||
begin
|
||||
if FBreakPoints=AValue then exit;
|
||||
lvBreakPoints.Items.Clear;
|
||||
@ -171,7 +171,7 @@ constructor TBreakPointsDlg.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
Name:='BreakPointsDlg';
|
||||
FBreakpointsNotification := TDBGBreakPointsNotification.Create;
|
||||
FBreakpointsNotification := TIDEBreakPointsNotification.Create;
|
||||
FBreakpointsNotification.AddReference;
|
||||
FBreakpointsNotification.OnAdd := @BreakPointAdd;
|
||||
FBreakpointsNotification.OnUpdate := @BreakPointUpdate;
|
||||
@ -200,11 +200,11 @@ end;
|
||||
procedure TBreakPointsDlg.DoJumpToCurrentBreakPoint;
|
||||
var
|
||||
CurItem: TListItem;
|
||||
CurBreakPoint: TDBGBreakPoint;
|
||||
CurBreakPoint: TIDEBreakPoint;
|
||||
begin
|
||||
CurItem:=lvBreakPoints.Selected;
|
||||
if CurItem=nil then exit;
|
||||
CurBreakPoint:=TDBGBreakPoint(CurItem.Data);
|
||||
CurBreakPoint:=TIDEBreakPoint(CurItem.Data);
|
||||
DoJumpToCodePos(CurBreakPoint.Source,CurBreakPoint.Line,0);
|
||||
end;
|
||||
|
||||
@ -225,11 +225,11 @@ end;
|
||||
procedure TBreakPointsDlg.mnuPopupPopup(Sender: TObject);
|
||||
var
|
||||
Enable: Boolean;
|
||||
CurBreakPoint: TDBGBreakPoint;
|
||||
CurBreakPoint: TIDEBreakPoint;
|
||||
begin
|
||||
Enable := lvBreakPoints.Selected <> nil;
|
||||
if Enable then
|
||||
CurBreakPoint:=TDBGBreakPoint(lvBreakPoints.Selected.Data)
|
||||
CurBreakPoint:=TIDEBreakPoint(lvBreakPoints.Selected.Data)
|
||||
else
|
||||
CurBreakPoint:=nil;
|
||||
popProperties.Enabled := Enable;
|
||||
@ -255,17 +255,17 @@ var
|
||||
n: Integer;
|
||||
begin
|
||||
for n := lvBreakPoints.Items.Count - 1 downto 0 do
|
||||
TDBGBreakPoint(lvBreakPoints.Items[n].Data).Free;
|
||||
TIDEBreakPoint(lvBreakPoints.Items[n].Data).Free;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.popDeleteClick(Sender: TObject);
|
||||
var
|
||||
CurItem: TListItem;
|
||||
CurBreakPoint: TDBGBreakPoint;
|
||||
CurBreakPoint: TIDEBreakPoint;
|
||||
begin
|
||||
CurItem:=lvBreakPoints.Selected;
|
||||
if CurItem=nil then exit;
|
||||
CurBreakPoint:=TDBGBreakPoint(CurItem.Data);
|
||||
CurBreakPoint:=TIDEBreakPoint(CurItem.Data);
|
||||
if MessageDlg('Delete breakpoint?',
|
||||
'Delete breakpoint at'#13
|
||||
+'"'+CurBreakPoint.Source+'" line '+IntToStr(CurBreakPoint.Line)+'?',
|
||||
@ -283,7 +283,7 @@ begin
|
||||
begin
|
||||
Item := lvBreakPoints.Items[n];
|
||||
if Item.Data <> nil
|
||||
then TDBGBreakPoint(Item.Data).Enabled := False;
|
||||
then TIDEBreakPoint(Item.Data).Enabled := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -296,7 +296,7 @@ begin
|
||||
begin
|
||||
Item := lvBreakPoints.Items[n];
|
||||
if Item.Data <> nil
|
||||
then TDBGBreakPoint(Item.Data).Enabled := True;
|
||||
then TIDEBreakPoint(Item.Data).Enabled := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -306,7 +306,7 @@ var
|
||||
begin
|
||||
CurItem:=lvBreakPoints.Selected;
|
||||
if (CurItem=nil) then exit;
|
||||
TDBGBreakPoint(CurItem.Data).Enabled:=not TDBGBreakPoint(CurItem.Data).Enabled;
|
||||
TIDEBreakPoint(CurItem.Data).Enabled:=not TIDEBreakPoint(CurItem.Data).Enabled;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.popPropertiesClick(Sender: TObject);
|
||||
@ -320,9 +320,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.UpdateItem(const AnItem: TListItem;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
const
|
||||
DEBUG_ACTION: array[TDBGBreakPointAction] of string =
|
||||
DEBUG_ACTION: array[TIDEBreakPointAction] of string =
|
||||
('Break', 'Enable Group', 'Disable Group');
|
||||
|
||||
// enabled valid
|
||||
@ -331,7 +331,7 @@ const
|
||||
{Disabled} ('?', 'Disabled','Invalid'),
|
||||
{Endabled} ('?', 'Enabled', 'Invalid'));
|
||||
var
|
||||
Action: TDBGBreakPointAction;
|
||||
Action: TIDEBreakPointAction;
|
||||
S: String;
|
||||
Filename: String;
|
||||
begin
|
||||
@ -390,7 +390,7 @@ begin
|
||||
Exclude(FStates,bpdsItemsNeedUpdate);
|
||||
for i:=0 to lvBreakPoints.Items.Count-1 do begin
|
||||
CurItem:=lvBreakPoints.Items[i];
|
||||
UpdateItem(CurItem,TDBGBreakPoint(CurItem.Data));
|
||||
UpdateItem(CurItem,TIDEBreakPoint(CurItem.Data));
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -402,6 +402,10 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.17 2003/06/03 01:35:39 marc
|
||||
MWE: = Splitted TDBGBreakpoint into TBaseBreakPoint, TIDEBreakpoint and
|
||||
TDBGBreakPoint
|
||||
|
||||
Revision 1.16 2003/05/29 23:14:17 mattias
|
||||
implemented jump to code on double click for breakpoints and callstack dlg
|
||||
|
||||
|
1197
debugger/debugger.pp
1197
debugger/debugger.pp
File diff suppressed because it is too large
Load Diff
@ -46,7 +46,7 @@ type
|
||||
TBaseDebugManager = class(TComponent)
|
||||
protected
|
||||
FDestroying: boolean;
|
||||
FBreakPoints: TDBGBreakPoints;
|
||||
FBreakPoints: TIDEBreakPoints;
|
||||
function GetState: TDBGState; virtual; abstract;
|
||||
function GetCommands: TDBGCommands; virtual; abstract;
|
||||
public
|
||||
@ -81,7 +81,7 @@ type
|
||||
public
|
||||
property Commands: TDBGCommands read GetCommands; // All current available commands of the debugger
|
||||
property State: TDBGState read GetState; // The current state of the debugger
|
||||
property BreakPoints: TDBGBreakPoints read FBreakpoints;
|
||||
property BreakPoints: TIDEBreakPoints read FBreakpoints;
|
||||
property Destroying: boolean read FDestroying;
|
||||
end;
|
||||
|
||||
|
@ -83,13 +83,13 @@ type
|
||||
private
|
||||
FDebugger: TDebugger;
|
||||
FDebuggerUpdateLock: integer;
|
||||
FBreakpointsNotification: TDBGBreakPointsNotification;// Notification for
|
||||
FBreakpointsNotification: TIDEBreakPointsNotification;// Notification for
|
||||
// our BreakPoints
|
||||
|
||||
// When no debugger is created the IDE stores all debugger settings in its
|
||||
// own variables. When the debugger object is created these items point
|
||||
// to the corresponding items in the FDebugger object.
|
||||
FBreakPointGroups: TDBGBreakPointGroups;
|
||||
FBreakPointGroups: TIDEBreakPointGroups;
|
||||
FWatches: TDBGWatches;
|
||||
FDialogs: array[TDebugDialogType] of TDebuggerDlg;
|
||||
|
||||
@ -98,13 +98,13 @@ type
|
||||
FUserSourceFiles: TStringList;
|
||||
|
||||
// Breakpoint routines
|
||||
procedure BreakpointAdded(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure BreakpointRemoved(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure CreateSourceMarkForBreakPoint(const ABreakpoint: TDBGBreakPoint;
|
||||
procedure BreakpointAdded(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
procedure BreakpointRemoved(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
procedure CreateSourceMarkForBreakPoint(const ABreakpoint: TIDEBreakPoint;
|
||||
ASrcEdit: TSourceEditor);
|
||||
procedure GetSourceEditorForBreakPoint(const ABreakpoint: TDBGBreakPoint;
|
||||
procedure GetSourceEditorForBreakPoint(const ABreakpoint: TIDEBreakPoint;
|
||||
var ASrcEdit: TSourceEditor);
|
||||
|
||||
// Dialog routines
|
||||
@ -164,7 +164,7 @@ const
|
||||
);
|
||||
|
||||
type
|
||||
TManagedBreakPoint = class(TDBGBreakPoint)
|
||||
TManagedBreakPoint = class(TIDEBreakPoint)
|
||||
private
|
||||
FMaster: TDBGBreakPoint;
|
||||
FSourceMark: TSourceMark;
|
||||
@ -173,9 +173,9 @@ type
|
||||
procedure OnSourceMarkBeforeFree(Sender: TObject);
|
||||
protected
|
||||
procedure AssignTo(Dest: TPersistent); override;
|
||||
procedure DoChanged; override;
|
||||
function GetHitCount: Integer; override;
|
||||
function GetValid: TValidState; override;
|
||||
procedure SetActions(const AValue: TDBGBreakPointActions); override;
|
||||
procedure SetEnabled(const AValue: Boolean); override;
|
||||
procedure SetExpression(const AValue: String); override;
|
||||
procedure UpdateSourceMarkImage;
|
||||
@ -188,13 +188,10 @@ type
|
||||
property SourceMark: TSourceMark read FSourceMark write SetSourceMark;
|
||||
end;
|
||||
|
||||
TManagedBreakPoints = class(TDBGBreakPoints)
|
||||
TManagedBreakPoints = class(TIDEBreakPoints)
|
||||
private
|
||||
FMaster: TDBGBreakPoints;
|
||||
FMasterNotification: TDBGBreakPointsNotification;
|
||||
procedure SetMaster(const AValue: TDBGBreakPoints);
|
||||
procedure MasterUpdate(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
@ -206,65 +203,20 @@ type
|
||||
constructor TManagedBreakPoints.Create;
|
||||
begin
|
||||
FMaster := nil;
|
||||
FMasterNotification := TDBGBreakPointsNotification.Create;
|
||||
FMasterNotification.AddReference;
|
||||
FMasterNotification.OnUpdate := @MasterUpdate;
|
||||
|
||||
inherited Create(nil, TManagedBreakPoint);
|
||||
inherited Create(TManagedBreakPoint);
|
||||
end;
|
||||
|
||||
destructor TManagedBreakPoints.Destroy;
|
||||
begin
|
||||
FreeThenNil(FMasterNotification);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TManagedBreakPoints.MasterUpdate(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
|
||||
function FindItem: TManagedBreakPoint;
|
||||
var
|
||||
n: Integer;
|
||||
begin
|
||||
for n := 0 to Count - 1 do
|
||||
begin
|
||||
Result := TManagedBreakPoint(Items[n]);
|
||||
if Result.FMaster = ABreakPoint
|
||||
then Exit;
|
||||
end;
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
var
|
||||
bp: TManagedBreakPoint;
|
||||
begin
|
||||
if ABreakPoint = nil
|
||||
then begin
|
||||
Update(nil);
|
||||
end
|
||||
else begin
|
||||
bp := FindItem;
|
||||
writeln('TManagedBreakPoints.MasterUpdate B ',ABreakpoint.ClassName,' ',
|
||||
ABreakpoint.Source,' ',ABreakpoint.Line,' ',bp <> nil);
|
||||
if bp <> nil then begin
|
||||
bp.UpdateSourceMark;
|
||||
Update(bp);
|
||||
end else begin
|
||||
writeln('WARNING: TManagedBreakPoints.MasterUpdate unknown breakpoint: ',
|
||||
ABreakpoint.Source,' ',ABreakpoint.Line);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TManagedBreakPoints.SetMaster(const AValue: TDBGBreakPoints);
|
||||
var
|
||||
n: Integer;
|
||||
begin
|
||||
if FMaster = AValue then Exit;
|
||||
|
||||
if FMaster <> nil
|
||||
then FMaster.RemoveNotification(FMasterNotification);
|
||||
|
||||
FMaster := AValue;
|
||||
if FMaster = nil
|
||||
then begin
|
||||
@ -272,7 +224,6 @@ begin
|
||||
TManagedBreakPoint(Items[n]).ResetMaster;
|
||||
end
|
||||
else begin
|
||||
FMaster.AddNotification(FMasterNotification);
|
||||
FMaster.Assign(Self);
|
||||
end;
|
||||
end;
|
||||
@ -295,13 +246,12 @@ begin
|
||||
FSourceMark.IsBreakPoint:=true;
|
||||
FSourceMark.Line:=Line;
|
||||
FSourceMark.Visible:=true;
|
||||
UpdateSourceMarkImage;
|
||||
UpdateSourceMark;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TManagedBreakPoint.OnSourceMarkPositionChanged(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TManagedBreakPoint.OnSourceMarkBeforeFree(Sender: TObject);
|
||||
@ -312,11 +262,15 @@ end;
|
||||
procedure TManagedBreakPoint.AssignTo(Dest: TPersistent);
|
||||
begin
|
||||
inherited AssignTo(Dest);
|
||||
if TManagedBreakPoints(GetOwner).FMaster <> nil
|
||||
then FMaster := TDBGBreakpoint(Dest);
|
||||
if (TManagedBreakPoints(GetOwner).FMaster <> nil)
|
||||
and (Dest is TDBGBreakPoint)
|
||||
then begin
|
||||
FMaster := TDBGBreakPoint(Dest);
|
||||
FMaster.Slave := Self;
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TManagedBreakPoint.Create (ACollection: TCollection );
|
||||
constructor TManagedBreakPoint.Create(ACollection: TCollection);
|
||||
begin
|
||||
inherited Create(ACollection);
|
||||
FMaster := nil;
|
||||
@ -324,10 +278,24 @@ end;
|
||||
|
||||
destructor TManagedBreakPoint.Destroy;
|
||||
begin
|
||||
FreeAndNil(FMaster);
|
||||
if FMaster <> nil
|
||||
then begin
|
||||
FMaster.Slave := nil;
|
||||
FreeAndNil(FMaster);
|
||||
end;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TManagedBreakPoint.DoChanged;
|
||||
begin
|
||||
if (FMaster <> nil)
|
||||
and (FMaster.Slave = nil)
|
||||
then FMaster := nil;
|
||||
|
||||
inherited DoChanged;
|
||||
UpdateSourceMark;
|
||||
end;
|
||||
|
||||
function TManagedBreakPoint.GetHitCount: Integer;
|
||||
begin
|
||||
if FMaster = nil
|
||||
@ -345,22 +313,16 @@ end;
|
||||
procedure TManagedBreakPoint.ResetMaster;
|
||||
begin
|
||||
FMaster := nil;
|
||||
Changed(False);
|
||||
end;
|
||||
|
||||
procedure TManagedBreakPoint.SetActions(const AValue: TDBGBreakPointActions);
|
||||
begin
|
||||
if Actions=AValue then exit;
|
||||
inherited SetActions(AValue);
|
||||
if FMaster <> nil then FMaster.Actions := AValue;
|
||||
Changed;
|
||||
end;
|
||||
|
||||
procedure TManagedBreakPoint.SetEnabled(const AValue: Boolean);
|
||||
begin
|
||||
if Enabled=AValue then exit;
|
||||
if Enabled = AValue then exit;
|
||||
inherited SetEnabled(AValue);
|
||||
if FMaster <> nil then FMaster.Enabled := AValue;
|
||||
UpdateSourceMarkImage;
|
||||
// Handled by changed
|
||||
// UpdateSourceMarkImage;
|
||||
end;
|
||||
|
||||
procedure TManagedBreakPoint.SetExpression(const AValue: String);
|
||||
@ -797,13 +759,13 @@ begin
|
||||
|
||||
FDebugger := nil;
|
||||
FBreakPoints := TManagedBreakPoints.Create;
|
||||
FBreakpointsNotification := TDBGBreakPointsNotification.Create;
|
||||
FBreakpointsNotification := TIDEBreakPointsNotification.Create;
|
||||
FBreakpointsNotification.AddReference;
|
||||
FBreakpointsNotification.OnAdd := @BreakpointAdded;
|
||||
FBreakpointsNotification.OnRemove := @BreakpointRemoved;
|
||||
FBreakPoints.AddNotification(FBreakpointsNotification);
|
||||
|
||||
FBreakPointGroups := TDBGBreakPointGroups.Create;
|
||||
FBreakPointGroups := TIDEBreakPointGroups.Create;
|
||||
FWatches := TDBGWatches.Create(nil, TDBGWatch);
|
||||
|
||||
FUserSourceFiles := TStringList.Create;
|
||||
@ -824,22 +786,17 @@ begin
|
||||
|
||||
if FDebugger <> nil
|
||||
then begin
|
||||
//@@ if FDebugger.BreakPoints = FBreakPoints
|
||||
//@@ then FBreakPoints := nil;
|
||||
if FDebugger.BreakPointGroups = FBreakPointGroups
|
||||
then FBreakPointGroups := nil;
|
||||
if FDebugger.Watches = FWatches
|
||||
then FWatches := nil;
|
||||
|
||||
FreeThenNil(FDebugger);
|
||||
end
|
||||
else begin
|
||||
//@@ FreeThenNil(FBreakPoints);
|
||||
FreeThenNil(FBreakPointGroups);
|
||||
FreeThenNil(FWatches);
|
||||
end;
|
||||
|
||||
FreeThenNil(FBreakPoints);
|
||||
FreeThenNil(FBreakPointGroups);
|
||||
FreeThenNil(FBreakpointsNotification);
|
||||
FreeThenNil(FUserSourceFiles);
|
||||
|
||||
@ -888,16 +845,12 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TDebugManager.LoadProjectSpecificInfo(XMLConfig: TXMLConfig);
|
||||
begin
|
||||
if FDebugger=nil then begin
|
||||
FBreakPointGroups.LoadFromXMLConfig(XMLConfig,
|
||||
'Debugging/'+XMLBreakPointGroupsNode+'/');
|
||||
FBreakPoints.LoadFromXMLConfig(XMLConfig,'Debugging/'+XMLBreakPointsNode+'/',
|
||||
FBreakPointGroups.LoadFromXMLConfig(XMLConfig,
|
||||
'Debugging/'+XMLBreakPointGroupsNode+'/');
|
||||
FBreakPoints.LoadFromXMLConfig(XMLConfig,'Debugging/'+XMLBreakPointsNode+'/',
|
||||
@Project1.LongenFilename,
|
||||
@FBreakPointGroups.GetGroupByName);
|
||||
FWatches.LoadFromXMLConfig(XMLConfig,'Debugging/'+XMLWatchesNode+'/');
|
||||
end else begin
|
||||
FDebugger.LoadFromXMLConfig(XMLConfig,'Debugging/',@Project1.LongenFilename);
|
||||
end;
|
||||
FWatches.LoadFromXMLConfig(XMLConfig,'Debugging/'+XMLWatchesNode+'/');
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -907,22 +860,18 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TDebugManager.SaveProjectSpecificInfo(XMLConfig: TXMLConfig);
|
||||
begin
|
||||
if FDebugger=nil then begin
|
||||
FBreakPointGroups.SaveToXMLConfig(XMLConfig,
|
||||
'Debugging/'+XMLBreakPointGroupsNode+'/');
|
||||
FBreakPoints.SaveToXMLConfig(XMLConfig,'Debugging/'+XMLBreakPointsNode+'/',
|
||||
@Project1.ShortenFilename);
|
||||
FWatches.SaveToXMLConfig(XMLConfig,'Debugging/'+XMLWatchesNode+'/');
|
||||
end else begin
|
||||
FDebugger.SaveToXMLConfig(XMLConfig,'Debugging/',@Project1.ShortenFilename);
|
||||
end;
|
||||
FBreakPointGroups.SaveToXMLConfig(XMLConfig,
|
||||
'Debugging/'+XMLBreakPointGroupsNode+'/');
|
||||
FBreakPoints.SaveToXMLConfig(XMLConfig,'Debugging/'+XMLBreakPointsNode+'/',
|
||||
@Project1.ShortenFilename);
|
||||
FWatches.SaveToXMLConfig(XMLConfig,'Debugging/'+XMLWatchesNode+'/');
|
||||
end;
|
||||
|
||||
procedure TDebugManager.DoRestoreDebuggerMarks(AnUnitInfo: TUnitInfo);
|
||||
var
|
||||
ASrcEdit: TSourceEditor;
|
||||
i: Integer;
|
||||
CurBreakPoint: TDBGBreakPoint;
|
||||
CurBreakPoint: TIDEBreakPoint;
|
||||
SrcFilename: String;
|
||||
begin
|
||||
if (AnUnitInfo.EditorIndex<0) or Destroying then exit;
|
||||
@ -947,10 +896,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDebugManager.BreakpointAdded(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure TDebugManager.BreakpointAdded(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
var
|
||||
BP: TDBGBreakPoint;
|
||||
BP: TBaseBreakPoint;
|
||||
begin
|
||||
writeln('TDebugManager.BreakpointAdded A ',ABreakpoint.Source,' ',ABreakpoint.Line);
|
||||
ABreakpoint.InitialEnabled := True;
|
||||
@ -964,8 +913,8 @@ writeln('TDebugManager.BreakpointAdded A ',ABreakpoint.Source,' ',ABreakpoint.Li
|
||||
Project1.Modified := True;
|
||||
end;
|
||||
|
||||
procedure TDebugManager.BreakpointRemoved(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure TDebugManager.BreakpointRemoved(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
begin
|
||||
writeln('TDebugManager.BreakpointRemoved A ',ABreakpoint.Source,' ',ABreakpoint.Line,' ',TManagedBreakPoint(ABreakpoint).SourceMark<>nil);
|
||||
if TManagedBreakPoint(ABreakpoint).SourceMark<>nil then
|
||||
@ -975,7 +924,7 @@ writeln('TDebugManager.BreakpointRemoved A ',ABreakpoint.Source,' ',ABreakpoint.
|
||||
end;
|
||||
|
||||
procedure TDebugManager.CreateSourceMarkForBreakPoint(
|
||||
const ABreakpoint: TDBGBreakPoint; ASrcEdit: TSourceEditor);
|
||||
const ABreakpoint: TIDEBreakPoint; ASrcEdit: TSourceEditor);
|
||||
var
|
||||
ManagedBreakPoint: TManagedBreakPoint;
|
||||
NewSrcMark: TSourceMark;
|
||||
@ -995,7 +944,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TDebugManager.GetSourceEditorForBreakPoint(
|
||||
const ABreakpoint: TDBGBreakPoint; var ASrcEdit: TSourceEditor);
|
||||
const ABreakpoint: TIDEBreakPoint; var ASrcEdit: TSourceEditor);
|
||||
var
|
||||
Filename: String;
|
||||
begin
|
||||
@ -1023,7 +972,7 @@ end;
|
||||
|
||||
function TDebugManager.DoInitDebugger: TModalResult;
|
||||
var
|
||||
//@@ OldBreakpoints: TDBGBreakpoints;
|
||||
//@@ OldBreakpoints: TDBGBreakPoints;
|
||||
//@@ OldBreakPointGroups: TDBGBreakPointGroups;
|
||||
OldWatches: TDBGWatches;
|
||||
|
||||
@ -1043,7 +992,7 @@ var
|
||||
// copy the break point list without the group references
|
||||
//@@ OldBreakpoints := TDBGBreakpoints.Create(nil, TDBGBreakpoint);
|
||||
//@@ OldBreakpoints.Assign(FBreakPoints);
|
||||
|
||||
|
||||
// copy the groups and all group references
|
||||
//@@ OldBreakPointGroups := TDBGBreakPointGroups.Create;
|
||||
//@@ OldBreakPointGroups.Regroup(FBreakPointGroups,FBreakPoints,OldBreakPoints);
|
||||
@ -1300,7 +1249,7 @@ end;
|
||||
function TDebugManager.DoDeleteBreakPoint(const AFilename: string;
|
||||
ALine: integer): TModalResult;
|
||||
var
|
||||
OldBreakPoint: TDBGBreakPoint;
|
||||
OldBreakPoint: TIDEBreakPoint;
|
||||
begin
|
||||
Result:=DoBeginChangeDebugger;
|
||||
if Result<>mrOk then exit;
|
||||
@ -1314,17 +1263,17 @@ end;
|
||||
function TDebugManager.DoDeleteBreakPointAtMark(const ASourceMark: TSourceMark
|
||||
): TModalResult;
|
||||
var
|
||||
OldBreakPoint: TDBGBreakPoint;
|
||||
OldBreakPoint: TIDEBreakPoint;
|
||||
begin
|
||||
// consistency check
|
||||
if (ASourceMark=nil) or (not ASourceMark.IsBreakPoint)
|
||||
or (ASourceMark.Data=nil) or (not (ASourceMark.Data is TDBGBreakPoint)) then
|
||||
or (ASourceMark.Data=nil) or (not (ASourceMark.Data is TIDEBreakPoint)) then
|
||||
RaiseException('TDebugManager.DoDeleteBreakPointAtMark');
|
||||
|
||||
writeln('TDebugManager.DoDeleteBreakPointAtMark A ',ASourceMark.GetFilename,' ',ASourceMark.Line);
|
||||
Result:=DoBeginChangeDebugger;
|
||||
if Result<>mrOk then exit;
|
||||
OldBreakPoint:=TDBGBreakPoint(ASourceMark.Data);
|
||||
OldBreakPoint:=TIDEBreakPoint(ASourceMark.Data);
|
||||
writeln('TDebugManager.DoDeleteBreakPointAtMark B ',OldBreakPoint.ClassName,' ',OldBreakPoint.Source,' ',OldBreakPoint.Line);
|
||||
OldBreakPoint.Free;
|
||||
Project1.Modified:=true;
|
||||
@ -1396,6 +1345,10 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.41 2003/06/03 01:35:39 marc
|
||||
MWE: = Splitted TDBGBreakpoint into TBaseBreakPoint, TIDEBreakpoint and
|
||||
TDBGBreakPoint
|
||||
|
||||
Revision 1.40 2003/05/30 08:10:51 mattias
|
||||
added try except to Application.Run, message on changing debugger items during compile
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user