From: danco@pebble.org Sent: Monday, February 11, 2002 10:24 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: Am I being debugged? In article <1013433357.9395.0.nnrp-07.9e989e7e@news.demon.co.uk>, Chris Sharman wrote: >> > Small question: how can my (C today, but tomorrow will be different) >> > program tell if it is being run in debug mode? Perhaps something like this may work for you? You get the idea anyway. int32 is_debug_active(void) { typedef struct { int32 kernel_primary; int32 kernel_secondary; int32 exec_primary; int32 exec_secondary; int32 super_primary; int32 super_secondary; int32 user_primary; int32 user_secondary; } EXCVEC; ITEM_LIST_3 itmlst[2]; EXCVEC *excvec; uint16 len; itmlst[0].buflen = 4; itmlst[0].code = JPI$_EXCVEC; itmlst[0].bufadr = (int8*) &excvec; itmlst[0].retlenadr = &len; itmlst[1].buflen = 0; itmlst[1].code = 0; itmlst[1].bufadr = NULL; itmlst[1].retlenadr = NULL; sys$getjpiw(0, 0, 0, itmlst, 0, 0, 0); return (excvec->user_primary != NULL); } - Dan