Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
4.1 KiB

  1. /*** amldebug.h - AML Debugger Definitions
  2. *
  3. * Copyright (c) 1996,1997 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created 09/24/96
  6. *
  7. * MODIFICATION HISTORY
  8. */
  9. #ifndef _AMLDEBUG_H
  10. #define _AMLDEBUG_H
  11. #ifdef DEBUGGER
  12. /*** Constants
  13. */
  14. // DNS flags
  15. #define DNSF_RECURSE 0x00000001
  16. // DS flags
  17. #define DSF_VERBOSE 0x00000001
  18. // dwfDebug flags
  19. #define DBGF_IN_DEBUGGER 0x00000001
  20. #define DBGF_IN_VXDMODE 0x00000002
  21. #define DBGF_IN_KDSHELL 0x00000004
  22. #define DBGF_VERBOSE_ON 0x00000008
  23. #define DBGF_AMLTRACE_ON 0x00000010
  24. #define DBGF_TRIGGER_MODE 0x00000020
  25. #define DBGF_SINGLE_STEP 0x00000040
  26. #define DBGF_STEP_OVER 0x00000080
  27. #define DBGF_STEP_MODES (DBGF_SINGLE_STEP | DBGF_STEP_OVER)
  28. #define DBGF_TRACE_NONEST 0x00000100
  29. #define DBGF_DUMPDATA_PHYADDR 0x00000200
  30. //
  31. // Important! Don't move the DBGF_DUMPDATA_* bits unless you update the
  32. // following DATASIZE() macro.
  33. //
  34. #define DBGF_DUMPDATA_MASK 0x00000c00
  35. #define DBGF_DUMPDATA_BYTE 0x00000000
  36. #define DBGF_DUMPDATA_WORD 0x00000400
  37. #define DBGF_DUMPDATA_DWORD 0x00000800
  38. #define DBGF_DUMPDATA_STRING 0x00000c00
  39. #define DATASIZE(f) (((f) == DBGF_DUMPDATA_STRING)? 0: \
  40. (1L << ((f) >> 10)))
  41. #define DBGF_DEBUGGER_REQ 0x00001000
  42. #define DBGF_CHECKING_TRACE 0x00002000
  43. #define DBGF_ERRBREAK_ON 0x00004000
  44. #define DBGF_LOGEVENT_ON 0x00008000
  45. #define DBGF_LOGEVENT_MUTEX 0x00010000
  46. #define DBGF_DEBUG_SPEW_ON 0x00020000
  47. #define MAX_TRIG_PTS 10
  48. #define MAX_TRIGPT_LEN 31
  49. #endif
  50. #define MAX_ERRBUFF_LEN 255
  51. #define MAX_BRK_PTS 10
  52. #ifdef DEBUGGER
  53. #define MAX_UNASM_CODES 0x10
  54. #define DEF_MAXLOG_ENTRIES 204 //8K buffer
  55. /*** Macros
  56. */
  57. #define ASSERTRANGE(p,n) (TRUE)
  58. #endif
  59. /*** Type definitions
  60. */
  61. #define BPF_ENABLED 0x00000001
  62. typedef struct _brkpt
  63. {
  64. ULONG dwfBrkPt;
  65. PUCHAR pbBrkPt;
  66. } BRKPT, *PBRKPT;
  67. typedef struct _objsym
  68. {
  69. struct _objsym *posPrev;
  70. struct _objsym *posNext;
  71. PUCHAR pbOp;
  72. PNSOBJ pnsObj;
  73. } OBJSYM, *POBJSYM;
  74. typedef struct _eventlog
  75. {
  76. ULONG dwEvent;
  77. ULONGLONG ullTime;
  78. ULONG_PTR uipData1;
  79. ULONG_PTR uipData2;
  80. ULONG_PTR uipData3;
  81. ULONG_PTR uipData4;
  82. ULONG_PTR uipData5;
  83. ULONG_PTR uipData6;
  84. ULONG_PTR uipData7;
  85. } EVENTLOG, *PEVENTLOG;
  86. typedef struct _dbgr
  87. {
  88. ULONG dwfDebugger;
  89. int iPrintLevel;
  90. ULONG_PTR uipDumpDataAddr;
  91. PUCHAR pbUnAsm;
  92. PUCHAR pbUnAsmEnd;
  93. PUCHAR pbBlkBegin;
  94. PUCHAR pbBlkEnd;
  95. POBJSYM posSymbolList;
  96. BRKPT BrkPts[MAX_BRK_PTS];
  97. ULONG dwLogSize;
  98. ULONG dwLogIndex;
  99. PEVENTLOG pEventLog;
  100. EVHANDLE hConMessage;
  101. EVHANDLE hConPrompt;
  102. NTSTATUS rcLastError;
  103. char szLastError[MAX_ERRBUFF_LEN + 1];
  104. } DBGR, *PDBGR;
  105. /*** Exported Data
  106. */
  107. extern DBGR gDebugger;
  108. #ifdef DEBUGGER
  109. /*** Exported function prototypes
  110. */
  111. VOID LOCAL AddObjSymbol(PUCHAR pbOp, PNSOBJ pnsObj);
  112. VOID LOCAL FreeSymList(VOID);
  113. int LOCAL CheckBP(PUCHAR pbOp);
  114. VOID LOCAL PrintBuffData(PUCHAR pb, ULONG dwLen);
  115. VOID LOCAL PrintIndent(PCTXT pctxt);
  116. VOID LOCAL PrintObject(POBJDATA pdata);
  117. VOID LOCAL LogEvent(ULONG dwEvent, ULONG_PTR uipData1, ULONG_PTR uipData2,
  118. ULONG_PTR uipData3, ULONG_PTR uipData4, ULONG_PTR uipData5,
  119. ULONG_PTR uipData6, ULONG_PTR uipData7);
  120. VOID LOCAL LogSchedEvent(ULONG dwEvent, ULONG_PTR uipData1, ULONG_PTR uipData2,
  121. ULONG_PTR uipData3);
  122. BOOLEAN LOCAL SetLogSize(ULONG dwLogSize);
  123. VOID LOCAL LogError(NTSTATUS rcErr);
  124. VOID LOCAL CatError(PSZ pszFormat, ...);
  125. VOID LOCAL ConPrintf(PSZ pszFormat, ...);
  126. VOID LOCAL ConPrompt(PSZ pszPrompt, PSZ pszBuff, ULONG dwcbBuff);
  127. #endif //ifdef DEBUGGER
  128. #ifdef DEBUG
  129. VOID LOCAL DumpMemObjCounts(VOID);
  130. #endif //ifdef DEBUG
  131. #endif //ifndef _AMLDEBUG_H