From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,68b038366e15f2a1 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,68b038366e15f2a1 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-04-25 16:11:42 PST Xref: gmd.de comp.sys.dec:7275 comp.os.vms:22487 Newsgroups: comp.sys.dec,comp.os.vms Path: gmd.de!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!wupost!decwrl!pa.dec.com!e2big.mko.dec.com!dbased.nuo.dec.com!quark.enet.dec.com!lionel From: lionel@quark.enet.dec.com (Steve Lionel) Subject: Re: how to tell in a VMS program if it is running in DEBUGGER Message-ID: <1993Apr25.230234.29327@dbased.nuo.dec.com> Sender: news@dbased.nuo.dec.com (USENET News System) Organization: Digital Equipment Corporation References: <1993Apr25.151944.23271@husc3.harvard.edu> Distribution: usa Date: Sun, 25 Apr 1993 23:57:07 GMT In article <1993Apr25.151944.23271@husc3.harvard.edu>, mlevin@husc8.harvard.edu (Michael Levin) writes... > > Suppose I have a program, written in C on a VMS system. How do I >tell within the prorgram if it happens to be running alone, or inside >the VMS debugger? I want a function in_debug() which I can use as >follows. Is there some system call or something? > There is a P1-space longword CTL$GL_PSTFLAGS. If the USRI$V_DBG_MAPPED bit in this longword is set, the debugger is mapped. How you code this in C I'll leave up to you. You have to link against SYS$SYSTEM:SYS.STB to access this value. Also, this is undocumented and unsupported, but the Fortran RTL uses this so I doubt it will change. The USRI$ symbols are defined in USRIDEF.H. I don't know if this works on AXP systems. Steve Lionel lionel@quark.enet.dec.com SDT Languages Group Digital Equipment Corporation 110 Spit Brook Road Nashua, NH 03062