Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* how to tell in a VMS program if it is running in DEBUGGER
@ 1993-04-25 19:19 Michael Levin
  1993-04-25 21:14 ` Carl J Lydick
  1993-04-25 23:57 ` Steve Lionel
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Levin @ 1993-04-25 19:19 UTC (permalink / raw)



     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?

if in_debug()
	{ }
else
	{ }


	Please send all replies to mlevin@husc8.harvard.edu.

Mike Levin


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to tell in a VMS program if it is running in DEBUGGER
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Carl J Lydick @ 1993-04-25 21:14 UTC (permalink / raw)


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?
=
=if in_debug()
=	{ }
=else
=	{ }
=
=
=	Please send all replies to mlevin@husc8.harvard.edu.

You could define a global variable called in_debug, initialize it to zero, and
if you run the program under the debugger, deposit a 1 into in_debug.
--------------------------------------------------------------------------------
Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL

Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
understanding of astronomy is purely at the amateur level (or below).  So
unless what I'm saying is directly related to VAX/VMS, don't hold me or my
organization responsible for it.  If it IS related to VAX/VMS, you can try to
hold me responsible for it, but my organization had nothing to do with it.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to tell in a VMS program if it is running in DEBUGGER
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Lionel @ 1993-04-25 23:57 UTC (permalink / raw)



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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1993-04-25 23:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox