나는 이것이 오래된 질문이라는 것을 알고 있지만 나는 똑같은 일을하고 있으며 위의 제안은 도움이되지 않는다. Inno setup은 Synedit을 사용하지 않고, scintilla 편집기를 사용합니다.
또한 TPSCustomDebugExec.TranslatePositionEx()는 원하는 것과 반대로 런타임 코드 위치에서 소스 행 번호를 제공합니다.
필자는 얼마 동안 생각해 보았을 때 가장 쉬운 방법은 Pascalscript 코드에 함수를 추가하는 것이 었습니다.
새 메소드가 uPSdebugger 유닛의 TPSCustomDebugExec 클래스에 추가됩니다.
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;
메인 에디터 형태로 페인트 제본 용 콜백
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 다음과 같다
이것은 흥미로운 프로젝트처럼 보입니다. 그것을위한 사이트가 있습니까? 일단 소스를 작동 시키면 소스를 사용할 수있게할까요? –