[Lazarus] debugging parts of rtl from within lazarus

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Tue Mar 18 00:18:16 CET 2014


Marc Santhoff wrote:
> On Mo, 2014-03-17 at 17:22 +0000, Mark Morgan Lloyd wrote:
>> Marc Santhoff wrote:
>>> Hi,
>>>
>>> the FAQ gives instructions for debugging FCL from within lazarus.
>>>
>>> http://wiki.lazarus.freepascal.org/Lazarus_Faq#How_can_I_debug_FCL_components_from_packages_with_Lazarus
>>>
>>> Does this work for RTL packages as well?
>>>
>>> I need to set breakpoints inside serial.pp to see what data SerRead and
>>> SerWrite really get.
>> I'm fairly sure that I used Lazarus to set breakpoints in that unit, but 
>> when I was working on it I'd have been using a copy in my project's 
>> working directory.
>>
>> The patch at http://mantis.freepascal.org/view.php?id=18946 contains a 
>> test program that you might find useful, it's quirky but I used it 
>> heavily when testing the unit for Linux/Solaris/Windows.
> 
> Many thanks, it will be useful. :)
> 
> But some questions popping up:
> In the patch report you write SerFlush() is non-destructive and the new
> SerFlushInput/Output() are destructive.
> 
> What does this mean exactly?

I'm working from memory here. SerFlush() tried to do a sync(), which was 
considered to be pointless so is now marked deprecated. If you really do 
want to do this, then use SerSync().

SerDrain() waits until pending output has been sent i.e. is 
non-destructive, SerFlushInput() and SerFlushOutput() both clear buffers 
so are destructive.

Please note that these are basically very thin wrappers around the unix 
(Linux/Solaris) API.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list