Hello,
i found a bug in cnDebug.pas AddTimeDesc at line 1215
here there is an Ansiconversion from the wrong stringvariable
function TCnDebugger.AddTimeDesc(const ATag: string): PCnTimeDesc;
var
ADesc: PCnTimeDesc;
Len: Integer;
TTag: AnsiString;
begin
New(ADesc);
FillChar(ADesc^, SizeOf(TCnTimeDesc), 0);
TTag := AnsiString(TTag);
Len := Length(TTag);
if Len > CnMaxTagLength then
Len := CnMaxTagLength;
Move(PAnsiChar(TTag)^, ADesc^.Tag, Len);
FTimes.Add(ADesc);
Result := ADesc;
end;
the correct code is
function TCnDebugger.AddTimeDesc(const ATag: string): PCnTimeDesc;
var
ADesc: PCnTimeDesc;
Len: Integer;
TTag: AnsiString;
begin
New(ADesc);
FillChar(ADesc^, SizeOf(TCnTimeDesc), 0);
TTag := AnsiString(ATag); // <--- here the ATag and not TTag string to convert
Len := Length(TTag);
if Len > CnMaxTagLength then
Len := CnMaxTagLength;
Move(PAnsiChar(TTag)^, ADesc^.Tag, Len);
FTimes.Add(ADesc);
Result := ADesc;
end;
Greetings
MrOuzo