Source code of Windows XP (NT5)
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.

101 lines
1.7 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1992 - 1999
  3. Module Name:
  4. aic.c
  5. Abstract:
  6. WinDbg Extension Api for interpretting AIC78XX debugging structures
  7. Author:
  8. Peter Wieland (peterwie) 16-Oct-1995
  9. Environment:
  10. User Mode.
  11. Revision History:
  12. --*/
  13. #define DBG_TRACE
  14. #include "pch.h"
  15. #include "trace.h"
  16. extern char *eventTypes[];
  17. void dumpTraceInfo(traceinfo *ti);
  18. DECLARE_API( trace )
  19. /*++
  20. Routine Description:
  21. Dumps the specified AIC78xx debugging data structure
  22. Arguments:
  23. Ascii bits for address.
  24. Return Value:
  25. None.
  26. --*/
  27. {
  28. ULONG_PTR traceinfoAddr;
  29. traceinfo ti;
  30. GetAddress(args, &traceinfoAddr);
  31. if (!ReadMemory( traceinfoAddr, &ti, sizeof(ti), NULL )) {
  32. dprintf("%p: Could not read Srb\n", traceinfoAddr);
  33. return;
  34. }
  35. dumpTraceInfo(&ti);
  36. return;
  37. }
  38. void dumpTraceInfo(traceinfo *ti) {
  39. UCHAR i,j;
  40. DWORD result;
  41. char buf[64];
  42. dprintf("AIC78xx Debugging Trace - %d total entries\n", ti->num);
  43. for (i = 0; i < ti->num; i++) {
  44. j = (ti->next + i) % ti->num;
  45. if (ti->table[i].type == TRACE_TYPE_EMPTY) continue;
  46. dprintf("event %d: ", ti->num - i);
  47. dprintf("%s\t", eventTypes[ti->table[j].type]);
  48. // dprintf("%lx(", ti->table[j].func);
  49. if (ti->table[j].func != NULL) {
  50. GetSymbol((LPVOID)ti->table[j].func, buf, &result);
  51. dprintf("%s(", buf);
  52. } else {
  53. dprintf("NULL(", buf);
  54. }
  55. dprintf("%lx, %lx, %lx)\n", ti->table[j].arg[0],
  56. ti->table[j].arg[1],
  57. ti->table[j].arg[2]);
  58. }
  59. return;
  60. }
  61. char *eventTypes[] = {"EMPTY", "ENTRY", "EXIT", "EVENT"};