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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,16e3a8dd4f3ab3f3 X-Google-Attributes: gid103376,public From: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby) Subject: Re: Elaboration order Date: 1996/03/26 Message-ID: <4xspevde88.fsf@leibniz.enst-bretagne.fr>#1/1 X-Deja-AN: 144346929 distribution: world sender: guerby@leibniz.enst-bretagne.fr references: <314829CD.4FA9@lfwc.lockheed.com> content-type: text/plain; charset=US-ASCII organization: Telecom Bretagne mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-03-26T00:00:00+00:00 List-Id: Robert A Duff writes : : Robert Dewar wrote: : >pragma Preelaborate is an important feature of Ada 95, one that everyone : >should be throughly familiar with. : : Yes, and pragma Pure is useful, too. : : Unfortunately, I've had a great deal of trouble using Preelaborate and : Pure, because I always find myself wanting to put in some debugging : print-outs, and saying "with" of an I/O package poisons everything so I : can't use Preelab or Pure. And there's no telling when you're going to : need a debugging print out. And it's kind of a pain if you have to : *remove* a pragma Preelaborate during the process of finding one bug, : because that modification might introduce *another* bug, causing : confusion. Here is a simple solution to this kind of problem : package Pure_IO is pragma Pure; procedure Debug (Msg : in String); pragma Import (C, Debug); end Pure_IO; Then do the dirty work (body) in Ada (convention C) or C. I don't know if there's a pragma Import (Ada, xxx). GNAT seems to compile it, I haven't checked if Import (C, xxx) is legal in a Pure unit. : Gdb is not quite up to the point where I can use it all the time instead : of debugging print-outs. (Of course, reading one's code is usually a : better way of tracking down bugs, but not always.) It's true that the current GDB-GNAT has some weakpoints, but if you add to your code (instead of plenty ugly "with Text_IO; Put_Line ...") some "extra" procedures to set up complex data structures and to print them (just like in the GNAT code anyway) it works quite well (even for multiple partitions or multiple tasks if you know what you're doing). BTW report GDB problems according to the README file coming with the GDB patch, this will help improving it. : - Bob -- -- Laurent Guerby, student at Telecom Bretagne (France), Team Ada -- "Use the Source, Luke. The Source will be with you, always (GPL)" -- http://www-eleves.enst-bretagne.fr/~guerby/ (GATO Project) -- Try GNAT, the GNU Ada 95 compiler (ftp://cs.nyu.edu/pub/gnat)