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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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 19:59:24 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: debugging tool? Date: 22 Feb 2004 22:54:47 -0500 Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1077508512 76821 212.85.156.195 (23 Feb 2004 03:55:12 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Mon, 23 Feb 2004 03:55:12 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:5743 Date: 2004-02-22T22:54:47-05:00 tmoran@acm.org writes: > So maybe the question becomes: is it safe to access > simple things like booleans after they've been finalized/de-elaborated? That depends on why Finalize got run. If it was in response to a call to Unchecked_Deallocation, and the memory really was deallocated, then it is not safe. But then you have a dangling pointer problem, for which there are tools. Hmm. In your example, Helper_Object was declared in a package body, and Main_Object in the main program. The compiler decided to finalize objects in the package body before objects in the main program. Hmm. ARM 7.6.1 says the objects declared in the main program should have been finalized before objects declared in packages. So this looks like a compiler bug. However, Annotated ARM 7.6.1 11.g says: Implementation Note: An implementation has to ensure that the storage for an object is not reclaimed when references to the object are still possible (unless, of course, the user explicitly requests reclamation via an instance of Unchecked_Deallocation). This implies, in general, that objects cannot be deallocated one by one as they are finalized; a subsequent finalization might reference an object that has been finalized, and that object had better be in its (well-defined) finalized state. That says it is safe to put a Finalized flag in Helper_Type, as long as you are not using Unchecked_Deallocation. -- -- Stephe