home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / xdebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.1 KB  |  119 lines

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