mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 19:49:16 +02:00
codetools: debugging
git-svn-id: trunk@31133 -
This commit is contained in:
parent
23249c0b48
commit
c7374d6077
@ -460,6 +460,7 @@ type
|
|||||||
// 1=CursorPos beyond scanned code
|
// 1=CursorPos beyond scanned code
|
||||||
function CleanedPosToCursor(ACleanedPos: integer; var ACursorPos: integer;
|
function CleanedPosToCursor(ACleanedPos: integer; var ACursorPos: integer;
|
||||||
var ACode: Pointer): boolean;
|
var ACode: Pointer): boolean;
|
||||||
|
function CleanedPosToStr(ACleanedPos: integer): string;
|
||||||
function LastErrorIsInFrontOfCleanedPos(ACleanedPos: integer): boolean;
|
function LastErrorIsInFrontOfCleanedPos(ACleanedPos: integer): boolean;
|
||||||
procedure RaiseLastErrorIfInFrontOfCleanedPos(ACleanedPos: integer);
|
procedure RaiseLastErrorIfInFrontOfCleanedPos(ACleanedPos: integer);
|
||||||
|
|
||||||
@ -3714,6 +3715,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TLinkScanner.CleanedPosToStr(ACleanedPos: integer): string;
|
||||||
|
var
|
||||||
|
p: integer;
|
||||||
|
ACode: Pointer;
|
||||||
|
begin
|
||||||
|
if CleanedPosToCursor(ACleanedPos,p,ACode) then begin
|
||||||
|
Result:=TSourceLog(ACode).AbsoluteToLineColStr(p);
|
||||||
|
end else begin
|
||||||
|
Result:='p='+IntToStr(ACleanedPos)+',y=?,x=?';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TLinkScanner.WholeRangeIsWritable(CleanStartPos, CleanEndPos: integer;
|
function TLinkScanner.WholeRangeIsWritable(CleanStartPos, CleanEndPos: integer;
|
||||||
ErrorOnFail: boolean): boolean;
|
ErrorOnFail: boolean): boolean;
|
||||||
|
|
||||||
|
@ -578,14 +578,17 @@ var
|
|||||||
IsDirectChange: boolean;
|
IsDirectChange: boolean;
|
||||||
IntersectionEntry: TSourceChangeCacheEntry;
|
IntersectionEntry: TSourceChangeCacheEntry;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
{$IFDEF VerboseSrcChanger}
|
{$IFDEF VerboseSrcChanger}
|
||||||
DebugLn('TSourceChangeCache.ReplaceEx FrontGap=',dbgs(FrontGap),
|
DebugLn('TSourceChangeCache.ReplaceEx FrontGap=',dbgs(FrontGap),
|
||||||
' AfterGap=',dbgs(AfterGap),' CleanPos=',dbgs(FromPos),'-',dbgs(ToPos),
|
' AfterGap=',dbgs(AfterGap),' Text="',Text,'"');
|
||||||
' Text="',Text,'"');
|
|
||||||
if DirectCode<>nil then
|
if DirectCode<>nil then
|
||||||
DebugLn(' DirectCode=',DirectCode.Filename,' DirectPos=',dbgs(FromDirectPos),'-',dbgs(ToDirectPos),' Src=(~',dbgstr(copy(DirectCode.Source,FromDirectPos,ToDirectPos-FromDirectPos)),'~)')
|
DebugLn(' DirectCode=',DirectCode.Filename,' DirectPos=',DirectCode.AbsoluteToLineColStr(FromDirectPos),'-',DirectCode.AbsoluteToLineColStr(ToDirectPos),' Src=(~',dbgstr(copy(DirectCode.Source,FromDirectPos,ToDirectPos-FromDirectPos)),'~)')
|
||||||
else if ToPos>FromPos then
|
else begin
|
||||||
|
debugln([' CleanPos=',MainScanner.CleanedPosToStr(FromPos),'-',MainScanner.CleanedPosToStr(ToPos)]);
|
||||||
|
if ToPos>FromPos then
|
||||||
debugln([' DeleteCode=(~',dbgstr(copy(MainScanner.Src,FromPos,ToPos-FromPos)),'~)']);
|
debugln([' DeleteCode=(~',dbgstr(copy(MainScanner.Src,FromPos,ToPos-FromPos)),'~)']);
|
||||||
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Result:=false;
|
Result:=false;
|
||||||
IsDirectChange:=DirectCode<>nil;
|
IsDirectChange:=DirectCode<>nil;
|
||||||
|
@ -157,6 +157,7 @@ type
|
|||||||
procedure AbsoluteToLineCol(Position: integer; out Line, Column: integer);
|
procedure AbsoluteToLineCol(Position: integer; out Line, Column: integer);
|
||||||
function LineColIsOutside(Line, Column: integer): boolean;
|
function LineColIsOutside(Line, Column: integer): boolean;
|
||||||
function LineColIsSpace(Line, Column: integer): boolean;
|
function LineColIsSpace(Line, Column: integer): boolean;
|
||||||
|
function AbsoluteToLineColStr(Position: integer): string;
|
||||||
procedure Insert(Pos: integer; const Txt: string);
|
procedure Insert(Pos: integer; const Txt: string);
|
||||||
procedure Delete(Pos, Len: integer);
|
procedure Delete(Pos, Len: integer);
|
||||||
procedure Replace(Pos, Len: integer; const Txt: string);
|
procedure Replace(Pos, Len: integer; const Txt: string);
|
||||||
@ -796,6 +797,15 @@ begin
|
|||||||
if (Column>1) and (p[Column-2]>' ') then exit(false);
|
if (Column>1) and (p[Column-2]>' ') then exit(false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSourceLog.AbsoluteToLineColStr(Position: integer): string;
|
||||||
|
var
|
||||||
|
Line: integer;
|
||||||
|
Column: integer;
|
||||||
|
begin
|
||||||
|
AbsoluteToLineCol(Position,Line,Column);
|
||||||
|
Result:='p='+IntToStr(Position)+',y='+IntToStr(Line)+',x='+IntToStr(Column);
|
||||||
|
end;
|
||||||
|
|
||||||
function TSourceLog.LoadFromFile(const Filename: string): boolean;
|
function TSourceLog.LoadFromFile(const Filename: string): boolean;
|
||||||
var
|
var
|
||||||
s: string;
|
s: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user