From 7f5de6e25457ff0b1fa623dc342eaa08761e0771 Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 16 Dec 2002 15:15:40 +0000 Subject: [PATCH] * Added TBreakpointCollection.FindBreakpointAt method --- ide/fpdebug.pas | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ide/fpdebug.pas b/ide/fpdebug.pas index 1b1db555b6..f07186f7bf 100644 --- a/ide/fpdebug.pas +++ b/ide/fpdebug.pas @@ -121,6 +121,7 @@ type function ToggleFileLine(FileName: String;LineNr : Longint) : boolean; procedure Update; procedure ShowBreakpoints(W : PFPWindow); + function FindBreakpointAt(Editor : PSourceEditor; Line : longint) : PBreakpoint; procedure AdaptBreakpoints(Editor : PSourceEditor; Pos, Change : longint); procedure ShowAllBreakpoints; end; @@ -1716,6 +1717,22 @@ begin end; end; +function TBreakpointCollection.FindBreakpointAt(Editor : PSourceEditor; Line : longint) : PBreakpoint; + + function IsAtLine(P : PBreakpoint) : boolean;{$ifndef FPC}far;{$endif} + begin + If assigned(P^.FileName) and + (OSFileName(FExpand(P^.FileName^))=OSFileName(FExpand(Editor^.FileName))) and + (Line=P^.Line) then + IsAtLine:=true + else + IsAtLine:=false; + end; + +begin + FindBreakpointAt:=FirstThat(@IsAtLine); +end; + procedure TBreakpointCollection.ShowAllBreakpoints; procedure SetInSource(P : PBreakpoint);{$ifndef FPC}far;{$endif} @@ -3557,7 +3574,10 @@ end. { $Log$ - Revision 1.41 2002-12-16 09:05:28 pierre + Revision 1.42 2002-12-16 15:15:40 pierre + * Added TBreakpointCollection.FindBreakpointAt method + + Revision 1.41 2002/12/16 09:05:28 pierre * sanity ceck in ToggleFileLine method Revision 1.40 2002/02/09 02:04:46 pierre