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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,80e74153f40106ab X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-05 07:22:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news2.telebyte.nl!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Weird controlled behavior - Gnat 3.15p NT Date: Thu, 04 Sep 2003 17:40:14 +0200 Organization: AdaCL Message-ID: <40875687.0LorXooTe4@linux1.krischik.com> References: <5d6fdb61.0309040725.3403aa29@posting.google.com> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1062771671 00 30046 vbNjVeFXS-AUIj 030905 14:21:11 X-Complaints-To: usenet-abuse@t-online.de X-ID: TJ10r0ZBQePbWz1+roTqB3B2EPOsS+Di16vFob5KQAnji+52d6ODwT User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.lang.ada:42178 Date: 2003-09-04T17:40:14+02:00 List-Id: Jano wrote: > Hello, > > see the following type declarations and lines of code: > > type Object is abstract new > Finalization.Controlled with null record; > type Object_access is access all Object'Class; > > procedure Initialize (This : in out Object) is > begin > Trace.Log ("====>"); > end Initialize; Try to add: procedure Adjust (This : in out Object) is begin Trace.Log ("<===>"); end Adjust; and Test again. > procedure Finalize (This : in out Object) is > begin > Trace.Log ("<===="); > end Finalize; > > declare > -- THIS LINE IS THE RELEVANT ONE. > Thing : Object_access := > new Object'Class'(Object'Class'Input (Stream)); > begin > null; > end; > > Ok, running normally or stepping with GVD when the line with the > stream reading is executed I get the following log: > > ====> > <==== > <==== > <==== > > Compiled with -O2 and without it if that means something. Consistently > with each object in the stream. > > Now, I would assume that no Finalization could happen without a > corresponding Initialization, so is this normal? Is something wrong in > that read way? Yes, types may be Adjusted without Initialization. Has been (and still is) a major headache in the design of AdaCL.Trace (http://adacl.sourceforge.net/html/______Include__AdaCL-Trace__adb.htm). With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com