[comp.sys.mac.programmer] Debugging MPW Tools

bwbecker@watdragon.waterloo.edu (Byron Weber Becker) (02/23/90)

I tried to debug an MPW tool using SADE and got a message
something like "Can't target file."  The same procedure has
worked just fine for applications.  Is there something special
about tools that SADE doesn't like?  Is it of any help for 
debugging tools?

Byron Weber Becker
bwbecker@watdragon.waterloo.edu

bowman@reed.UUCP (Eric Bowman) (02/25/90)

There are instructions for debugging an MPW Tool in "Sade New User Worksheet".
This these are:

###############################################################################
# to debug an MPW tool:
# NOTE: Be sure to specify the file type and creator when you Link an
#		MPW tool; i. e. -T 'MPST' -c 'MPS '
#	then, from the MPW Shell, use the SADEKey to enter SADE
sourcepath 'directory containing tool sources here'
directory 'where MPW is'

target 'mpw shell' using '<where tool is><tool>.SYM'
break main.(0)							# or some more meaningful statement
go

# then, in MPW, run your tool

bObO
"I ain't often right, but I ain't never been wrong"
bowman@reed.{bitnet, UUCP}

cy@dbase.A-T.COM (Cy Shuster) (02/27/90)

And, of course, if you crash, or have to kill 'MPW Shell'...
you lose the whole thing.  Be *sure* to save your source
files before executing.

--Cy--   cy@dbase.a-t.com

robertk@lotatg.lotus.com (Robert Krajewski) (05/13/91)

How do people out there debug MPW tools (not scripts) that you have
written yourself ? Can you use SADE ?

hve@cernvax.cern.ch (H.v.Eicken) (05/13/91)

In article <ROBERTK.91May13091846@lotatg.lotus.com> robertk@lotatg.lotus.com (Robert Krajewski) writes:
>How do people out there debug MPW tools (not scripts) that you have
>written yourself ? Can you use SADE ?

I wish I knew the answer. I have MPW 3.1 and SADE 1.1 and followed the
example given in the "SADE New User Worksheet" without succes. I cannot get
into symbolic debugging. It would be very helpful if a SADE guru could post
a sample debugging session. My tool is stored in MPW's tools folder, but
the tool.SYM file and the sources are stored in another folder outside the
MPW_3.1 folder.

		   Horst von Eicken, hve@cernvax.cern.ch

rgm@ocf.berkeley.edu (Rob Menke) (05/14/91)

In article <5252@cernvax.cern.ch> hve@cernvax.cern.ch (H.v.Eicken) writes:

   It would be very helpful if a SADE guru could post a sample
   debugging session...

		      Horst von Eicken, hve@cernvax.cern.ch

I'm not a SADE guru but I play one on USENET!

Seriously, I managed to get SADE to debug a tool by trial-and-error
(mostly the latter).  So, assuming that your tool was compiled and
linked with '-sym on':

     1)	Start up SADE and MPW Shell.
     2) In SADE, type:
	target 'Your:MPW:path:MPW Shell' using 'Your:SYM_file:path:tool.SYM'
     3) Then type:
	SourcePath add 'Your:Source:path:'
     4) Place your breakpoints as usual.
     5) Switch to MPW Shell.  The shell might be acting funny, e.g.
	the cursor might be greyed, selections might be outlined.
	Ignore this.
     6) Execute your tool.  You CANNOT execute any other tools between
	setting up SADE and switching to MPW Shell (SADE 1.1 release
	notes, p. 3).
     7) Find out the bug you have been trying to track down for the
	last six hours resulted from typing '=' when you meant '=='.
--
"Gadget, love, do ya always carry a	|  Robert Menke
 glass cutter?"				|    rgm@OCF.berkeley.edu
"No-- only when I want to cut glass."	|    ...!ucbvax!OCF!rgm

joel@neon.Stanford.EDU (Joel R Tornatore) (05/15/91)

The system 7.0 release CD has three sade tutorial sessions.
I'll send these to anyone who would them.

joel

steve@hwsw.gedas.de (Stefan Mueller) (05/15/91)

In article <ROBERTK.91May13091846@lotatg.lotus.com> robertk@lotatg.lotus.com (Robert Krajewski) writes:
>How do people out there debug MPW tools (not scripts) that you have
>written yourself ? Can you use SADE ?

It's that simple: You have to debug MPW itself, using SADE, and then start
the Tool from inside MPW. Sounds logic, eh? Took me some time to find out.

Steve.