home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: vmsnet.internals
- Path: sparky!uunet!mcsun!chsun!cgch!fiz.ciba-geigy.ch!bnebga
- From: bnebga@ciba-geigy.ch (Gary Nebbett)
- Subject: Re: How can I determine if running under debugger?
- Message-ID: <1992Jul27.133619.28409@nntphost.ciba-geigy.ch>
- Sender: news@nntphost.ciba-geigy.ch (USENET News Agent)
- Nntp-Posting-Host: fiz1.is.ciba-geigy.ch
- Reply-To: bnebga@ciba-geigy.ch (Gary Nebbett)
- Organization: Ciba-Geigy AG, Basel, Switzerland
- References: <MARBY.92Jul24152309@laura.harvard.edu>
- Date: Mon, 27 Jul 1992 13:36:19 GMT
- Lines: 28
-
- The debugger modifies certain entries in the system service dispatch table.
- The slot for sys$exit is changed from something like
-
- chmk #0038
- ret
-
- to
-
- jmp @#share$dbgssishr+0b68
-
- The value of the opcode (chmk(0xbc) = nodebugger, jmp(0x17) = debugger)
- provides the information you need. The P1 copy of sys$exit dispatch table
- entry is located at 0x7ffedf40 (the opcode appears at 0x7ffedf42).
-
- The following short program run with and without the debugger demonstrates
- the behaviour:
-
- main()
- {
- int *x = 0x7ffedf40;
-
- printf("%0x %0x\n", x[0], x[1]);
- }
-
- Regards,
- Gary Nebbett
-
-
-