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.

82 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. debug.c
  5. Abstract:
  6. This module contains debugging routines for dpmi.
  7. Revision History:
  8. Neil Sandlin (neilsa) Nov. 1, 95 - wrote it
  9. --*/
  10. #include "precomp.h"
  11. #pragma hdrstop
  12. #include "softpc.h"
  13. #if DBG
  14. #define MAX_TRACE_ENTRIES 100
  15. DPMI_TRACE_ENTRY DpmiTraceTable[MAX_TRACE_ENTRIES];
  16. const int DpmiMaxTraceEntries = MAX_TRACE_ENTRIES;
  17. int DpmiTraceIndex = 0;
  18. int DpmiTraceCount = 0;
  19. BOOL bDpmiTraceOn = TRUE;
  20. VOID
  21. DpmiDbgTrace(
  22. int Type,
  23. ULONG v1,
  24. ULONG v2,
  25. ULONG v3
  26. )
  27. {
  28. if (!bDpmiTraceOn) {
  29. return;
  30. }
  31. DpmiTraceTable[DpmiTraceIndex].Type = Type;
  32. DpmiTraceTable[DpmiTraceIndex].v1 = v1;
  33. DpmiTraceTable[DpmiTraceIndex].v2 = v2;
  34. DpmiTraceTable[DpmiTraceIndex].v3 = v3;
  35. DpmiTraceTable[DpmiTraceIndex].eax = getEAX();
  36. DpmiTraceTable[DpmiTraceIndex].ebx = getEBX();
  37. DpmiTraceTable[DpmiTraceIndex].ecx = getECX();
  38. DpmiTraceTable[DpmiTraceIndex].edx = getEDX();
  39. DpmiTraceTable[DpmiTraceIndex].esi = getESI();
  40. DpmiTraceTable[DpmiTraceIndex].edi = getEDI();
  41. DpmiTraceTable[DpmiTraceIndex].ebp = getEBP();
  42. DpmiTraceTable[DpmiTraceIndex].esp = getESP();
  43. DpmiTraceTable[DpmiTraceIndex].eip = getEIP();
  44. DpmiTraceTable[DpmiTraceIndex].eflags = getEFLAGS();
  45. DpmiTraceTable[DpmiTraceIndex].cs = getCS();
  46. DpmiTraceTable[DpmiTraceIndex].ds = getDS();
  47. DpmiTraceTable[DpmiTraceIndex].es = getES();
  48. DpmiTraceTable[DpmiTraceIndex].fs = getFS();
  49. DpmiTraceTable[DpmiTraceIndex].gs = getGS();
  50. DpmiTraceTable[DpmiTraceIndex].ss = getSS();
  51. DpmiTraceIndex++;
  52. if (DpmiTraceIndex >= MAX_TRACE_ENTRIES) {
  53. DpmiTraceIndex = 0;
  54. }
  55. if (DpmiTraceCount < MAX_TRACE_ENTRIES) {
  56. DpmiTraceCount++;
  57. }
  58. }
  59. #endif