Wiem, że to stare pytanie, ale robię to samo, a powyższe sugestie tak naprawdę nie pomagają. Instalacja Inno na przykład nie używa Synedit, używa edytora scintilla.
Również TPSCustomDebugExec.TranslatePositionEx() działa odwrotnie do tego, co jest potrzebne, podaje numer linii źródłowej z pozycji kodu wykonawczego.
Po pewnym okresie rozmyślania doszedłem do wniosku, że najprościej było dodać funkcję do kodu Pascalscript.
Nowa metoda zostanie dodana do klasy TPSCustomDebugExec w jednostce uPSdebugger.
function TPSCustomDebugExec.HasCode(Filename:string; LineNo:integer):boolean;
var i,j:integer; fi:PFunctionInfo; pt:TIfList; r:PPositionData;
begin
result:=false;
for i := 0 to FDebugDataForProcs.Count -1 do
begin
fi := FDebugDataForProcs[i];
pt := fi^.FPositionTable;
for j := 0 to pt.Count -1 do
begin
r:=pt[j];
result:= SameText(r^.FileName,Filename) and (r^.Row=LineNo);
if result then exit
end;
end;
end;
i zwrotna farby rynny w formularzu głównym edytora jest jak poniżej
procedure Teditor.PaintGutterGlyphs(ACanvas:TCanvas; AClip:TRect;
FirstLine, LastLine: integer);
var a,b:boolean; LH,LH2,X,Y,ImgIndex:integer;
begin
begin
FirstLine := Ed.RowToLine(FirstLine);
LastLine := Ed.RowToLine(LastLine);
X := 14;
LH := Ed.LineHeight;
LH2:=(LH-imglGutterGlyphs.Height) div 2;
while FirstLine <= LastLine do
begin
Y := LH2+LH*(Ed.LineToRow(FirstLine)-Ed.TopLine);
a:= ce.HasBreakPoint(ce.MainFileName,FirstLine);
b:= ce.Exec.HasCode(ce.MainFileName,FirstLine);
if Factiveline=FirstLine then
begin
if a then
ImgIndex := 2 //Blue arrow+red dot (breakpoint and execution point)
else
ImgIndex := 1; //Blue arrow (current line execution point)
end
else
if b then
begin
if a then
ImgIndex := 3 //Valid Breakpoint marker
else
ImgIndex := 0; //blue dot (has code)
end
else
begin
if a then
ImgIndex := 4 //Invalid breakpoint (No code on this line)
else
ImgIndex := -1; //Empty (No code for line)
end;
if ImgIndex >= 0 then
imglGutterGlyphs.Draw(ACanvas, X,Y,ImgIndex);
Inc(FirstLine);
end;
end;
end;
Synedit z numerami linii, kod kropki, pułapki, zakładki i punkty wykonanie wygląd jak na obrazku poniżej

To wygląda na interesujący projekt. Czy masz stronę dla niego? Czy udostępnisz źródło po uruchomieniu? –