[Lazarus] Compiling/linking/debugging package with generics

R0b0t1 r030t1 at gmail.com
Tue Nov 28 17:46:01 CET 2017

Apologies for the additional post:

On Tue, Nov 28, 2017 at 10:44 AM, R0b0t1 <r030t1 at gmail.com> wrote:
> Hello,
> On Mon, Nov 27, 2017 at 12:15 PM, Donald Ziesig via Lazarus
> <lazarus at lists.lazarus-ide.org> wrote:
>> Hi All!
>> I have been having a problem for a long, long time when developing/debugging
>> code which is included in a package and which contains generics.
>> It took me years :'(, but I finally figured out what I was doing so that I
>> could cause the issue to appear consistently. :-[
>> My usual debugging process is:
>> Edit the library code
>> Compile/Run
>> Debug.
>> My current insight is:
>> What would happen was that changes made to the library code would compile,
>> but not be included in the code which specializes the generic item.  When I
>> entered the debugger, I could see the newly changed code, but
>> single-stepping ignored my changes.  If I let the program run without
>> debugging, the resulting behavior was the same as it was before the edit.
>> I have a work around for this (when I remember to use it):
>> Edit the library code
>> Compile the package
>> Use Run | Cleanup and build ...
>> Debug
>> TL;DR   Library packages which declare generics do compile, but do not get
>> included in the code that specializes them unless I "Cleanup and build" the
>> whole program.  (Workable, but much slower than programs without generics).
>> I searched the bug tracker, but did not see anything resembling this
>> problem.  I would submit a bug report but I'm not sure whether this is an
>> IDE problem, a package problem or a compiler/linker problem.  Would someone
>> more familiar with this part of the architecture give me pointers?
> I think this may be a bug, but I do not think it has to do with
> generics or packages. I encountered a very similar issue with a
> project I help maintain, where I fixed some issue in a unit but that
> unit was not automatically recompiled after being changed. I had to
> clean and rebuild the project. As you say, this is not extremely
> expedient.

To be clear, for some reason most of the time the unit (and every
other unit) was rebuilding properly, but one time it didn't. Perhaps
it is a linking issue?


More information about the Lazarus mailing list