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.

137 lines
3.0 KiB

  1. Linking and Embedding Call Tracing
  2. Alex Gounares (alexgo), 12/15/93
  3. ------------------------------
  4. NB: All call tracing added to the L&E layers of OLE *must*
  5. conform to this spec; post processing tools may break otherwise.
  6. Syntax of this grammar:
  7. non-terminals are bracketed with underscores (e.g. _foo_)
  8. Other tokens are literally or as described
  9. General:
  10. Call logging should be done via the LEDebugOut macro, which
  11. takes the following parameters:
  12. LEDebugOut(( _type_ , _formatstring_ , _arguments));
  13. _type_ : DEB_TRACE
  14. | DEB_ITRACE
  15. ;
  16. DEB_TRACE should be used for any API or method *directly*
  17. reachable by an OLE app.
  18. DEB_ITRACE should be used for all internal APIs and
  19. methods.
  20. In some circumstances (an important internal function),
  21. it is permissible to use DEB_TRACE for internal functions
  22. and methods, but this is discouraged.
  23. _arguments_ : whatever is needed by _formatstring_
  24. There are three _formatstring_ formats currently supported,
  25. one for function entrance, another for function exit, and
  26. a third for object deletion. More formats may be added
  27. as needed, so tools must be prepared to ignore
  28. non-conforming strings (as it may be a new format for a new
  29. tool).
  30. _formatstring_ : _in_
  31. | _out_
  32. | _delete_
  33. ;
  34. Function entrance: // _IN is literal
  35. _in_ : "_this_ _IN _name_ _args_ _extra_ \n"
  36. ;
  37. _this_ : %p
  38. //should be passed the pointer
  39. //to the *top* level object in
  40. //the class (if the this pointer
  41. //points to a nested class)
  42. //If a function, then 0 should be
  43. //passed.
  44. ;
  45. _name_ : // the complete name of the function
  46. // or method (i.e. CFoo::CBar::Blah)
  47. _args_ : ( )
  48. | ( _arglist_ )
  49. ;
  50. _arglist_ : _arglist_ , _arg_
  51. | _arg_
  52. ;
  53. _arg_ : _string_
  54. | _integral_
  55. ;
  56. _string_ : \"%s\"
  57. | \"%ws\"
  58. ;
  59. _integral_ : any printf conversion string
  60. other than strings (see NOTES)
  61. _extra_ : an arbitrary number of bytes
  62. with no newline character
  63. Function exit:
  64. _out_ : "_this_ OUT _name_ _return_ _outparams_ _extra_ \n"
  65. ;
  66. _return_ : ( _arg_ )
  67. ;
  68. _outparams_ : [ _arglist_ ] // used to put the
  69. | // values of the
  70. ; // out parameters
  71. Object Deletion:
  72. _delete_ : "_this_ DELETED _extra_ \n"
  73. ;
  74. NOTES:
  75. 1. The newline does not need to be preceeded by a space.
  76. Other spaces in the grammar are intentional (the
  77. space character is the token delimiter)
  78. 2. Tools should ignore any extra bytes after the known
  79. fields to be compatible with future revs of the
  80. logging.
  81. 3. In general, the following conversion codes are used
  82. for the following data types. These are not binding,
  83. however, individual functions/methods may do
  84. something different as appropriate.
  85. HRESULT %lx
  86. pointer %p
  87. DWORD %lu
  88. DWORD(bitflags) %lx
  89. ULONG %lu
  90. LONG %ld
  91. REFGUID %p
  92. 4. For in/out params, in may be awkward to print
  93. the out value (since it may be a long piece of
  94. memory). In this case, just printing the pointer
  95. value (although the same as the argument) is
  96. sufficient.