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,80e74153f40106ab X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-04 12:05:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!skynet.be!skynet.be!fu-berlin.de!uni-berlin.de!68236-cm.able.ES!not-for-mail From: Jano Newsgroups: comp.lang.ada Subject: Re: Weird controlled behavior - Gnat 3.15p NT Date: Thu, 4 Sep 2003 21:03:35 +0200 Message-ID: References: <5d6fdb61.0309040725.3403aa29@posting.google.com> NNTP-Posting-Host: 68236-cm.able.es (212.97.168.236) X-Trace: news.uni-berlin.de 1062702353 17290796 212.97.168.236 (16 [49872]) X-Newsreader: MicroPlanet Gravity v2.50 Xref: archiver1.google.com comp.lang.ada:42151 Date: 2003-09-04T21:03:35+02:00 List-Id: Patrice Freydiere dice... > On Thu, 04 Sep 2003 08:25:41 +0000, 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; > > > > 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? > > > > Regards, > > > > A. Mosteo. > > > is it related to assign ?? > can you log assign call , for the controlled type ?? Assign isn't overloaded, but I'll try it to see what happens.