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.

644 lines
18 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Global header file.
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999-2001.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef __NTSDP_HPP__
  9. #define __NTSDP_HPP__
  10. #pragma warning( disable : 4101 )
  11. // Always turn GUID definitions on. This requires a compiler
  12. // with __declspec(selectany) to compile properly.
  13. #define INITGUID
  14. #include <nt.h>
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #define STATUS_CPP_EH_EXCEPTION 0xe06d7363
  18. // In the kernel debugger there is a virtual process representing
  19. // kernel space. It has an artificial handle and threads
  20. // representing each processor in the machine.
  21. // A similar scheme is used in user dump files where real
  22. // handles don't exist.
  23. #define VIRTUAL_PROCESS_ID 0xf0f0f0f0
  24. #define VIRTUAL_PROCESS_HANDLE ((HANDLE)(ULONG_PTR)VIRTUAL_PROCESS_ID)
  25. // In kernel mode the index is a processor index. In user
  26. // dumps it's the thread index in the dump.
  27. #define VIRTUAL_THREAD_HANDLE(Index) ((ULONG64)((Index) + 1))
  28. #define VIRTUAL_THREAD_INDEX(Handle) ((ULONG)((Handle) - 1))
  29. #define VIRTUAL_THREAD_ID(Index) ((Index) + 1)
  30. #include <windows.h>
  31. #define _IMAGEHLP64
  32. #include <dbghelp.h>
  33. #include <kdbg1394.h>
  34. #define NOEXTAPI
  35. #include <wdbgexts.h>
  36. #define DEBUG_NO_IMPLEMENTATION
  37. #include <dbgeng.h>
  38. #include <ntdbg.h>
  39. #include "dbgsvc.h"
  40. #include <ntsdexts.h>
  41. #include <vdmdbg.h>
  42. #include <ntiodump.h>
  43. #include <assert.h>
  44. #include <malloc.h>
  45. #include <memory.h>
  46. #include <tchar.h>
  47. #include <stdio.h>
  48. #include <stdlib.h>
  49. #include <crt\io.h>
  50. #include <fcntl.h>
  51. #include <time.h>
  52. #include <alphaops.h>
  53. #include <ia64inst.h>
  54. #include <dbgimage.h>
  55. #include <dbhpriv.h>
  56. #include <cmnutil.hpp>
  57. #include <pparse.hpp>
  58. #include <dllimp.h>
  59. #include <exdi.h>
  60. #include <exdi_x86_64.h>
  61. // Could not go into system header because CRITICAL_SECTION not defined in the
  62. // kernel.
  63. __inline
  64. void
  65. CriticalSection32To64(
  66. IN PRTL_CRITICAL_SECTION32 Cr32,
  67. OUT PRTL_CRITICAL_SECTION64 Cr64
  68. )
  69. {
  70. COPYSE(Cr64,Cr32,DebugInfo);
  71. Cr64->LockCount = Cr32->LockCount;
  72. Cr64->RecursionCount = Cr32->RecursionCount;
  73. COPYSE(Cr64,Cr32,OwningThread);
  74. COPYSE(Cr64,Cr32,LockSemaphore);
  75. COPYSE(Cr64,Cr32,SpinCount);
  76. }
  77. //
  78. // Pointer-size-specific system structures.
  79. //
  80. typedef struct _EXCEPTION_DEBUG_INFO32 {
  81. EXCEPTION_RECORD32 ExceptionRecord;
  82. DWORD dwFirstChance;
  83. } EXCEPTION_DEBUG_INFO32, *LPEXCEPTION_DEBUG_INFO32;
  84. typedef struct _CREATE_THREAD_DEBUG_INFO32 {
  85. ULONG hThread;
  86. ULONG lpThreadLocalBase;
  87. ULONG lpStartAddress;
  88. } CREATE_THREAD_DEBUG_INFO32, *LPCREATE_THREAD_DEBUG_INFO32;
  89. typedef struct _CREATE_PROCESS_DEBUG_INFO32 {
  90. ULONG hFile;
  91. ULONG hProcess;
  92. ULONG hThread;
  93. ULONG lpBaseOfImage;
  94. DWORD dwDebugInfoFileOffset;
  95. DWORD nDebugInfoSize;
  96. ULONG lpThreadLocalBase;
  97. ULONG lpStartAddress;
  98. ULONG lpImageName;
  99. WORD fUnicode;
  100. } CREATE_PROCESS_DEBUG_INFO32, *LPCREATE_PROCESS_DEBUG_INFO32;
  101. typedef struct _EXIT_THREAD_DEBUG_INFO32 {
  102. DWORD dwExitCode;
  103. } EXIT_THREAD_DEBUG_INFO32, *LPEXIT_THREAD_DEBUG_INFO32;
  104. typedef struct _EXIT_PROCESS_DEBUG_INFO32 {
  105. DWORD dwExitCode;
  106. } EXIT_PROCESS_DEBUG_INFO32, *LPEXIT_PROCESS_DEBUG_INFO32;
  107. typedef struct _LOAD_DLL_DEBUG_INFO32 {
  108. ULONG hFile;
  109. ULONG lpBaseOfDll;
  110. DWORD dwDebugInfoFileOffset;
  111. DWORD nDebugInfoSize;
  112. ULONG lpImageName;
  113. WORD fUnicode;
  114. } LOAD_DLL_DEBUG_INFO32, *LPLOAD_DLL_DEBUG_INFO32;
  115. typedef struct _UNLOAD_DLL_DEBUG_INFO32 {
  116. ULONG lpBaseOfDll;
  117. } UNLOAD_DLL_DEBUG_INFO32, *LPUNLOAD_DLL_DEBUG_INFO32;
  118. typedef struct _OUTPUT_DEBUG_STRING_INFO32 {
  119. ULONG lpDebugStringData;
  120. WORD fUnicode;
  121. WORD nDebugStringLength;
  122. } OUTPUT_DEBUG_STRING_INFO32, *LPOUTPUT_DEBUG_STRING_INFO32;
  123. typedef struct _RIP_INFO32 {
  124. DWORD dwError;
  125. DWORD dwType;
  126. } RIP_INFO32, *LPRIP_INFO32;
  127. typedef struct _DEBUG_EVENT32 {
  128. DWORD dwDebugEventCode;
  129. DWORD dwProcessId;
  130. DWORD dwThreadId;
  131. union {
  132. EXCEPTION_DEBUG_INFO32 Exception;
  133. CREATE_THREAD_DEBUG_INFO32 CreateThread;
  134. CREATE_PROCESS_DEBUG_INFO32 CreateProcessInfo;
  135. EXIT_THREAD_DEBUG_INFO32 ExitThread;
  136. EXIT_PROCESS_DEBUG_INFO32 ExitProcess;
  137. LOAD_DLL_DEBUG_INFO32 LoadDll;
  138. UNLOAD_DLL_DEBUG_INFO32 UnloadDll;
  139. OUTPUT_DEBUG_STRING_INFO32 DebugString;
  140. RIP_INFO32 RipInfo;
  141. } u;
  142. } DEBUG_EVENT32, *LPDEBUG_EVENT32;
  143. typedef struct _EXCEPTION_DEBUG_INFO64 {
  144. EXCEPTION_RECORD64 ExceptionRecord;
  145. DWORD dwFirstChance;
  146. } EXCEPTION_DEBUG_INFO64, *LPEXCEPTION_DEBUG_INFO64;
  147. typedef struct _CREATE_THREAD_DEBUG_INFO64 {
  148. ULONG64 hThread;
  149. ULONG64 lpThreadLocalBase;
  150. ULONG64 lpStartAddress;
  151. } CREATE_THREAD_DEBUG_INFO64, *LPCREATE_THREAD_DEBUG_INFO64;
  152. typedef struct _CREATE_PROCESS_DEBUG_INFO64 {
  153. ULONG64 hFile;
  154. ULONG64 hProcess;
  155. ULONG64 hThread;
  156. ULONG64 lpBaseOfImage;
  157. DWORD dwDebugInfoFileOffset;
  158. DWORD nDebugInfoSize;
  159. ULONG64 lpThreadLocalBase;
  160. ULONG64 lpStartAddress;
  161. ULONG64 lpImageName;
  162. WORD fUnicode;
  163. } CREATE_PROCESS_DEBUG_INFO64, *LPCREATE_PROCESS_DEBUG_INFO64;
  164. typedef struct _EXIT_THREAD_DEBUG_INFO64 {
  165. DWORD dwExitCode;
  166. } EXIT_THREAD_DEBUG_INFO64, *LPEXIT_THREAD_DEBUG_INFO64;
  167. typedef struct _EXIT_PROCESS_DEBUG_INFO64 {
  168. DWORD dwExitCode;
  169. } EXIT_PROCESS_DEBUG_INFO64, *LPEXIT_PROCESS_DEBUG_INFO64;
  170. typedef struct _LOAD_DLL_DEBUG_INFO64 {
  171. ULONG64 hFile;
  172. ULONG64 lpBaseOfDll;
  173. DWORD dwDebugInfoFileOffset;
  174. DWORD nDebugInfoSize;
  175. ULONG64 lpImageName;
  176. WORD fUnicode;
  177. } LOAD_DLL_DEBUG_INFO64, *LPLOAD_DLL_DEBUG_INFO64;
  178. typedef struct _UNLOAD_DLL_DEBUG_INFO64 {
  179. ULONG64 lpBaseOfDll;
  180. } UNLOAD_DLL_DEBUG_INFO64, *LPUNLOAD_DLL_DEBUG_INFO64;
  181. typedef struct _OUTPUT_DEBUG_STRING_INFO64 {
  182. ULONG64 lpDebugStringData;
  183. WORD fUnicode;
  184. WORD nDebugStringLength;
  185. } OUTPUT_DEBUG_STRING_INFO64, *LPOUTPUT_DEBUG_STRING_INFO64;
  186. typedef struct _RIP_INFO64 {
  187. DWORD dwError;
  188. DWORD dwType;
  189. } RIP_INFO64, *LPRIP_INFO64;
  190. typedef struct _DEBUG_EVENT64 {
  191. DWORD dwDebugEventCode;
  192. DWORD dwProcessId;
  193. DWORD dwThreadId;
  194. DWORD __alignment;
  195. union {
  196. EXCEPTION_DEBUG_INFO64 Exception;
  197. CREATE_THREAD_DEBUG_INFO64 CreateThread;
  198. CREATE_PROCESS_DEBUG_INFO64 CreateProcessInfo;
  199. EXIT_THREAD_DEBUG_INFO64 ExitThread;
  200. EXIT_PROCESS_DEBUG_INFO64 ExitProcess;
  201. LOAD_DLL_DEBUG_INFO64 LoadDll;
  202. UNLOAD_DLL_DEBUG_INFO64 UnloadDll;
  203. OUTPUT_DEBUG_STRING_INFO64 DebugString;
  204. RIP_INFO64 RipInfo;
  205. } u;
  206. } DEBUG_EVENT64, *LPDEBUG_EVENT64;
  207. #define STATUS_VCPP_EXCEPTION 0x406d1388
  208. #define VCPP_DEBUG_SET_NAME 0x1000
  209. // This structure is passed as the lpArguments field of
  210. // RaiseException so its members need to be decoded out
  211. // of the exception arguments array.
  212. typedef struct tagEXCEPTION_VISUALCPP_DEBUG_INFO32
  213. {
  214. DWORD dwType; // one of the enums from above
  215. union
  216. {
  217. struct
  218. {
  219. DWORD szName; // pointer to name (in user addr space)
  220. DWORD dwThreadID; // thread ID (-1=caller thread)
  221. DWORD dwFlags; // reserved for future use (eg User thread, System thread)
  222. } SetName;
  223. };
  224. } EXCEPTION_VISUALCPP_DEBUG_INFO32;
  225. typedef struct tagEXCEPTION_VISUALCPP_DEBUG_INFO64
  226. {
  227. DWORD dwType; // one of the enums from above
  228. DWORD __alignment;
  229. union
  230. {
  231. struct
  232. {
  233. DWORD64 szName; // pointer to name (in user addr space)
  234. DWORD dwThreadID; // thread ID (-1=caller thread)
  235. DWORD dwFlags; // reserved for future use (eg User thread, System thread)
  236. } SetName;
  237. };
  238. } EXCEPTION_VISUALCPP_DEBUG_INFO64;
  239. //
  240. // Global declarations.
  241. //
  242. #define ARRAYSIZE 20
  243. #define STRLISTSIZE 128
  244. #define MAX_SYMBOL_LEN 4096
  245. // Allow space for a symbol, a code address, an EA and other things in
  246. // a line of disassembly.
  247. #define MAX_DISASM_LEN (MAX_SYMBOL_LEN + 128)
  248. #define MAX_THREAD_NAME 32
  249. // Maximum number of bytes possible for a breakpoint instruction.
  250. // Currently sized to hold an entire IA64 bundle plus flags due to
  251. // extraction and insertion considerations.
  252. #define MAX_BREAKPOINT_LENGTH 20
  253. #define MAX_SOURCE_PATH 1024
  254. #define IS_SLASH(Ch) ((Ch) == '/' || (Ch) == '\\')
  255. #define IS_PATH_DELIM(Ch) (IS_SLASH(Ch) || (Ch) == ':')
  256. // Maximum command string. DbgPrompt has a limit of 512
  257. // characters so that would be one potential limit. We
  258. // have users who want to use longer command lines, though,
  259. // such as Autodump which scripts the debugger with very long
  260. // sx commands. The other obvious limit is MAX_SYMBOL_LEN
  261. // since it makes sense that you should be able to give a
  262. // command with a full symbol name, so use that.
  263. #define MAX_COMMAND MAX_SYMBOL_LEN
  264. // Maximum length of a full path for an image. Technically
  265. // this can be very large but realistically it's rarely
  266. // greater than MAX_PATH. Use our own constant instead
  267. // of MAX_PATH in case we need to raise it at some point.
  268. // If this constant is increased it's likely that changes
  269. // to dbghelp will be required to increase buffer sizes there.
  270. #define MAX_IMAGE_PATH MAX_PATH
  271. #define BUILD_MAJOR_VERSION (VER_PRODUCTVERSION_W >> 8)
  272. #define BUILD_MINOR_VERSION (VER_PRODUCTVERSION_W & 0xff)
  273. #define BUILD_REVISION API_VERSION_NUMBER
  274. #define KERNEL_MODULE_NAME "NT"
  275. #define HAL_MODULE_NAME "hal"
  276. #define HAL_IMAGE_FILE_NAME "hal.dll"
  277. #define KDHWEXT_MODULE_NAME "kdcom"
  278. #define KDHWEXT_IMAGE_FILE_NAME "kdcom.dll"
  279. #define NTLDR_IMAGE_NAME "ntldr"
  280. #define OSLOADER_IMAGE_NAME "osloader"
  281. #define SETUPLDR_IMAGE_NAME "setupldr"
  282. #define LDR_IMAGE_SIZE 0x80000
  283. #define KBYTES(Bytes) (((Bytes) + 1023) / 1024)
  284. enum
  285. {
  286. OPTFN_ADD,
  287. OPTFN_REMOVE,
  288. OPTFN_SET
  289. };
  290. enum
  291. {
  292. DII_GOOD_CHECKSUM = 1,
  293. DII_UNKNOWN_TIMESTAMP,
  294. DII_UNKNOWN_CHECKSUM,
  295. DII_BAD_CHECKSUM
  296. };
  297. enum INAME
  298. {
  299. INAME_IMAGE_PATH,
  300. INAME_IMAGE_PATH_TAIL,
  301. INAME_MODULE,
  302. };
  303. #define MAX_MODULE 64
  304. typedef struct _DEBUG_IMAGE_INFO
  305. {
  306. struct _DEBUG_IMAGE_INFO *Next;
  307. BOOL Unloaded;
  308. HANDLE File;
  309. DWORD64 BaseOfImage;
  310. DWORD SizeOfImage;
  311. DWORD CheckSum;
  312. DWORD TimeDateStamp;
  313. UCHAR GoodCheckSum;
  314. CHAR ModuleName[MAX_MODULE];
  315. CHAR OriginalModuleName[MAX_MODULE];
  316. CHAR ImagePath[MAX_IMAGE_PATH];
  317. // Executable image mapping information for images
  318. // mapped with minidumps.
  319. CHAR MappedImagePath[MAX_IMAGE_PATH];
  320. PVOID MappedImageBase;
  321. } DEBUG_IMAGE_INFO, *PDEBUG_IMAGE_INFO;
  322. //----------------------------------------------------------------------------
  323. //
  324. // Thread and process information is much different bewteen
  325. // user and kernel debugging. The structures exist and are
  326. // as common as possible to enable common code.
  327. //
  328. // In user debugging process and thread info track the system
  329. // processes and threads being debugged.
  330. //
  331. // In kernel debugging there is only one process that represents
  332. // kernel space. There is one thread per processor, each
  333. // representing that processor's thread state.
  334. //
  335. //----------------------------------------------------------------------------
  336. #define ENG_PROC_ATTACHED 0x00000001
  337. #define ENG_PROC_CREATED 0x00000002
  338. #define ENG_PROC_EXAMINED 0x00000004
  339. #define ENG_PROC_ATTACH_EXISTING 0x00000008
  340. // Currently the only system process specially marked is CSR.
  341. #define ENG_PROC_SYSTEM 0x00000010
  342. #define ENG_PROC_ANY_ATTACH (ENG_PROC_ATTACHED | ENG_PROC_EXAMINED)
  343. #define ENG_PROC_ANY_EXAMINE (ENG_PROC_EXAMINED | ENG_PROC_ATTACH_EXISTING)
  344. // Handle must be closed when deleted.
  345. // This flag applies to both processes and threads.
  346. #define ENG_PROC_THREAD_CLOSE_HANDLE 0x80000000
  347. // The debugger set the trace flag when deferring
  348. // breakpoint work on the last event for this thread.
  349. #define ENG_THREAD_DEFER_BP_TRACE 0x00000001
  350. // Processes which were created or attached but that
  351. // have not yet generated events yet.
  352. struct PENDING_PROCESS
  353. {
  354. ULONG64 Handle;
  355. // Initial thread information is only valid for creations.
  356. ULONG64 InitialThreadHandle;
  357. ULONG Id;
  358. ULONG InitialThreadId;
  359. ULONG Flags;
  360. ULONG Options;
  361. PENDING_PROCESS* Next;
  362. };
  363. typedef struct PENDING_PROCESS* PPENDING_PROCESS;
  364. #define MAX_DATA_BREAKS 4
  365. typedef struct _THREAD_INFO
  366. {
  367. // Generic information.
  368. struct _THREAD_INFO *Next;
  369. struct _PROCESS_INFO *Process;
  370. ULONG UserId;
  371. ULONG SystemId;
  372. BOOL Exited;
  373. ULONG64 DataOffset;
  374. // For kernel mode and dumps the thread handle is
  375. // a virtual handle.
  376. ULONG64 Handle;
  377. ULONG Flags;
  378. // Only set by VCPP exceptions.
  379. char Name[MAX_THREAD_NAME];
  380. class Breakpoint* DataBreakBps[MAX_DATA_BREAKS];
  381. ULONG NumDataBreaks;
  382. // Only partially-implemented in kd.
  383. ULONG64 StartAddress;
  384. BOOL Frozen;
  385. ULONG SuspendCount;
  386. ULONG FreezeCount;
  387. ULONG InternalFreezeCount;
  388. } THREAD_INFO, *PTHREAD_INFO;
  389. typedef struct _PROCESS_INFO
  390. {
  391. struct _PROCESS_INFO *Next;
  392. ULONG NumberImages;
  393. PDEBUG_IMAGE_INFO ImageHead;
  394. PDEBUG_IMAGE_INFO ExecutableImage;
  395. ULONG NumberThreads;
  396. PTHREAD_INFO ThreadHead;
  397. PTHREAD_INFO CurrentThread;
  398. ULONG UserId;
  399. ULONG SystemId;
  400. BOOL Exited;
  401. ULONG64 DataOffset;
  402. // For kernel mode and dumps the process handle is
  403. // a virtual handle for the kernel/dump process.
  404. // dbghelp still uses HANDLE as the process handle
  405. // type even though we may want to pass in 64-bit
  406. // process handles when remote debugging. Keep
  407. // a cut-down version of the handle for normal
  408. // use but also keep the full handle around in
  409. // case it's needed.
  410. HANDLE Handle;
  411. ULONG64 FullHandle;
  412. BOOL InitialBreakDone;
  413. BOOL InitialBreak;
  414. BOOL InitialBreakWx86;
  415. ULONG Flags;
  416. ULONG Options;
  417. ULONG NumBreakpoints;
  418. class Breakpoint* Breakpoints;
  419. class Breakpoint* BreakpointsTail;
  420. ULONG64 DynFuncTableList;
  421. } PROCESS_INFO, *PPROCESS_INFO;
  422. extern PPENDING_PROCESS g_ProcessPending;
  423. extern PPROCESS_INFO g_ProcessHead;
  424. extern PPROCESS_INFO g_EventProcess;
  425. extern PTHREAD_INFO g_EventThread;
  426. extern PPROCESS_INFO g_CurrentProcess;
  427. extern PTHREAD_INFO g_SelectedThread;
  428. enum
  429. {
  430. SELTHREAD_ANY,
  431. SELTHREAD_THREAD,
  432. SELTHREAD_INTERNAL_THREAD,
  433. };
  434. extern ULONG g_SelectExecutionThread;
  435. #define CURRENT_PROC \
  436. VIRTUAL_THREAD_INDEX(g_CurrentProcess->CurrentThread->Handle)
  437. // Registry keys.
  438. #define DEBUG_ENGINE_KEY "Software\\Microsoft\\Debug Engine"
  439. // Possibly truncates and sign-extends a value to 64 bits.
  440. #define EXTEND64(Val) ((ULONG64)(LONG64)(LONG)(Val))
  441. #define IsPow2(Val) \
  442. (((Val) & ((Val) - 1)) == 0)
  443. // Machine type indices for machine-type-indexed things.
  444. enum MachineIndex
  445. {
  446. MACHIDX_I386,
  447. MACHIDX_ALPHA,
  448. MACHIDX_AXP64,
  449. MACHIDX_IA64,
  450. MACHIDX_AMD64,
  451. MACHIDX_COUNT
  452. };
  453. void SetEffMachine(ULONG Machine, BOOL Notify);
  454. //
  455. // Specific modules.
  456. //
  457. typedef struct _ADDR* PADDR;
  458. typedef struct _DESCRIPTOR64* PDESCRIPTOR64;
  459. class DebugClient;
  460. typedef enum _DEBUG_SCOPE_STATE
  461. {
  462. ScopeDefault,
  463. ScopeDefaultLazy,
  464. ScopeFromContext,
  465. } DEBUG_SCOPE_STATE;
  466. typedef struct _DEBUG_SCOPE
  467. {
  468. BOOL LocalsChanged;
  469. DEBUG_SCOPE_STATE State;
  470. DEBUG_STACK_FRAME Frame;
  471. CROSS_PLATFORM_CONTEXT Context;
  472. ULONG ContextState;
  473. FPO_DATA CachedFpo;
  474. } DEBUG_SCOPE, *PDEBUG_SCOPE;
  475. #include "dbgrpc.hpp"
  476. #include "dbgclt.hpp"
  477. #include "dbgsym.hpp"
  478. #include "addr.h"
  479. #include "target.hpp"
  480. #include "register.h"
  481. #include "machine.hpp"
  482. #include "brkpt.hpp"
  483. #include "callback.h"
  484. #include "dbgkdapi.h"
  485. #include "dbgkdtrans.hpp"
  486. #include "event.h"
  487. #include "exts.h"
  488. #include "float10.h"
  489. #include "instr.h"
  490. #include "mcache.hpp"
  491. #include "memcmd.h"
  492. #include "mmap.h"
  493. #include "ntalias.hpp"
  494. #include "ntcmd.h"
  495. #include "ntexpr.h"
  496. #include "ntsdtok.h"
  497. #include "ntsrc.h"
  498. #include "ntsym.h"
  499. #include "symtype.h"
  500. #include "procthrd.h"
  501. #include "stepgo.hpp"
  502. #include "stkwalk.h"
  503. #include "util.h"
  504. #include "vdm.h"
  505. #include "alpha_reg.h"
  506. #include "amd64_reg.h"
  507. #include "i386_reg.h"
  508. #include "ia64_reg.h"
  509. #include "alpha_mach.hpp"
  510. #include "i386_mach.hpp"
  511. // Must come after i386_mach.hpp.
  512. #include "amd64_mach.hpp"
  513. #include "ia64_mach.hpp"
  514. // Must come after target.hpp.
  515. #include "dump.hpp"
  516. #include "dbgsvc.hpp"
  517. //
  518. // The Splay function takes as input a pointer to a splay link in a tree
  519. // and splays the tree. Its function return value is a pointer to the
  520. // root of the splayed tree.
  521. //
  522. PRTL_SPLAY_LINKS
  523. pRtlSplay (
  524. PRTL_SPLAY_LINKS Links
  525. );
  526. //
  527. // The Delete function takes as input a pointer to a splay link in a tree
  528. // and deletes that node from the tree. Its function return value is a
  529. // pointer to the root of the tree. If the tree is now empty, the return
  530. // value is NULL.
  531. //
  532. PRTL_SPLAY_LINKS
  533. pRtlDelete (
  534. PRTL_SPLAY_LINKS Links
  535. );
  536. #define EnumerateLocals(CallBack, Context) \
  537. SymEnumSymbols(g_CurrentProcess->Handle, \
  538. 0, \
  539. NULL, \
  540. CallBack, \
  541. Context \
  542. )
  543. #endif // ifndef __NTSDP_HPP__