home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / debug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-18  |  2.4 KB  |  86 lines

  1. /*
  2.  *    @(#) debug.h 2.3 88/05/18 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. #ifdef M_I386
  12. #ifdef DEBUGGER
  13. # ifndef DEBUG
  14. #  define DEBUG
  15. # endif
  16. # define debugger(class) if ( debug(class, DL_HALT) ) calldebug();
  17.   extern int calldebug();
  18. #else
  19. # define debugger(class)
  20. #endif
  21.  
  22. #ifdef DEBUG
  23. # define debug(class, level) (bugbits[class] & level)
  24. # define dentry(class, name) if (debug(class,DL_CALL)) printf(entryfmt,name);
  25. # define dexit(class, name) if (debug(class,DL_CALL)) printf(exitfmt, name);
  26.   extern char entryfmt[];
  27.   extern char exitfmt[];
  28. #else
  29. # define debug(class, level)
  30. # define dentry(class, name) 
  31. # define dexit(class, name)
  32. #endif
  33.  
  34. /*
  35.  * Debugging classes
  36.  */
  37. #define DB_EXEC        0    /* exec system call */
  38. #define DB_FP        1    /* floating point */
  39. #define DB_MAIN        2    /* system initialization */
  40. #define DB_MALLOC    3    /* memory allocation */
  41. #define DB_MMU        4    /* memory management */
  42. #define DB_PHYSIO    5    /* raw I/O */
  43. #define DB_SIG        6    /* signals */
  44. #define DB_SLP        7    /* process switching */
  45. #define DB_TEXT        8    /* text table management */
  46. #define DB_TRAP        9    /* traps and faults */
  47. #define DB_PFAULT    10    /* page faults */
  48. #define DB_PGOUT    11    /* paging */
  49. #define DB_SCALL    12    /* system calls */
  50. #define DB_PHASH    13    /* filesystem page cache */
  51. #define DB_FORK        14    /* copy on write fork */
  52. #define DB_SWAP        15    /* swapping */
  53. #define DB_IPC        16    /* ipc msgs, sems, shm */
  54. #define DB_CONSOLE    17    /* console */
  55. #define    DB_DISK        18    /* disk driver */
  56. #define DB_SYNC        19    /* page synchronization */
  57. #define DB_SWTCH    20    /* context switching */
  58. #define    DB_STREAM    21    /* stream io */
  59. #define    DB_LOCK        22    /* locking */
  60. #define    DB_TAPE        23    /* tape */
  61. #define    DB_SPARE    24    /* spare temp debugging */
  62. #define NDBC        25    /* number of debugging classes */
  63.  
  64. /* 
  65.  * Debugging levels
  66.  */
  67. #define DL_TERSE    1    /* terse output */
  68. #define DL_VERB        2    /* verbose output */
  69. #define DL_HALT        4    /* call debug() at strategic points */
  70. #define DL_CALL        8    /* function entry/exit trace */
  71.  
  72. /*
  73.  * Manifest constants for debugger
  74.  */
  75. #define NAR    19        /* can't match anything in reg.h */
  76.  
  77. extern char bugbits[];
  78.  
  79. #else
  80.  
  81. #define    calldebug()    debug(0)
  82. #define dentry(class, name) 
  83. #define dexit(class, name)
  84.  
  85. #endif
  86.