Xref: utzoo comp.object:2442 comp.lang.pascal:5261 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!dkuug!resam!andrew From: andrew@resam.dk (Leif Andrew Rump) Newsgroups: comp.object,comp.lang.pascal Subject: Re: Shouldn't debuggers be able to debug dynamic objects? Message-ID: <1991Jan28.100213.1822@resam.dk> Date: 28 Jan 91 10:02:13 GMT References: <1991Jan24.152256.24273@resam.dk> <1991Jan25.145947.16431@bellcore.bellcore.com> Distribution: comp Organization: RESAM Project Office, SAS, CPHML-V Lines: 43 In <1991Jan25.145947.16431@bellcore.bellcore.com> bytor@ctt.bellcore.com (Ross Huitt) writes: >In article <1991Jan24.152256.24273@resam.dk> andrew@resam.dk (Leif Andrew Rump) writes: >>I experienced a rather annoying feature in TurboPascal 5.5 (but I >>think the problem may exist in a lot of other (integrated) debuggers >>used to debug object oriented programmes. >>The program enclosed create two (2) dynamic objects: a square & a >>box. >>The first thing to notice is that the compiler only allow squareptr >>to be used as a general object for squares & boxes! Well I could >>accept that _IF_ the debugger (integrated & external (TD)) at least >>would notice when I create a box! But no - it only display the >>content of a square - the length has to be extracted manually!!! >> >...code deleted >> >When I _know_ which derived class a base class ptr is pointing to >and I want to inspect or display the object as a derived class, a cast >is usually sufficient to get the job done. With the Turbo products, >simply type in 'squareptr(general_object(1))' at the Display or >Evaluate prompts. I don't know for sure that the technique works with >Turbo Pascal or if this particular syntax is correct, but I do use the >technique with C++ frequently. But, but, but, ... Why can't the debugger that has _all_ the information do this job! The main reason for me to write this letter was that one of my programmes used a dynamic list of objects and if I was going to use the debugger to show me the content of for example the first three objects in a list a had to remember what type each object was and change casts accordingly - then (as I wrote in my original letter) I surely sill make mistakes and then the debugger only caused havoc!!! Leif Andrew Leif Andrew Rump, AmbraSoft A/S, Stroedamvej 50, DK-2100 Copenhagen OE, Denmark UUCP: andrew@ambra.dk, phone: +45 39 27 11 77 / Currently at Scandinavian Airline Systems =======/ UUCP: andrew@resam.dk, phone: +45 32 32 51 54 \ SAS, RESAM Project Office, CPHML-V, P.O.BOX 150, DK-2770 Kastrup, Denmark > > Read oe as: o / (slash) and OE as O / (slash) < <