Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3494330
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:59:35+00:00 2026-05-18T11:59:35+00:00

This must be a Delphi bug… I have a unit which is the basis

  • 0

This must be a Delphi bug…

I have a unit which is the basis of my persistance framework. In that unit I have a base class for all my domain objects, a list class and a generic list class.

Just recently I noticed that when I step into the unit when debugging, execution will jump to a point a little further down in the file than it should… Maybe four or five lines. Re-ordering the file makes no difference. The code would also generate access violations, but only when I debugged it.

I cast about trying to find the reason for this… Several things came to mind, like some code injection screwing with the debugger (eg this logitec webcam driver bug), or the debug info being out of sync with my unit source (eg the dcu was being pulled from some old source).

In the end I fired up a VM with a clean Windows + Delphi install, grabbed only what I needed to test the unit, and I created a small DUnit project to test it. Same problem.

Then I started removing things from the unit one at a time till it worked. The only thing that made any difference was when I removed the generic list class.

Has anyone else seen this problem? Does anyone know how to get around it?

Thanks in advance,

N@

Update: Adding the generic back into the unit makes the problem come back, so it’s not a problem of stale DCUs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:59:36+00:00Added an answer on May 18, 2026 at 11:59 am

    In the end, the only solution that I could find that worked was to move the generic list out of the Unit.

    Update 2011-08-03 To better flesh out my solution:

    I had my generic list base class defined in my Domain unit with my base TDomainObject class and a non-generic version.

    To fix the problem, I moved the generic into a second Domain.Generics unit which resolved the problem for me.

    So:

    unit Domain;
    
    interface 
    
    type
      TDomainObject = class
        //blah de blah
      end;
    
      TDomainObjectList = class (TDomainObject)
        //more stuff
      end;
    
      TDomainListEnumerator = class
        //etc
      end;
    

    And:

    unit Domain.Generics;
    
    interface
    
    type
    
      TDomainObjectList<T: TDomainObject> = class (TDomainObjectList)
        //stuff
      public
        property Items[AIndex: integer]: T read GetItem write SetItem;
    
        type
          TEnumerator = class (TDomainListEnumerator)
          public
            function GetCurrent: T;
            property Current: T read GetCurrent;
          end;
    
      public
        function GetEnumerator: TEnumerator;
    
      end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.