[comp.sys.mac.programmer] Permanent Break Points in Think C

jcocon@hubcap.clemson.edu (james c oconnor) (06/19/91)

I remember someone telling how you could put a permanent break point
into think c code, I believe that it involved puting an asm{...}
statement into the code.  The idea being that the debugger would then
always stop at the point.

Does anyone remember what it was?  Jim

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

In article <1991Jun19.145055.13153@hubcap.clemson.edu> jcocon@hubcap.clemson.edu (james c oconnor) writes:
>I remember someone telling how you could put a permanent break point
>into think c code, I believe that it involved puting an asm{...}
>statement into the code.

You don't need to use asm{}:

	Debugger();

or

	DebugStr( "\pMessage" );

will do the trick.

If you're not running with the THINK C debugger, the above lines will
drop you into MacsBug.

The THINK debugger distributed with 4.0.5 has trouble with Debugger()
and DebugStr() calls if VM is on.

-- 
-----------------	----------------------
Greg Anderson		User Programming Group	    ()    "Ponnuki
greggor@apple.com	Apple Computer, Inc.	  ()  ()   is ideal
-----------------	----------------------	    ()     shape."

Edward.Rice@p4214.f421.n109.z1.FidoNet.Org (Edward Rice) (06/20/91)

Think 'C' has a function call of the simplest sort:
 
     Debugger ()
 
That takes you to Macsbug.  If you include an argument of a /Pascal/-type string, you'll get a display of your own choosing -- I can't remember if it shows up in an alert or if the debugger displays it.

 * Origin: "It's still in beta testing," Tom said Pointedly. (1:109/421.4214)

mrn@eplunix.UUCP (Mark R. Nilsen) (06/21/91)

in article <54178@apple.Apple.COM>, greggor@Apple.COM (Greg L. Anderson) says:
> You don't need to use asm{}:
> 	Debugger();
> or
> 	DebugStr( "\pMessage" );
> If you're not running with the THINK C debugger, the above lines will
> drop you into MacsBug.
		^^^^^^^

If you have MacsBugs installed.  


-- 
"To skilled assembly language	      |	Mark Nilsen.	
programmers, the 8088 is perhaps the  |
most wonderful processor ever	      |	mrn%eplunix.UUCP@eddie.mit.edu	
created, ..."-Dr Dobb's Journal, 3/91 |

mvharding@cup.portal.com (Michael V Harding) (06/25/91)

I saw the following (from memory) in a recent MacTutor...

If you put the line

asm(_Debugger)

in your C code, and are running the Think debugger, the code will
halt at that line...

(whoops, make those (_Debugger) into {_Debugger}