[Lazarus] Compiling/linking/debugging package with generics

R0b0t1 r030t1 at gmail.com
Tue Nov 28 17:44:39 CET 2017


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

My apologies for not keeping more details, but I was quite happy to
have gotten it working at the time.


More information about the Lazarus mailing list