[comp.sys.mac.programmer] Debugging objects with SADE?

levin@bbn.com (Joel B Levin) (07/27/89)

I thought I'd like to learn a little more about OOP and object Pascal,
so I grabbed the appropriate sample from the Apple sample code set
(OOPTESample).  I am using MPW 3.0 with TML Pascal II v3.0 (on a
vanilla SE with 2.5 Mb).  It is an instructive example, does not use
MacApp (which I don't have), and compiles and links as-is.

It has a bug.  So, I recompiled it with the SADE symbol option, and
I'm having trouble getting anything useful.  I didn't see anything in
the (minimal) SADE documentation about dealing with Objects.  I can
place a breakpoint into the appropriate method, but I can't see how
one might refer to the fields of an object to see what's going on.  Of
course part of the problem may be that TML Pascal implements this
stuff differently from the way MPW Pascal does it.  TMON is useless,
because of the 8 character limit on displaying routine names (all the
TDocument.foo methods show up as "TDOCUMEN").

What is the correct way to access objects in SADE?

A note for people writing Pascal units planning to use SADE: the
sample from Apple comes with object declarations in a file UFoo.p
and the methods all implemented in a file UFoo.inc1.p.  The first file
contains the line
    {$I UFoo.inc1.p}.

This structure confuses SADE, which then can't find the source (which
is in UFoo.inc1.p) because it thinks the source file is UFoo.p.  I
don't know if this is true for both Pascals or just the TML version.
The fix is to insert the actual contents of the method files in place
of the {$I...} line, thereby getting rid of the separate source files.

	/JBL
UUCP:     levin@bbn.com (new) or {backbone}!bbn!levin (old)
INTERNET: levin@bbn.com       		POTS: (617) 873-3463
   "The night was"

siegel@endor.harvard.edu (Rich Siegel) (07/28/89)

In article <43394@bbn.COM> levin@BBN.COM (Joel B Levin) writes:
>
>It has a bug.  So, I recompiled it with the SADE symbol option, and
>I'm having trouble getting anything useful.  I didn't see anything in
>the (minimal) SADE documentation about dealing with Objects.  I can

	Unless I'm mistaken, SADE is incabable of dealing with object-types
in high-level fashion.

	You might consider Lightspeed Pascal, which can view objects 
symbolically.

		--Rich



~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

"When it comes to my health, I think of my body as a temple - or at least
a moderately well-managed Presbyterian youth center." - Emo Phillips

~~~~~~~~~~~~~~~

keith@Apple.COM (Keith Rollin) (07/28/89)

In article <43394@bbn.COM> levin@BBN.COM (Joel B Levin) writes:
>I thought I'd like to learn a little more about OOP and object Pascal,
>so I grabbed the appropriate sample from the Apple sample code set
>(OOPTESample).  I am using MPW 3.0 with TML Pascal II v3.0 (on a
>vanilla SE with 2.5 Mb).  It is an instructive example, does not use
>MacApp (which I don't have), and compiles and links as-is.
>
>It has a bug.  

Sorry about that. This has been pointed out (to our embarassment) and will be
fixed in the next release of the DTS Sample Code disk. At least, if it's the
bug I'm thinking about. Does the program crash when you select the "Close" menu
item?

>So, I recompiled it with the SADE symbol option, and
>I'm having trouble getting anything useful.  I didn't see anything in
>the (minimal) SADE documentation about dealing with Objects.  I can

	[ Details of problems with SADE and Object Pascal nuked ]

Pascal did not emit the proper information for SADE concerning objects. This
will be fixed in a future version of MPW.

------------------------------------------------------------------------------
Keith Rollin  ---  Apple Computer, Inc.  ---  Developer Technical Support
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions