[comp.sys.amiga.tech] signals, cleaning up and using sdb under Aztec C 3.6a

karl@sugar.uu.net (Karl Lehenbauer) (11/26/88)

Under Aztec 3.6a, the ability to trap certain errors via a Unix-like "signal"
mechanism is provided.  Currently, illegal instruction, odd address and
divide by zero are supported.  I have tested these and they work.  A
cool thing about using them is that you can execute your cleanup routines,
thus turning what would be a visit to the guru into a well-behaved exit -- 
usually.  There's no guarantee that your rogue program hasn't trashed something
important prior to trapping.

Anyway, also, using signals seems to interfere with SDB.  I suppose SDB makes
use of illegal instructions for breakpoints and such.  The behavior is that
sdb says "program terminated normally" as soon as you return to sdb after
executing the signal init stuff.
-- 
-- "We've been following your progress with considerable interest, not to say
-- contempt."  -- Zaphod Beeblebrox IV
-- uunet!sugar!karl, Unix BBS (713) 438-5018

scott@applix.UUCP (Scott Evernden) (11/26/88)

Speaking of Manx's SDB, I was highly annoyed to discover yet
another SDB bug today.   It appears that SDB's evaluator doesn't
handle multi-dimensioned arrays properly.

like try:

    int foo[4][4] = { {1,0,0,0}, {0,1,0,0}, {0,0,1,0}, {0,0,0,1} };

in SDB:

?p foo[0][0]
int _foo = 1

?p foo[1][1]
int _foo = 0

?p foo[1][0]
int _foo = 1

So, does anyone know if there is an upgrade yet that fixes SDB's
assorted problems?

-scott