Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-10

LCLProc.dbgMemStream

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Hans-Peter Diettrich

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

Reply by email