home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / vmsnet / internal / 1118 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.1 KB  |  42 lines

  1. Newsgroups: vmsnet.internals
  2. Path: sparky!uunet!mcsun!chsun!cgch!fiz.ciba-geigy.ch!bnebga
  3. From: bnebga@ciba-geigy.ch (Gary Nebbett)
  4. Subject: Re: How can I determine if running under debugger?
  5. Message-ID: <1992Jul27.133619.28409@nntphost.ciba-geigy.ch>
  6. Sender: news@nntphost.ciba-geigy.ch (USENET News Agent)
  7. Nntp-Posting-Host: fiz1.is.ciba-geigy.ch
  8. Reply-To: bnebga@ciba-geigy.ch (Gary Nebbett)
  9. Organization: Ciba-Geigy AG, Basel, Switzerland
  10. References:  <MARBY.92Jul24152309@laura.harvard.edu>
  11. Date: Mon, 27 Jul 1992 13:36:19 GMT
  12. Lines: 28
  13.  
  14. The debugger modifies certain entries in the system service dispatch table. 
  15. The slot for sys$exit is changed from something like
  16.  
  17.     chmk    #0038
  18.     ret
  19.  
  20. to
  21.  
  22.     jmp    @#share$dbgssishr+0b68
  23.  
  24. The value of the opcode (chmk(0xbc) = nodebugger, jmp(0x17) = debugger)
  25. provides the information you need. The P1 copy of sys$exit dispatch table 
  26. entry is located at 0x7ffedf40 (the opcode appears at 0x7ffedf42).
  27.  
  28. The following short program run with and without the debugger demonstrates
  29. the behaviour:
  30.  
  31. main()
  32. {
  33.         int *x = 0x7ffedf40;
  34.  
  35.         printf("%0x %0x\n", x[0], x[1]);
  36. }
  37.  
  38. Regards,
  39. Gary Nebbett
  40.  
  41.  
  42.