DBG: Accept different line endings (#10, #13, #10#13, #13#10) issue #0021834. Requires rev 37026 #9baa5f827c

git-svn-id: trunk@37027 -
This commit is contained in:
martin 2012-04-25 19:46:34 +00:00
parent 9baa5f827c
commit 0a35a31f1d

View File

@ -474,6 +474,7 @@ type
procedure DoBeforeState(const OldState: TDBGState); override;
procedure DoReadError; override;
procedure DoWriteError; override;
function LineEndPos(const s: string; out LineEndLen: integer): integer; override;
procedure DoThreadChanged;
property TargetPID: Integer read FTargetInfo.TargetPID;
property TargetPtrSize: Byte read FTargetInfo.TargetPtrSize;
@ -6294,6 +6295,24 @@ begin
then inherited DoWriteError;
end;
function TGDBMIDebugger.LineEndPos(const s: string; out LineEndLen: integer): integer;
var
l: Integer;
begin
Result := 1;
LineEndLen := 0;
l := Length(s);
while (Result <= l) and not(s[Result] in [#10, #13]) do inc(Result);
if (Result <= l) then begin
LineEndLen := 1;
if (Result < l) and (s[Result + 1] in [#10, #13]) and (s[Result] <> s[Result + 1]) then
LineEndLen := 2;
end
else
Result := 0;
end;
procedure TGDBMIDebugger.DoThreadChanged;
begin
TGDBMICallstack(CallStack).DoThreadChanged;