[Lazarus] LCLProc.dbgMemStream

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Oct 27 12:05:41 CEST 2011


This procedure behaves a bit strange.

The dump starts at the current position, the stream position moves to 
the end of the dumped range. The procedure also may provide an incorrect 
dump, when the starting position is not at the begin of the stream, and 
less bytes than expected are read (Position+Count > Size). I'd expect 
that most of such dumps are empty.

Even if this is only a debug feature, it should not modify the stream 
position. It looks as if the stream should be dumped starting at 
position zero.

I'd suggest to remember the current stream position and to restore it on 
exit, and optionally accept a start position for the dump (default may 
be zero).

It also may be a good idea to format the output into multiple lines, of 
a maximal length - as with dbgMemRange. The default Width of dbgMemRange 
should have an reasonable value, e.g. 16 instead of zero.

DoDi





More information about the Lazarus mailing list