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,aa54332c298ad7a7 X-Google-Attributes: gid103376,public From: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby) Subject: Debugging in Ada 95 Date: 1996/03/18 Message-ID: <4xspf6871b.fsf_-_@leibniz.enst-bretagne.fr>#1/1 X-Deja-AN: 143676792 distribution: world sender: guerby@leibniz.enst-bretagne.fr references: content-type: text/plain; charset=US-ASCII organization: Telecom Bretagne mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-03-18T00:00:00+00:00 List-Id: [thread renamed] Robert I. Eachus writes : Unfortunately, when I really need a debugger, what I find myself : looking for is the previous values of things. With a trace file, print : previous value is an implementable, although potentially expensive, : feature. ;-) : : Yes, it is more work, but you probably have no idea how USEFUL it : is to be able to back up the state of the computation. This is : especially true if what you are trying to debug is a rare exception or : the like. Some day, someone is going to build a debugger that can do : that. In the meantime I struggle along with trace files and logic : analyzers. : : I'm not knocking the idea of making the 'IMAGE attribute more : widely available. After all the widening that took place in Ada 95 is : very nice, it wouldn't have been that hard to go the whole way. The "easy" workaround is to declare when possible a Set_X each state variable. For example, while developping a simple ray tracer, we got an Constraint_Error on a few points, and so we used a : (gdb) call Set_Ray (R, (X, Y)) (gdb) ... step inside the Ray_Color function with the guessed values of X, Y (the black spot on our image ;-). GDB is good at dumping the record values in a nice format (not for tagged objects in all cases though), so you don't have to define anything for "image" except for recursive data structures (no tool will do that for you in all cases - circular structures). : Robert I. Eachus -- -- 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)