DEBUGWRI.DEF 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. DEFINITION MODULE DebugWrite;
  2. (*
  3. * Simplified interfaces to typical debug write formats.
  4. *
  5. * Each has a string initial parameter, which should be used to explain
  6. * what the value is and/or the position in the code.
  7. * The standard signature is "# [DebugWrite: ]"
  8. * Special cases are translated to ensure readability.
  9. * All output is to StdError.
  10. *)
  11. FROM SYSTEM IMPORT BYTE;
  12. PROCEDURE DebugOn;
  13. (*
  14. * Enable DebugWrite output (this is the default)
  15. *)
  16. PROCEDURE DebugOff;
  17. (*
  18. * Disable DebugWrite output
  19. *)
  20. PROCEDURE DC(*DebugWriteChar*) (heading : ARRAY OF CHAR; char : CHAR);
  21. (*
  22. * Write signature, heading, followed by ":" if not empty,
  23. * then ch if printable, else its hex equivalent.
  24. *)
  25. PROCEDURE DCa(*DebugWriteCardinal*) (heading : ARRAY OF CHAR; card : CARDINAL);
  26. (*
  27. * Write signature, heading, followed by ":" if not empty,
  28. * then card in minimum field width.
  29. *)
  30. PROCEDURE DI(*DebugWriteInteger*) (heading : ARRAY OF CHAR; int : INTEGER);
  31. (*
  32. * Write signature, heading, followed by ":" if not empty,
  33. * then int in minimum field width.
  34. *)
  35. PROCEDURE DR(*DebugWriteReal*) (heading : ARRAY OF CHAR; real : REAL);
  36. (*
  37. * Write signature, heading, followed by ":" if not empty,
  38. * then real in full precision - fixed point if within whole number range,
  39. * floating point otherwise.
  40. *)
  41. PROCEDURE DB(*DebugWriteBoolean*) (heading : ARRAY OF CHAR; boolean : BOOLEAN);
  42. (*
  43. * Write signature, heading, followed by ":" if not empty,
  44. * then "TRUE" or "FALSE".
  45. *)
  46. PROCEDURE DAll (heading : ARRAY OF CHAR; value : ARRAY OF BYTE);
  47. (*
  48. * Write signature, heading, followed by ":" if not empty,
  49. * then 8 bytes starting at beginning of value in all formats.
  50. *)
  51. PROCEDURE DDump (heading : ARRAY OF CHAR; value : ARRAY OF BYTE;
  52. size : CARDINAL);
  53. (*
  54. * Write signature, heading, followed by ":" if not empty,
  55. * then size bytes starting at beginning of value in hexadecimal.
  56. *)
  57. PROCEDURE DW(*DebugWriteLn*);
  58. (*
  59. * WriteLn
  60. *)
  61. PROCEDURE DS(*DebugWriteString*) (string : ARRAY OF CHAR);
  62. (*
  63. * Write signature, string, ":".
  64. *)
  65. END DebugWrite.