Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: lionel@quark.enet.dec.com (Steve Lionel)
Subject: Re: how to tell in a VMS program if it is running in DEBUGGER
Date: Sun, 25 Apr 1993 23:57:07 GMT	[thread overview]
Message-ID: <1993Apr25.230234.29327@dbased.nuo.dec.com> (raw)
In-Reply-To: 1993Apr25.151944.23271@husc3.harvard.edu


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


      parent reply	other threads:[~1993-04-25 23:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-04-25 19:19 how to tell in a VMS program if it is running in DEBUGGER Michael Levin
1993-04-25 21:14 ` Carl J Lydick
1993-04-25 23:57 ` Steve Lionel [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox