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.

189 lines
8.1 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // IA64 machine implementation.
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000-2001.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef __IA64_MACH_HPP__
  9. #define __IA64_MACH_HPP__
  10. //
  11. // NOTE: Be very careful when using machine-specific header files
  12. // such as nt<plat>.h. The machine implementation class is
  13. // compiled for all platforms so the nt<plat>.h file will be the
  14. // one for the build platform, not necessarily the platform
  15. // of the machine implementation. ntdbg.h contains many cross-platform
  16. // types and definitions that can be used to avoid problems.
  17. //
  18. class Ia64MachineInfo : public MachineInfo
  19. {
  20. public:
  21. // MachineInfo.
  22. virtual HRESULT InitializeConstants(void);
  23. virtual HRESULT InitializeForTarget(void);
  24. virtual void InitializeContext
  25. (ULONG64 Pc, PDBGKD_ANY_CONTROL_REPORT ControlReport);
  26. virtual HRESULT KdGetContextState(ULONG State);
  27. virtual HRESULT KdSetContext(void);
  28. virtual HRESULT ConvertContextFrom(PCROSS_PLATFORM_CONTEXT Context,
  29. ULONG FromSver,
  30. ULONG FromSize, PVOID From);
  31. virtual HRESULT ConvertContextTo(PCROSS_PLATFORM_CONTEXT Context,
  32. ULONG ToSver, ULONG ToSize, PVOID To);
  33. virtual void InitializeContextFlags(PCROSS_PLATFORM_CONTEXT Context,
  34. ULONG Version);
  35. virtual HRESULT GetContextFromThreadStack(ULONG64 ThreadBase,
  36. PCROSS_PLATFORM_THREAD Thread,
  37. PCROSS_PLATFORM_CONTEXT Context,
  38. PDEBUG_STACK_FRAME Frame,
  39. PULONG RunningOnProc);
  40. virtual int GetType(ULONG index);
  41. virtual BOOL GetVal(ULONG index, REGVAL *val);
  42. virtual BOOL SetVal(ULONG index, REGVAL *val);
  43. virtual void GetPC(PADDR Address);
  44. virtual void SetPC(PADDR Address);
  45. virtual void GetFP(PADDR Address);
  46. virtual void GetSP(PADDR Address);
  47. virtual ULONG64 GetArgReg(void);
  48. virtual void OutputAll(ULONG Mask, ULONG OutMask);
  49. virtual TRACEMODE GetTraceMode(void);
  50. virtual void SetTraceMode(TRACEMODE Mode);
  51. virtual BOOL IsStepStatusSupported(ULONG Status);
  52. virtual void KdUpdateControlSet
  53. (PDBGKD_ANY_CONTROL_SET ControlSet);
  54. virtual void KdSaveProcessorState(void);
  55. virtual void KdRestoreProcessorState(void);
  56. virtual ULONG ExecutingMachine(void);
  57. virtual HRESULT SetPageDirectory(ULONG Idx, ULONG64 PageDir,
  58. PULONG NextIdx);
  59. virtual HRESULT GetVirtualTranslationPhysicalOffsets
  60. (ULONG64 Virt, PULONG64 Offsets, ULONG OffsetsSize,
  61. PULONG Levels, PULONG PfIndex, PULONG64 LastVal);
  62. virtual HRESULT GetBaseTranslationVirtualOffset(PULONG64 Offset);
  63. virtual void Assemble(PADDR Addr, PSTR Input);
  64. virtual BOOL Disassemble(PADDR Addr, PSTR Buffer, BOOL EffAddr);
  65. virtual HRESULT NewBreakpoint(DebugClient* Client,
  66. ULONG Type,
  67. ULONG Id,
  68. Breakpoint** RetBp);
  69. virtual BOOL IsBreakpointInstruction(PADDR Addr);
  70. virtual HRESULT InsertBreakpointInstruction(PUSER_DEBUG_SERVICES Services,
  71. ULONG64 Process,
  72. ULONG64 Offset,
  73. PUCHAR SaveInstr,
  74. PULONG64 ChangeStart,
  75. PULONG ChangeLen);
  76. virtual HRESULT RemoveBreakpointInstruction(PUSER_DEBUG_SERVICES Services,
  77. ULONG64 Process,
  78. ULONG64 Offset,
  79. PUCHAR SaveInstr,
  80. PULONG64 ChangeStart,
  81. PULONG ChangeLen);
  82. virtual void AdjustPCPastBreakpointInstruction(PADDR Addr,
  83. ULONG BreakType);
  84. virtual void InsertAllDataBreakpoints(void);
  85. virtual void RemoveAllDataBreakpoints(void);
  86. virtual ULONG IsBreakpointOrStepException(PEXCEPTION_RECORD64 Record,
  87. ULONG FirstChance,
  88. PADDR BpAddr,
  89. PADDR RelAddr);
  90. virtual BOOL IsCallDisasm(PCSTR Disasm);
  91. virtual BOOL IsReturnDisasm(PCSTR Disasm);
  92. virtual BOOL IsSystemCallDisasm(PCSTR Disasm);
  93. virtual BOOL IsDelayInstruction(PADDR Addr);
  94. virtual void GetEffectiveAddr(PADDR Addr);
  95. virtual void GetNextOffset(BOOL StepOver,
  96. PADDR NextAddr, PULONG NextMachine);
  97. virtual BOOL GetPrefixedSymbolOffset(ULONG64 SymOffset,
  98. ULONG Flags,
  99. PULONG64 PrefixedSymOffset);
  100. virtual void IncrementBySmallestInstruction(PADDR Addr);
  101. virtual void DecrementBySmallestInstruction(PADDR Addr);
  102. virtual void PrintStackFrameAddressesTitle(ULONG Flags);
  103. virtual void PrintStackFrameAddresses(ULONG Flags,
  104. PDEBUG_STACK_FRAME StackFrame);
  105. virtual void PrintStackArgumentsTitle(ULONG Flags);
  106. virtual void PrintStackArguments(ULONG Flags,
  107. PDEBUG_STACK_FRAME StackFrame);
  108. virtual void PrintStackNonvolatileRegisters(ULONG Flags,
  109. PDEBUG_STACK_FRAME StackFrame,
  110. PCROSS_PLATFORM_CONTEXT Context,
  111. ULONG FrameNum);
  112. virtual BOOL DisplayTrapFrame(ULONG64 FrameAddress,
  113. OUT PCROSS_PLATFORM_CONTEXT Context);
  114. virtual void ValidateCxr(PCROSS_PLATFORM_CONTEXT Context);
  115. virtual void OutputFunctionEntry(PVOID RawEntry);
  116. virtual HRESULT ReadDynamicFunctionTable(ULONG64 Table,
  117. PULONG64 NextTable,
  118. PULONG64 MinAddress,
  119. PULONG64 MaxAddress,
  120. PULONG64 BaseAddress,
  121. PULONG64 TableData,
  122. PULONG TableSize,
  123. PWSTR OutOfProcessDll,
  124. PCROSS_PLATFORM_DYNAMIC_FUNCTION_TABLE RawTable);
  125. virtual PVOID FindDynamicFunctionEntry(PCROSS_PLATFORM_DYNAMIC_FUNCTION_TABLE Table,
  126. ULONG64 Address,
  127. PVOID TableData,
  128. ULONG TableSize);
  129. virtual HRESULT ReadKernelProcessorId
  130. (ULONG Processor, PDEBUG_PROCESSOR_IDENTIFICATION_ALL Id);
  131. // Ia64MachineInfo.
  132. BOOL IsIA32InstructionSet(VOID);
  133. void SetKernelPageDirectory(ULONG64 PageDir)
  134. {
  135. m_KernPageDir = PageDir;
  136. }
  137. protected:
  138. IA64_KSPECIAL_REGISTERS m_SpecialRegContext, m_SavedSpecialRegContext;
  139. ULONG64 m_KernPageDir;
  140. void KdGetSpecialRegistersFromContext(void);
  141. void KdSetSpecialRegistersInContext(void);
  142. BOOL GetStackedRegVal(IN ULONG64 RsBSP,
  143. IN USHORT FrameSize,
  144. IN ULONG64 RsRNAT,
  145. IN ULONG regnum,
  146. OUT REGVAL *val);
  147. BOOL SetStackedRegVal(IN ULONG64 RsBSP,
  148. IN USHORT FrameSize,
  149. IN ULONG64 *RsRNAT,
  150. IN ULONG regnum,
  151. IN REGVAL *val);
  152. friend class X86OnIa64MachineInfo;
  153. };
  154. // BUGBUG 2-21-2000
  155. // add declspec alignment in the definition because of a compiler bug.
  156. extern Ia64MachineInfo DECLSPEC_ALIGN(16) g_Ia64Machine;
  157. #endif // #ifndef __IA64_MACH_HPP__