From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,836e7962fed7281b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-22 17:21:00 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!wn53feed!worldnet.att.net!attbi_s02.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: debugging tool? References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 67.161.24.134 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s02 1077499256 67.161.24.134 (Mon, 23 Feb 2004 01:20:56 GMT) NNTP-Posting-Date: Mon, 23 Feb 2004 01:20:56 GMT Organization: Comcast Online Date: Mon, 23 Feb 2004 01:21:00 GMT Xref: archiver1.google.com comp.lang.ada:5740 Date: 2004-02-23T01:21:00+00:00 List-Id: > Right. So put in a flag Object.Finalized, and check Object.Finalized > in _every_ operation on Object. Raise an exception, or silently do > nothing, your choice. > > Main_Object : Main_Object_Type; -- Controlled type > > Helper_Object : Helper_Object_Type; -- also Controlled By "Object" here you must mean Main_Object_Type, right? So type Main_Object_Type is new Ada.Finalization.Controlled with record Helper_Finalized : Boolean ... That's great for future development, but I'm look for something to automatically examine a large body of existing code. Often Main_Object_Type doesn't know much at all about Helper_Object_Type, and may well have been coded long before someone added a helper type. (eg, Helper_Type keeps a usage count of Main_Object_Type's and does something when they've all gone away. Even if Helper_Type is a simple integer, it's questionable to access it after it's de-elaborated=finalized). In general, I'd like a tool (if not the compiler) to catch non-obvious errors like this.