[Lazarus] Multilog exception tracing
Bogusław Brandys
brandys at o2.pl
Tue Apr 14 18:37:53 CEST 2009
Bogusław Brandys pisze:
> Hi,
>
> I found a bug in multilog code used by SendException. Exception was no
> correctly send with stack trace (no source line informations)
> The problem in my case may be due to encoding,I used example attached to
> multilog package (encoding UTF8) while multilog using is at CP1250 in my
> case.
>
> Anyway,changing AStream.Write into AStream.WriteBuffer resolved problem
>
>
> Look at code below:
>
> procedure TLogger.SendBuffer(AMsgType: Integer; const AText: String;
> var Buffer; Count: LongWord);
> var
> AStream: TStream;
> begin
> if Count > 0 then
> begin
> AStream:=TMemoryStream.Create;
> AStream.WriteBuffer(Buffer,Count);
> // AStream.Write(Buffer,Count);
> end
> else
> AStream:=nil;
> //SendStream free AStream
> SendStream(AMsgType,AText,AStream);
> end;
>
>
> Best regards
> Boguslaw
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
I see that problem is deeper. It has a source in problem of avoiding
infinite recursion while generating stack trace.
The nasty result is that you cannot generate more then one stack trace
per program execution ! I mean stack trace with full source/line
information :-(
Problem lies inside lineinfo unit.
Any clues ?
Best regards
Boguslaw
More information about the Lazarus
mailing list