home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / xdebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  3.0 KB  |  112 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*    Copyright (c) 1987, 1988 Microsoft Corporation    */
  9. /*      All Rights Reserved    */
  10.  
  11. /*    This Module contains Proprietary Information of Microsoft  */
  12. /*    Corporation and should be treated as Confidential.       */
  13.  
  14. #ident    "@(#)head.sys:xdebug.h    1.3"
  15.  
  16. #ifdef i386
  17. /*
  18.  * xdebug.h - kernel debugging macros
  19.  */
  20.  
  21. /*
  22.  * Reasons for Entering Debugger
  23.  */
  24. #define DR_USER        0    /* User request via sysi86 or key sequence */
  25. #define DR_BPT1        1    /* Int 1 breakpoint trap */
  26. #define DR_STEP        2    /* (Int 1) single-step trap */
  27. #define DR_BPT3        3    /* Int 3 (breakpoint) trap */
  28. #define DR_PANIC    4    /* Panic occurred */
  29. #define DR_OTHER    5    /* Miscellaneous */
  30.  
  31. #define NO_FRAME    ((int *)0)
  32.  
  33. #ifndef NODEBUGGER
  34. extern void (*cdebugger)(), nullsys();
  35. #define debugentry(r0ptr)    ((*cdebugger)(DR_OTHER, r0ptr))
  36. #define calldebug()        debugentry(NO_FRAME)
  37. #else
  38. #define debugentry(r0ptr)
  39. #define calldebug()
  40. #endif
  41.  
  42. #ifdef MSDEBUGGER
  43. # ifndef MSDEBUG
  44. #  define MSDEBUG
  45. # endif
  46. # define debugger(class) if ( debug(class, DL_HALT) ) calldebug();
  47. #else
  48. # define debugger(class)
  49. #endif
  50.  
  51. #ifdef MSDEBUG
  52. # define debug(class, level) (bugbits[class] & level)
  53. # define dentry(class, name) if (debug(class,DL_CALL)) printf(entryfmt,name);
  54. # define dexit(class, name) if (debug(class,DL_CALL)) printf(exitfmt, name);
  55.   extern char entryfmt[];
  56.   extern char exitfmt[];
  57. #else
  58. # define debug(class, level)    0
  59. # define dentry(class, name) 
  60. # define dexit(class, name)
  61. #endif
  62.  
  63. /*
  64.  * Debugging classes
  65.  */
  66. #define DB_EXEC        0    /* Exec system call */
  67. #define DB_FP        1    /* Floating Point */
  68. #define DB_MAIN        2    /* System initialization */
  69. #define DB_MALLOC    3    /* Memory allocation */
  70. #define DB_MMU        4    /* memory management */
  71. #define DB_PHYSIO    5    /* raw I/O */
  72. #define DB_SIG        6    /* Signals */
  73. #define DB_SLP        7    /* Process switching */
  74. #define DB_TEXT        8    /* Text table management */
  75. #define DB_TRAP        9    /* Traps and faults */
  76. #define DB_PFAULT    10
  77. #define DB_PGOUT    11
  78. #define DB_SCALL    12
  79. #define DB_PHASH    13    /* filesystem page cache */
  80. #define DB_FORK        14    /* copy on write fork */
  81. #define DB_SWAP        15    /* swapping */
  82. #define DB_IPC        16    /* ipc msgs, sems, shm */
  83. #define DB_CONSOLE    17    /* console */
  84. #define    DB_DISK        18    /* disk driver */
  85. #define DB_SYNC        19    /* page synchronization */
  86. #define DB_SWTCH    20    /* context switching */
  87. #define    DB_DMA        21    /* dma */
  88. #define NDBC        22    /* number of debugging classes */
  89.  
  90. /* 
  91.  * Debugging levels
  92.  */
  93. #define DL_TERSE    1    /* terse output */
  94. #define DL_VERB        2    /* verbose output */
  95. #define DL_HALT        4    /* call debug() at strategic points */
  96. #define DL_CALL        8    /* function entry/exit trace */
  97.  
  98. /*
  99.  * Manifest constants for debugger
  100.  */
  101. #define NAR    19        /* can't match anything in reg.h */
  102.  
  103. extern char bugbits[];
  104.  
  105. #else
  106.  
  107. #define    calldebug()    debug(0)
  108. #define dentry(class, name) 
  109. #define dexit(class, name)
  110.  
  111. #endif
  112.