[comp.sys.mac.programmer] Think C Debugger woes: stack ptr?

pittenger-laurence@cs.yale.edu (Laurence Arthur Pittenger) (06/05/91)

My program is making the debugger do *very* odd things.  After only a
few seconds of running, it crashes, usually with an "illegal
instruction" msg, sometimes with an "odd address".  It's failing at a
call to a cdef, though the cdef is accessed fine earlier in the
initial setting up and drawing.

One part of the code parses a list of objects, drawing them.
Basically it goes:

-get next element
-if it's not NULL
-draw it
-recurs until NULL.

The draw command calls another routine, which works fine.  If I
comment out this bit of code, thus deactivating the "multi draw"
capacity, the code works fine.  Yet it still uses the drawing code;
the only part which has been made inaccessable is the list parsing,
which is itself error free.  (Easy enough to check; it's the most
*basic* of code...)

Furthermore, when I don't run my program under the Debugger, it works
fine!!!  I've had it go for several minutes w/ narry a peep, whereas
the exact same code under the debugger crashes w/i 2 or 3 seconds.

I can't for the life of me (or of my program at any rate) figure out
any logical explanation for this behavior.  Is it possible that the
stack's starting address is pushed up by the debugger and so runs into
the application memory?

If anyone out there has any ideas (especially any Symantec people who
might see this), *please* pass them along.

Thanks,
LP

-- 

Laurence A. Pittenger
CSNET  : pittenger-laurence@cs.yale.edu
BITNET : pitlaua@yalevm ,  pittenger-laurence@yalecs

Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) (06/08/91)

Laurence Arthur Pittenger writes in a message to All

LAP> Furthermore, when I don't run my program under the Debugger, 
LAP> it works fine!!! I've had it go for several minutes w/ narry 
LAP> a peep, whereas the exact same code under the debugger crashes 
LAP> w/i 2 or 3 seconds

If you are doing certain kinds of system calls, the debugger may interfere with
the error checking (at least using Think Pascal). It is conceivable that the
debugger and one of your routines aren't getting along well. Try switching off
the debugger around suspicious routines using the compiler options and see if
it runs then...

(sorry to post this on the 'net, but I can never get E-Mail to anyone with "-"
in their address)
Lawson
 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English
Internet: Lawson.English@p88.f15.n300.z1.fidonet.org