[comp.sys.mac.programmer] Forcing debugger?

Edward.Blakes.Jr.@f13.n396.z1.MMUG.EDGAR.MN.ORG (Edward Blakes Jr.) (02/27/91)

In THINK C how can I force my program to drop to Macsbug?  Any 
suggestions need to work in a CODE resource, particularly an XCMD. 
Any help is appreciated.

--  
Edward Blakes Jr. - via The Minnesota Macintosh Users Group UUCP-Fido Gateway
UUCP: ...jhereg!kksys!vware!edgar!mmug!396!13!Edward.Blakes.Jr.
INET: Edward.Blakes.Jr.@f13.n396.z1.MMUG.EDGAR.MN.ORG

jspencer@mmug.edgar.mn.org (Jim Spencer) (03/01/91)

Edward Blakes Jr. writes in a message to All

EBJ> In THINK C how can I force my program to drop to Macsbug? Any
EBJ> suggestions need to work in a CODE resource, particularly an
EBJ> XCMD. Any help is appreciated.

I assume Think C, like MPW C, implements the Debugger() trap.


--  
UUCP: ...jhereg!kksys!vware!edgar!mmug!jspencer
INET: jspencer@mmug.edgar.mn.org

e225c-at@juliet.uucp (Eric Anderson) (03/01/91)

In article <0.27CC7494@MMUG.EDGAR.MN.ORG> Edward.Blakes.Jr.@f13.n396.z1.MMUG.EDGAR.MN.ORG (Edward Blakes Jr.) writes:
>In THINK C how can I force my program to drop to Macsbug?  Any 
>suggestions need to work in a CODE resource, particularly an XCMD. 
>Any help is appreciated.
>

How about:   Debugger();
Or even better:
	DebugStr("\pYow!!");

-Eric Anderson
e225c-at@juliet.berkeley.edu

greggor@Apple.COM (Greg L. Anderson) (03/03/91)

In article <0.27CC7494@MMUG.EDGAR.MN.ORG> Edward.Blakes.Jr.@f13.n396.z1.MMUG.EDGAR.MN.ORG (Edward Blakes Jr.) writes:
>In THINK C how can I force my program to drop to Macsbug? 

I'm sure many people have already mentioned the Debugger() and
DebugStr( Str255 pstr ) calls; I just thought that I would speak up and
mention that I have written routines called
DebugNumber( Str255 pstr, long n,... ) and DebugPrintf( char *msg, long n, ...)

DebugPrintf depends on the MacsBug "printf" dcmd.  These routines were
written with MPW C, but would probably port to Think without much difficulty.

Mail me if you want a copy; I can send it out on Monday when I get back to
work.
-- 
 ___\    /___   Greg Anderson  (6 kyu)   ___\    /___
 \   \  /   /   User Programming Group   \   \  /   /    ()   "Ponnuki 
  \  /\/\  /     Apple Computer, Inc.     \  /\/\  /   ()  ()  is ideal
   \/    \/       greggor@apple.com        \/    \/      ()    shape."