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.

204 lines
4.6 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dbgimage.hxx
  6. Abstract:
  7. Debug imagehlp header file.
  8. Author:
  9. Steve Kiraly (SteveKi) 17-May-1998
  10. Revision History:
  11. --*/
  12. #ifndef _DBGIMAGE_HXX_
  13. #define _DBGIMAGE_HXX_
  14. DEBUG_NS_BEGIN
  15. class TDebugImagehlp {
  16. public:
  17. enum EDecoration
  18. {
  19. kDecorateName,
  20. kUnDecorateName,
  21. };
  22. TDebugImagehlp::
  23. TDebugImagehlp(
  24. VOID
  25. );
  26. TDebugImagehlp::
  27. ~TDebugImagehlp(
  28. VOID
  29. );
  30. BOOL
  31. TDebugImagehlp::
  32. bValid(
  33. VOID
  34. );
  35. BOOL
  36. TDebugImagehlp::
  37. bCaptureBacktrace(
  38. IN UINT cFramesToSkipped,
  39. IN ULONG uMaxBacktraceDepth,
  40. OUT VOID **apvBacktrace,
  41. OUT ULONG *pulHash
  42. );
  43. BOOL
  44. TDebugImagehlp::
  45. ResolveAddressToSymbol(
  46. IN PVOID pvAddress,
  47. IN LPTSTR pszName,
  48. IN UINT cchNameLength,
  49. IN EDecoration eDecorateType
  50. );
  51. BOOL
  52. TDebugImagehlp::
  53. GetSymbolPath(
  54. IN TDebugString &strSymbolPath
  55. ) const;
  56. BOOL
  57. TDebugImagehlp::
  58. SetSymbolPath(
  59. IN LPCTSTR pszSymbolPath
  60. );
  61. private:
  62. enum Constants
  63. {
  64. kMaxSymbolNameLength = 512,
  65. };
  66. typedef
  67. BOOL
  68. (WINAPI *pfSymGetModuleInfo)(
  69. IN HANDLE hProcess,
  70. IN DWORD_PTR dwAddr,
  71. OUT PIMAGEHLP_MODULE ModuleInfo
  72. );
  73. typedef
  74. LPVOID
  75. (WINAPI *pfSymFunctionTableAccess)(
  76. IN HANDLE hProcess,
  77. IN DWORD_PTR AddrBase
  78. );
  79. typedef
  80. DWORD_PTR
  81. (WINAPI *pfSymGetModuleBase)(
  82. IN HANDLE hProcess,
  83. IN DWORD_PTR dwAddr
  84. );
  85. typedef
  86. BOOL
  87. (WINAPI *pfStackWalk)(
  88. IN DWORD MachineType,
  89. IN HANDLE hProcess,
  90. IN HANDLE hThread,
  91. IN LPSTACKFRAME StackFrame,
  92. IN LPVOID ContextRecord,
  93. IN PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine,
  94. IN PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,
  95. IN PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
  96. IN PTRANSLATE_ADDRESS_ROUTINE TranslateAddress
  97. );
  98. typedef
  99. BOOL
  100. (WINAPI *pfSymInitialize)(
  101. IN HANDLE hProcess,
  102. IN LPSTR UserSearchPath,
  103. IN BOOL fInvadeProcess
  104. );
  105. typedef
  106. DWORD
  107. (WINAPI *pfSymSetOptions)(
  108. IN DWORD SymOptions
  109. );
  110. typedef
  111. BOOL
  112. (WINAPI *pfSymGetSymFromAddr)(
  113. IN HANDLE hProcess,
  114. IN DWORD_PTR dwAddr,
  115. OUT PDWORD pdwDisplacement,
  116. OUT PIMAGEHLP_SYMBOL Symbol
  117. );
  118. typedef
  119. BOOL
  120. (WINAPI *pfSymUnDName)(
  121. IN PIMAGEHLP_SYMBOL sym,
  122. OUT LPSTR UnDecName,
  123. IN DWORD UnDecNameLength
  124. );
  125. typedef
  126. BOOL
  127. (WINAPI *pfSymGetSearchPath)(
  128. IN HANDLE hProcess,
  129. OUT PSTR SearchPath,
  130. IN DWORD SearchPathLength
  131. );
  132. typedef
  133. BOOL
  134. (WINAPI *pfSymSetSearchPath)(
  135. IN HANDLE hProcess,
  136. IN PSTR SearchPath
  137. );
  138. //
  139. // Copying and assignment are not defined.
  140. //
  141. TDebugImagehlp::
  142. TDebugImagehlp(
  143. const TDebugImagehlp &rhs
  144. );
  145. const TDebugImagehlp &
  146. TDebugImagehlp::
  147. operator=(
  148. const TDebugImagehlp &rhs
  149. );
  150. pfSymGetModuleInfo _pfSymGetModuleInfo;
  151. pfSymFunctionTableAccess _pfSymFunctionTableAccess;
  152. pfSymGetModuleBase _pfSymGetModuleBase;
  153. pfStackWalk _pfStackWalk;
  154. pfSymInitialize _pfSymInitialize;
  155. pfSymSetOptions _pfSymSetOptions;
  156. pfSymGetSymFromAddr _pfSymGetSymFromAddr;
  157. pfSymUnDName _pfSymUnDName;
  158. pfSymGetSearchPath _pfSymGetSearchPath;
  159. pfSymSetSearchPath _pfSymSetSearchPath;
  160. TDebugLibrary _ImageHlp;
  161. BOOL _bValid;
  162. LPTSTR _pszSymbolFormatSpecifier;
  163. };
  164. DEBUG_NS_END
  165. #endif