Leaked source code of windows server 2003
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.

4628 lines
183 KiB

  1. /*++
  2. Copyright (c) 1999 / 2000 Microsoft Corporation
  3. Module Name:
  4. eXdi.idl : IDL source for eXdi interface
  5. Abstract:
  6. This file will be processed by the MIDL tool to
  7. produce the type library (eXdiTest.tlb) and marshalling code.
  8. eXDI: extended debug interface.
  9. The interfaces described here are meant to be used for communication between an external debug driver
  10. (like driver for Hardware Debug probe).
  11. Author:
  12. Greg Hogdal (ghogdal) 11-Nov-1999
  13. Environment:
  14. Win32 NT
  15. Revision History:
  16. November 1999 ghogdal
  17. Creation.
  18. 11-21-1999 ghogdal
  19. Change hrSingleStep into hrStep in HALT_REASON_TYPE type declaration
  20. 11-23-1999 ghogdal
  21. Add fDebugRegs to _CONTEXT_PPC.RegGroupSelection
  22. 11-24-1999 ghogdal
  23. Fix bug in buffer size calculation (size_is) of ReadVirtualMemory (), WriteVirtualMemory (), ReadPhysicalMemoryOrPeriphIO () and ReadPhysicalMemoryOrPeriphIO ()
  24. 12-01-1999 ghogdal
  25. Modify NotifyRunStateChange(): parameters are not outputs but inputs
  26. Change comment description of dwConnectionCookie in StopNotifyingRunChg() and StopNotifyingMemChg()
  27. Rename all bDataWidth by bAccessWidth
  28. Add meaning for bAccessWidth parameter of IeXdiServer::AddDataBreakpoint: -1 (255) means that the width should be ignored as a BP trigger filter.
  29. Breakpoint interface cleanup:
  30. -Add function HRESULT IeXdiServer::DelCodeBreakpoint ([in] IeXdiCodeBreakpoint *pieXdiCodeBreakpoint);
  31. -Add function HRESULT IeXdiServer::DelDataBreakpoint ([in] IeXdiDataBreakpoint *pieXdiDataBreakpoint);
  32. -Remove function HRESULT IeXdiCodeBreakpoint::ChangeAttributes ([in] ADDRESS_TYPE Address, [in] CBP_KIND cbpk, [in] DWORD dwExecMode, [in] DWORD dwTotalBypassCount, [in] BOOL fResetBypassedOccurences, [in] BOOL fEnabled);
  33. -Remove function HRESULT IeXdiDataBreakpoint::ChangeAttributes ([in] ADDRESS_TYPE Address, [in] ADDRESS_TYPE AddressMask, [in] DWORD dwData, [in] DWORD dwDataMask, [in] BYTE bAccessWidth, [in] DATA_ACCESS_TYPE da, [in] DWORD dwTotalBypassCount, [in] BOOL fResetBypassedOccurences, [in] BOOL fEnabled);
  34. -Add parameter fResetBypassedOccurences in function HRESULT IeXdiCodeBreakpoint::SetState ([in] BOOL fEnabled, [in] BOOL fResetBypassedOccurences);
  35. -Add parameter fResetBypassedOccurences in function HRESULT IeXdiDataBreakpoint::SetState ([in] BOOL fEnabled, [in] BOOL fResetBypassedOccurences);
  36. -IeXdiEnumCodeBreakpoint::Next()'s appieXdiCodeBreakpoint parameter was missing one level of indirection
  37. -IeXdiEnumDataBreakpoint::Next()'s appieXdiDataBreakpoint parameter was missing one level of indirection
  38. -Add mt and bAddressSpace parameters to IeXdiServer::AddDataBreakpoint()
  39. -Add pmt and pbAddressSpace parameters to IeXdiDataBreakpoint::GetDataBpAttributes()
  40. 12-07-1999 ghogdal
  41. Rename IeXdiDataBreakpoint::GetDataBpAttributes() into IeXdiDataBreakpoint::GetAttributes()
  42. Add mt parameter to IeXdiServer::AddCodeBreakpoint()
  43. Add pmt parameter to IeXdiCodeBreakpoint::GetAttributes()
  44. Change daBoth from -1 to 2 (COM does not like negative enum val apparently)
  45. 12-13-1999 ghogdal
  46. Add notes on memory "sanitization" and mem change notification purpose
  47. 01-03-2000 ghogdal
  48. Add 2 parameters to NotifyRunStateChange () for conveniency: CurrentExecAddress and dwExceptionCode
  49. 01-05-2000 ghogdal
  50. Add GetExceptionDescriptionList () in IeXdiServer and EXCEPTION_DESCRIPTION_TYPE type
  51. 01-06-2000 ghogdal
  52. Change EXCEPTION_DESCRIPTION type name by EXCEPTION_DESCRIPTION_TYPE
  53. Change EXCEPTION_FILTER_DEFAULT type name by EXCEPTION_DEFAULT_ACTION_TYPE
  54. 01-12-2000 ghogdal
  55. Add 2 params to GetRunStatus(), to make life easier: pCurrentExecAddress and pdwExceptionCode.
  56. 01-17-2000 ghogdal
  57. Backup from previous change (12-01-1999):
  58. -IeXdiEnumCodeBreakpoint::Next()'s apieXdiCodeBreakpoint parameter has one more level of indirection than it should (was not following enumerator convention).
  59. -IeXdiEnumDataBreakpoint::Next()'s apieXdiDataBreakpoint parameter has one more level of indirection than it should (was not following enumerator convention).
  60. 01-30-2000 ghogdal
  61. fDataBpDataMatchSupported added to BREAKPOINT_SUPPORT_TYPE
  62. PROCESSOR_FAMILY_UNK constant added (plus associated comments)
  63. API frozen
  64. --*/
  65. import "oaidl.idl";
  66. import "ocidl.idl";
  67. //
  68. // Summary of interfaces
  69. //
  70. // Standard interfaces
  71. interface IeXdiServer;
  72. // HRESULT GetTargetInfo ([out] PGLOBAL_TARGET_INFO_STRUCT pgti);
  73. // HRESULT SetDebugMode ([in] DWORD dwModeBitField);
  74. // HRESULT GetErrorDescription ([in] HRESULT ErrorCode, [out] LPOLESTR *pszErrorDesc);
  75. // HRESULT GetExceptionDescriptionList ([in] DWORD dwNbElementToReturn, [out, size_is(dwNbElementToReturn)] EXCEPTION_DESCRIPTION_TYPE* pedTable, [out] DWORD *pdwNbTotalExceptionInList);
  76. // HRESULT SetWaitOnConcurentUse ([in] BOOL fNewWaitOnConcurentUseFlag);
  77. // HRESULT GetRunStatus ([out] PRUN_STATUS_TYPE persCurrent, [out] PHALT_REASON_TYPE pehrCurrent, [out] ADDRESS_TYPE *pCurrentExecAddress, [out] DWORD *pdwExceptionCode);
  78. // HRESULT GetLastException ([out] PEXCEPTION_TYPE pexLast);
  79. // HRESULT Run (void);
  80. // HRESULT Halt (void);
  81. // HRESULT DoSingleStep (void);
  82. // HRESULT DoMultipleStep ([in] DWORD dwNbInstructions);
  83. // HRESULT DoRangeStep ([in] ADDRESS_TYPE FirstAddress, [in] ADDRESS_TYPE LastAddress);
  84. // HRESULT Reboot (void);
  85. // HRESULT GetBpSupport ([out] PBREAKPOINT_SUPPORT_TYPE pbps);
  86. // HRESULT GetNbCodeBpAvail ([out] DWORD *pdwNbHwCodeBpAvail, [out] DWORD *pdwNbSwCodeBpAvail);
  87. // HRESULT GetNbDataBpAvail ([out] DWORD *pdwNbDataBpAvail);
  88. // HRESULT AddCodeBreakpoint ([in] ADDRESS_TYPE Address, [in] CBP_KIND cbpk, [in] MEM_TYPE mt, [in] DWORD dwExecMode, [in] DWORD dwTotalBypassCount, [out] IeXdiCodeBreakpoint **ppieXdiCodeBreakpoint);
  89. // HRESULT DelCodeBreakpoint ([in] IeXdiCodeBreakpoint *pieXdiCodeBreakpoint);
  90. // HRESULT AddDataBreakpoint ([in] ADDRESS_TYPE Address, [in] ADDRESS_TYPE AddressMask, [in] DWORD dwData, [in] DWORD dwDataMask, [in] BYTE bAccessWidth, [in] MEM_TYPE mt, [in] BYTE bAddressSpace, [in] DATA_ACCESS_TYPE da, [in] DWORD dwTotalBypassCount, [out] IeXdiDataBreakpoint **ppieXdiDataBreakpoint);
  91. // HRESULT DelDataBreakpoint ([in] IeXdiDataBreakpoint *pieXdiDataBreakpoint);
  92. // HRESULT EnumAllCodeBreakpoints ([out] IeXdiEnumCodeBreakpoint **ppieXdiEnumCodeBreakpoint);
  93. // HRESULT EnumAllDataBreakpoints ([out] IeXdiEnumDataBreakpoint **ppieXdiEnumDataBreakpoint);
  94. // HRESULT EnumCodeBreakpointsInAddrRange ([in] ADDRESS_TYPE FirstAddress, [in] ADDRESS_TYPE LastAddress, [out] IeXdiEnumCodeBreakpoint **ppieXdiEnumCodeBreakpoint);
  95. // HRESULT EnumDataBreakpointsInAddrRange ([in] ADDRESS_TYPE FirstAddress, [in] ADDRESS_TYPE LastAddress, [out] IeXdiEnumDataBreakpoint **ppieXdiEnumDataBreakpoint);
  96. // HRESULT StartNotifyingRunChg ([in] IeXdiClientNotifyRunChg *pieXdiClientNotifyRunChg, [out] DWORD *pdwConnectionCookie);
  97. // HRESULT StopNotifyingRunChg ([in] DWORD dwConnectionCookie);
  98. // HRESULT ReadVirtualMemory ([in] ADDRESS_TYPE Address, [in] DWORD dwNbElemToRead, [in] BYTE bAccessWidth, [out, size_is(dwNbElemToRead * (((bAccessWidth - 1) >> 3) + 1))] BYTE *pbReadBuffer, [out] DWORD *pdwNbElementEffectRead);
  99. // HRESULT WriteVirtualMemory ([in] ADDRESS_TYPE Address, [in] DWORD dwNbElemToWrite, [in] BYTE bAccessWidth, [in, size_is(dwNbElemToWrite * (((bAccessWidth - 1) >> 3) + 1))] const BYTE *pbWriteBuffer, [out] DWORD *pdwNbElementEffectWritten);
  100. // HRESULT ReadPhysicalMemoryOrPeriphIO ([in] ADDRESS_TYPE Address, [in] BYTE bAddressSpace, [in] DWORD dwNbElemToRead, [in] BYTE bAccessWidth, [out, size_is(dwNbElemToRead * (((bAccessWidth - 1) >> 3) + 1))] BYTE *pbReadBuffer);
  101. // HRESULT WritePhysicalMemoryOrPeriphIO ([in] ADDRESS_TYPE Address, [in] BYTE bAddressSpace, [in] DWORD dwNbElemToWrite, [in] BYTE bAccessWidth, [in, size_is(dwNbElemToWrite * (((bAccessWidth - 1) >> 3) + 1))] const BYTE *pbWriteBuffer);
  102. // HRESULT StartNotifyingMemChg ([in] IeXdiClientNotifyMemChg *pieXdiClientNotifyMemChg, [out] DWORD *pdwConnectionCookie);
  103. // HRESULT StopNotifyingMemChg ([in] DWORD dwConnectionCookie);
  104. // HRESULT Ioctl ([in] DWORD dwBuffInSize, [in, size_is(dwBuffInSize)] const BYTE *pbBufferIn, [in] DWORD dwBuffOutSize, [out] DWORD *pdwEffectBuffOutSize, [out, size_is(dwBuffOutSize), length_is(*pdwEffectBuffOutSize)] BYTE *pbBufferOut);
  105. interface IeXdiClientNotifyMemChg;
  106. // HRESULT NotifyMemoryChange ([in] MEM_TYPE mtChanged, [in] ADDRESS_TYPE Address, [in] BYTE bAddressSpace, [in] DWORD dwNbElemChanged, [in] BYTE bAccessWidth);
  107. interface IeXdiClientNotifyRunChg;
  108. // HRESULT NotifyRunStateChange ([in] RUN_STATUS_TYPE ersCurrent, [in] HALT_REASON_TYPE ehrCurrent, [in] ADDRESS_TYPE CurrentExecAddress, [in] DWORD dwExceptionCode);
  109. // QI'ed interfaces (from IeXdiServer)
  110. interface IeXdiX86Context;
  111. // HRESULT GetContext ([in, out] PCONTEXT_X86 pContext);
  112. // HRESULT SetContext ([in] CONTEXT_X86 Context);
  113. interface IeXdiX86ExContext;
  114. // HRESULT GetContext ([in, out] PCONTEXT_X86_EX pContext);
  115. // HRESULT SetContext ([in] CONTEXT_X86_EX Context);
  116. interface IeXdiX86_64Context;
  117. // HRESULT GetContext ([in, out] PCONTEXT_X86_64 pContext);
  118. // HRESULT SetContext ([in] CONTEXT_X86_64 Context);
  119. interface IeXdiSHXContext;
  120. // HRESULT GetContext ([in, out] PCONTEXT_SHX pContext);
  121. // HRESULT SetContext ([in] CONTEXT_SHX Context);
  122. interface IeXdiMIPSContext;
  123. // HRESULT GetContext ([in, out] PCONTEXT_MIPS pContext);
  124. // HRESULT SetContext ([in] CONTEXT_MIPS Context);
  125. interface IeXdiARMContext;
  126. // HRESULT GetContext ([in, out] PCONTEXT_ARM pContext);
  127. // HRESULT SetContext ([in] CONTEXT_ARM Context);
  128. interface IeXdiPPCContext;
  129. // HRESULT GetContext ([in, out] PCONTEXT_PPC pContext);
  130. // HRESULT SetContext ([in] CONTEXT_PPC Context);
  131. interface IeXdiIA64Context;
  132. // HRESULT GetContext ([in, out] PEXDI_CONTEXT_IA64 pContext);
  133. // HRESULT SetContext ([in] EXDI_CONTEXT_IA64 Context);
  134. // Other interfaces
  135. interface IeXdiCodeBreakpoint;
  136. // HRESULT GetAttributes ([out] PADDRESS_TYPE pAddress, [out] PCBP_KIND pcbpk, [out] PMEM_TYPE pmt, [out] DWORD *pdwExecMode, [out] DWORD *pdwTotalBypassCount, [out] DWORD *pdwBypassedOccurences, [out] BOOL *pfEnabled);
  137. // HRESULT SetState ([in] BOOL fEnabled, [in] BOOL fResetBypassedOccurences);
  138. interface IeXdiDataBreakpoint;
  139. // HRESULT GetAttributes ([out] PADDRESS_TYPE pAddress, [out] PADDRESS_TYPE pAddressMask, [out] DWORD *pdwData, [out] DWORD *pdwDataMask, [out] BYTE *pbAccessWidth, [out] PMEM_TYPE pmt, [out] BYTE *pbAddressSpace, [out] PDATA_ACCESS_TYPE pda, [out] DWORD *pdwTotalBypassCount, [out] DWORD *pdwBypassedOccurences, [out] BOOL *pfEnabled);
  140. // HRESULT SetState ([in] BOOL fEnabled, [in] BOOL fResetBypassedOccurences);
  141. interface IeXdiEnumCodeBreakpoint;
  142. // HRESULT Next ([in] DWORD celt, [out, size_is(celt), length_is(*pceltFetched)] IeXdiCodeBreakpoint *apieXdiCodeBreakpoint[], [out] DWORD *pceltFetched);
  143. // HRESULT Skip ([in] DWORD celt);
  144. // HRESULT Reset (void);
  145. // HRESULT GetCount ([out] DWORD *pcelt);
  146. // HRESULT GetNext ([out] IeXdiCodeBreakpoint **ppieXdiCodeBreakpoint);
  147. // HRESULT DisableAll (void);
  148. // HRESULT EnableAll (void);
  149. interface IeXdiEnumDataBreakpoint;
  150. // HRESULT Next ([in] DWORD celt, [out, size_is(celt), length_is(*pceltFetched)] IeXdiDataBreakpoint *apieXdiDataBreakpoint[], [out] DWORD *pceltFetched);
  151. // HRESULT Skip ([in] DWORD celt);
  152. // HRESULT Reset (void);
  153. // HRESULT GetCount ([out] DWORD *pcelt);
  154. // HRESULT GetNext ([out] IeXdiDataBreakpoint **ppieXdiDataBreakpoint);
  155. // HRESULT DisableAll (void);
  156. // HRESULT EnableAll (void);
  157. //
  158. // error codes
  159. //
  160. cpp_quote("// Common eXDI HRESULT values:")
  161. cpp_quote("//")
  162. cpp_quote("#define FACILITY_EXDI (130)")
  163. cpp_quote("#define CUSTOMER_FLAG (1)")
  164. cpp_quote("//")
  165. cpp_quote("#define SEV_SUCCESS (0)")
  166. cpp_quote("#define SEV_INFORMATIONAL (1)")
  167. cpp_quote("#define SEV_WARNING (2)")
  168. cpp_quote("#define SEV_ERROR (3)")
  169. cpp_quote("//")
  170. cpp_quote("#define MAKE_EXDI_ERROR(ErrorCode,Severity) ((DWORD)(ErrorCode) | (FACILITY_EXDI << 16) | (CUSTOMER_FLAG << 29) | (Severity << 30))")
  171. cpp_quote("//")
  172. cpp_quote("// S_OK (0) // Operation successful")
  173. cpp_quote("#define EXDI_E_NOTIMPL MAKE_EXDI_ERROR (0x4001, SEV_ERROR) // Not implemented (in the specific conditions - could be implement for others - like Kernel Debugger inactive)")
  174. cpp_quote("#define EXDI_E_OUTOFMEMORY MAKE_EXDI_ERROR (0x000E, SEV_ERROR) // Failed to allocate necessary memory")
  175. cpp_quote("#define EXDI_E_INVALIDARG MAKE_EXDI_ERROR (0x0057, SEV_ERROR) // One or more arguments are invalid")
  176. cpp_quote("#define EXDI_E_ABORT MAKE_EXDI_ERROR (0x4004, SEV_ERROR) // Operation aborted")
  177. cpp_quote("#define EXDI_E_FAIL MAKE_EXDI_ERROR (0x4005, SEV_ERROR) // Unspecified failure")
  178. cpp_quote("#define EXDI_E_COMMUNICATION MAKE_EXDI_ERROR (0x0001, SEV_ERROR) // Communication error between host driver and target")
  179. cpp_quote("//")
  180. cpp_quote("#define EXDI_E_NOLASTEXCEPTION MAKE_EXDI_ERROR (0x0002, SEV_ERROR) // No exception occured already, cannot return last")
  181. cpp_quote("#define EXDI_I_TGTALREADYRUNNING MAKE_EXDI_ERROR (0x0003, SEV_INFORMATIONAL) // Indicates that the target was already running")
  182. cpp_quote("#define EXDI_I_TGTALREADYHALTED MAKE_EXDI_ERROR (0x0004, SEV_INFORMATIONAL) // Indicates that the target was already halted")
  183. cpp_quote("#define EXDI_E_TGTWASNOTHALTED MAKE_EXDI_ERROR (0x0005, SEV_ERROR) // The target was not halted (before Single Step command issued)")
  184. cpp_quote("#define EXDI_E_NORESAVAILABLE MAKE_EXDI_ERROR (0x0006, SEV_ERROR) // No resource available, cannot instanciate Breakpoint (in the kind requested)")
  185. cpp_quote("#define EXDI_E_NOREBOOTAVAIL MAKE_EXDI_ERROR (0x0007, SEV_ERROR) // The external reset is not available programatically to the probe")
  186. cpp_quote("#define EXDI_E_ACCESSVIOLATION MAKE_EXDI_ERROR (0x0008, SEV_ERROR) // Access violation on at least one element in address range specificified by the operation")
  187. cpp_quote("#define EXDI_E_CANNOTWHILETGTRUNNING MAKE_EXDI_ERROR (0x0009, SEV_ERROR) // Cannot proceed while target running. Operation not supported on the fly. Must halt the target first")
  188. cpp_quote("#define EXDI_E_USEDBYCONCURENTTHREAD MAKE_EXDI_ERROR (0x000A, SEV_ERROR) // Cannot proceed immediately because resource is already used by concurent thread. Recall later or call SetWaitOnConcurentUse (TRUE) - default")
  189. cpp_quote("#define EXDI_E_ADVISELIMIT MAKE_EXDI_ERROR (0x000D, SEV_ERROR) // The connection point has already reached its limit of connections and cannot accept any more")
  190. // 0x000E is used by EXDI_E_OUTOFMEMORY
  191. // From definition in winerror.h
  192. // Values are 32 bit values layed out as follows:
  193. //
  194. // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  195. // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  196. // +---+-+-+-----------------------+-------------------------------+
  197. // |Sev|C|R| Facility | Code |
  198. // +---+-+-+-----------------------+-------------------------------+
  199. // where
  200. // Sev - is the severity code
  201. // 00 - Success
  202. // 01 - Informational
  203. // 10 - Warning
  204. // 11 - Error
  205. // C - is the Customer code flag
  206. // R - is a reserved bit
  207. // Facility - is the facility code
  208. // Code - is the facility's status code
  209. // Already define the facility codes
  210. // FACILITY_WINDOWS 8
  211. // FACILITY_STORAGE 3
  212. // FACILITY_SSPI 9
  213. // FACILITY_SETUPAPI 15
  214. // FACILITY_RPC 1
  215. // FACILITY_WIN32 7
  216. // FACILITY_CONTROL 10
  217. // FACILITY_NULL 0
  218. // FACILITY_MSMQ 14
  219. // FACILITY_MEDIASERVER 13
  220. // FACILITY_INTERNET 12
  221. // FACILITY_ITF 4
  222. // FACILITY_DISPATCH 2
  223. // FACILITY_CERT 11
  224. /////////////////////////////////////////////////////////////////////////////
  225. /////////////////////////////////////////////////////////////////////////////
  226. //
  227. // IeXdiServer
  228. //
  229. /////////////////////////////////////////////////////////////////////////////
  230. /////////////////////////////////////////////////////////////////////////////
  231. /////////////////////////////////////////////////////////////////////////////
  232. // Run Control section of the Interface
  233. /////////////////////////////////////////////////////////////////////////////
  234. typedef __int64 ADDRESS_TYPE, *PADDRESS_TYPE;
  235. typedef unsigned __int64 DWORD64, *PDWORD64;
  236. // Used by field TargetProcessorFamily in GLOBAL_TARGET_INFO_STRUCT. This info is the strict necessary to enable the debugger to identify completely the target.
  237. const DWORD PROCESSOR_FAMILY_X86 = 0;
  238. const DWORD PROCESSOR_FAMILY_SH3 = 1;
  239. const DWORD PROCESSOR_FAMILY_SH4 = 2;
  240. const DWORD PROCESSOR_FAMILY_MIPS = 3;
  241. const DWORD PROCESSOR_FAMILY_ARM = 4;
  242. const DWORD PROCESSOR_FAMILY_PPC = 5;
  243. const DWORD PROCESSOR_FAMILY_IA64 = 8;
  244. const DWORD PROCESSOR_FAMILY_UNK = 0xFFFFFFFF; // unknown
  245. // Note: If the driver support multiple CPU families, this field should be PROCESSOR_FAMILY_UNK until the current processor in the target is clearly identified
  246. // For Context interface, the driver that support multiple CPU should return interface to all potentially supported interfaces but the interface should only positively respond to the one corresponding to the current CPU
  247. typedef
  248. struct _DEBUG_ACCESS_CAPABILITIES_STRUCT
  249. {
  250. BOOL fWriteCBPWhileRunning; // if TRUE, can set or clear code breakpoint while running (on the fly, no need to be halted)
  251. BOOL fReadCBPWhileRunning; // if TRUE, can read code breakpoint (list) while running (on the fly, no need to be halted)
  252. BOOL fWriteDBPWhileRunning; // if TRUE, can set or clear data breakpoint while running (on the fly, no need to be halted)
  253. BOOL fReadDBPWhileRunning; // if TRUE, can read data breakpoint (list) while running (on the fly, no need to be halted)
  254. BOOL fWriteVMWhileRunning; // if TRUE, can write virtual memory while running (on the fly, no need to be halted)
  255. BOOL fReadVMWhileRunning; // if TRUE, can read virtual memory while running (on the fly, no need to be halted)
  256. BOOL fWritePMWhileRunning; // if TRUE, can write physical memory or peripherical I/O while running (on the fly, no need to be halted)
  257. BOOL fReadPMWhileRunning; // if TRUE, can read physical memory or peripherical I/O while running (on the fly, no need to be halted)
  258. BOOL fWriteRegWhileRunning; // if TRUE, can write CPU / CP registers while running (on the fly, no need to be halted)
  259. BOOL fReadRegWhileRunning; // if TRUE, can read CPU / CP registers while running (on the fly, no need to be halted)
  260. }
  261. DEBUG_ACCESS_CAPABILITIES_STRUCT, *PDEBUG_ACCESS_CAPABILITIES_STRUCT;
  262. typedef
  263. struct _GLOBAL_TARGET_INFO_STRUCT
  264. {
  265. DWORD TargetProcessorFamily;
  266. DEBUG_ACCESS_CAPABILITIES_STRUCT dbc;
  267. LPOLESTR szTargetName;
  268. LPOLESTR szProbeName;
  269. }
  270. GLOBAL_TARGET_INFO_STRUCT, *PGLOBAL_TARGET_INFO_STRUCT;
  271. typedef
  272. enum _RUN_STATUS_TYPE
  273. {
  274. rsRunning, // The target is currently executing code
  275. rsHalted, // The target is completely stopped
  276. rsError, // The target is in an error state (warning: different than exception)
  277. rsUnknown
  278. }
  279. RUN_STATUS_TYPE, *PRUN_STATUS_TYPE;
  280. typedef
  281. enum _PHALT_REASON_TYPE
  282. {
  283. hrNone, // Status type is not rsHalted
  284. hrUser, // "Manual" asynchronous halt
  285. hrException, // An execption just occured
  286. hrBp, // Breakpoint (code or data)
  287. hrStep, // We just excuted a single / multiple / range step
  288. hrUnknown
  289. }
  290. HALT_REASON_TYPE, *PHALT_REASON_TYPE;
  291. typedef
  292. struct _EXCEPTION_TYPE
  293. {
  294. DWORD dwCode; // indicate type / source of exception (platfrom dependant)
  295. ADDRESS_TYPE Address; // program / instruction pointer where the exception occured
  296. } EXCEPTION_TYPE, *PEXCEPTION_TYPE; // Platform dependant
  297. typedef
  298. enum _CBP_KIND
  299. {
  300. cbptAlgo, // Let the probe driver decide if code breakpoint can be hw or sw based on resources available
  301. cbptHW, // Force the code breakpoint to be a hardware one (address comparator in hardware debug logic)
  302. cbptSW // Force the code breakpoint to be a software one (bp instruction replacing the regulare instruction)
  303. } CBP_KIND, *PCBP_KIND;
  304. typedef
  305. enum _DATA_ACCESS_TYPE
  306. {
  307. daWrite = 0,
  308. daRead = 1,
  309. daBoth = 2 // Don't care
  310. }
  311. DATA_ACCESS_TYPE, *PDATA_ACCESS_TYPE;
  312. typedef
  313. struct _BREAKPOINT_SUPPORT_TYPE
  314. {
  315. BOOL fCodeBpBypassCountSupported; // if TRUE, Bypass counter is supported on Code Breakpoint
  316. BOOL fDataBpBypassCountSupported; // if TRUE, Bypass counter is supported on Data Breakpoint
  317. BOOL fDataBpSupported; // if FALSE, no Data Breakpoint resource are ever available from the target
  318. BOOL fDataBpMaskableAddress; // if TRUE, Data Breakpoint address mask can be defined (implies that fDataBpSupported field is TRUE)
  319. BOOL fDataBpMaskableData; // if TRUE, Data Breakpoint data mask can be defined (implies that fDataBpSupported field is TRUE)
  320. BOOL fDataBpDataWidthSpecifiable; // if TRUE, Data Breakpoint specific data width can be defined (implies that fDataBpSupported field is TRUE)
  321. BOOL fDataBpReadWriteSpecifiable; // if TRUE, Data Breakpoint specific data access type can be defined (implies that fDataBpSupported field is TRUE)
  322. BOOL fDataBpDataMatchSupported; // if FALSE, data Breakpoint data field is always don't care, triggers only on address compare (data mask should always be 0 - fDataBpMaskableData is Don't care)
  323. } BREAKPOINT_SUPPORT_TYPE, *PBREAKPOINT_SUPPORT_TYPE;
  324. typedef
  325. enum _MEM_TYPE
  326. {
  327. mtVirtual,
  328. mtPhysicalOrPeriIO,
  329. mtContext
  330. } MEM_TYPE, *PMEM_TYPE;
  331. // Exception information
  332. // These are the actions which the debugger may take in response to an exception raised in the debuggee.
  333. typedef
  334. enum _EXCEPTION_DEFAULT_ACTION_TYPE
  335. {
  336. edaIgnore,
  337. edaNotify,
  338. edaStop
  339. } EXCEPTION_DEFAULT_ACTION_TYPE;
  340. typedef
  341. struct _EXCEPTION_DESCRIPTION_TYPE
  342. {
  343. DWORD dwExceptionCode;
  344. EXCEPTION_DEFAULT_ACTION_TYPE efd;
  345. wchar_t szDescription [60];
  346. } EXCEPTION_DESCRIPTION_TYPE;
  347. [
  348. object,
  349. uuid(47486F67-6461-6C65-5844-495352435201),
  350. helpstring("IeXdiServer interface - eXdi Server Run Control and Ressource Access 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  351. pointer_default(ref)
  352. ]
  353. interface IeXdiServer : IUnknown
  354. {
  355. /*++
  356. Routine Name:
  357. GetTargetInfo
  358. Routine Description:
  359. Return Global information on Target (and Probe / emulator)
  360. Argument(s):
  361. pgti - Returns Global Target Info structure
  362. Return Value:
  363. Error status:
  364. S_OK: Function successful
  365. EXDI_E_NOTIMPL: Not implemented
  366. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  367. EXDI_E_INVALIDARG: One or more arguments are invalid
  368. EXDI_E_ABORT: Operation aborted
  369. EXDI_E_FAIL: Unspecified failure
  370. EXDI_E_COMMUNICATION: Communication error between host driver and target
  371. --*/
  372. HRESULT GetTargetInfo
  373. (
  374. [out] PGLOBAL_TARGET_INFO_STRUCT pgti
  375. );
  376. // Used in parameter dwModeBitField of function SetDebugMode
  377. cpp_quote("#define DBGMODE_BFMASK_KERNEL (0x0001) // If TRUE indicates that Kernel Debugger is active (can use KDAPI), so HW on-chip debug functions (eXDI)")
  378. cpp_quote(" // may be optionaly handled (can return EXDI_E_NOTIMPL)")
  379. cpp_quote(" // If FALSE indicates that Kernel Debugger is not active so HW on-chip debug capabilities are the only ")
  380. cpp_quote(" // one available and should be implemented.")
  381. /*++
  382. Routine Name:
  383. SetDebugMode
  384. Routine Description:
  385. Indicates that the debugger can control the target via KDAPI (kernel debug capabilities)
  386. Argument(s):
  387. dwModeBitField - Bit field defining the new debug mode.
  388. Return Value:
  389. Error status:
  390. S_OK: Function successful
  391. EXDI_E_NOTIMPL: Not implemented
  392. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  393. EXDI_E_INVALIDARG: One or more arguments are invalid
  394. EXDI_E_ABORT: Operation aborted
  395. EXDI_E_FAIL: Unspecified failure
  396. EXDI_E_COMMUNICATION: Communication error between host driver and target
  397. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  398. --*/
  399. HRESULT SetDebugMode
  400. (
  401. [in] DWORD dwModeBitField
  402. );
  403. /*++
  404. Routine Name:
  405. GetExceptionDescriptionList
  406. Routine Description:
  407. Return the supported Exception Description Table
  408. Argument(s):
  409. dwNbElementToReturn - number of EXCEPTION_DESCRIPTION_TYPE elements to be provided in pedTable
  410. pedTable - Table of EXCEPTION_DESCRIPTION_TYPE elements (association between exception number / name / debugger action)
  411. pdwNbTotalExceptionInList - Returns the total number of EXCEPTION_DESCRIPTION_TYPE elements available
  412. Return Value:
  413. Error status:
  414. S_OK: Function successful
  415. EXDI_E_NOTIMPL: Not implemented
  416. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  417. EXDI_E_INVALIDARG: One or more arguments are invalid
  418. EXDI_E_ABORT: Operation aborted
  419. EXDI_E_FAIL: Unspecified failure
  420. EXDI_E_COMMUNICATION: Communication error between host driver and target
  421. --*/
  422. HRESULT GetExceptionDescriptionList
  423. (
  424. [in] DWORD dwNbElementToReturn,
  425. [out, size_is(dwNbElementToReturn)] EXCEPTION_DESCRIPTION_TYPE* pedTable,
  426. [out] DWORD *pdwNbTotalExceptionInList
  427. );
  428. /*++
  429. Routine Name:
  430. GetErrorDescription
  431. Routine Description:
  432. Return text description of an Error code returned by the eXDI driver
  433. Argument(s):
  434. pszLastErrorDesc - Returns the description of an error seen with the probe or target. This should mainly be used for debugging purposes.
  435. Return Value:
  436. Error status:
  437. S_OK: Function successful
  438. EXDI_E_NOTIMPL: Not implemented
  439. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  440. EXDI_E_INVALIDARG: One or more arguments are invalid
  441. EXDI_E_ABORT: Operation aborted
  442. EXDI_E_FAIL: Unspecified failure
  443. EXDI_E_COMMUNICATION: Communication error between host driver and target
  444. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  445. --*/
  446. HRESULT GetErrorDescription
  447. (
  448. [in] HRESULT ErrorCode,
  449. [out] LPOLESTR *pszErrorDesc
  450. );
  451. /*++
  452. Routine Name:
  453. SetWaitOnConcurentUse
  454. Routine Description:
  455. Set Wait on Concurent Use flag - if TRUE, if a driver function needs to access the a resource already used, the driver function should
  456. wait for availibility of resource before returning.
  457. - if FALSE, if a driver function needs to access the a resource already used, the driver function should
  458. return immediately with the EXDI_E_USEDBYCONCURENTTHREAD error code.
  459. Note: the default value for the flag (at initialization of the probe driver) is TRUE.
  460. Argument(s):
  461. fNewWaitOnConcurentUseFlag - New value to set the Wait on Concurent Use flag.
  462. Return Value:
  463. Error status:
  464. S_OK: Function successful
  465. EXDI_E_NOTIMPL: Not implemented
  466. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  467. EXDI_E_INVALIDARG: One or more arguments are invalid
  468. EXDI_E_ABORT: Operation aborted
  469. EXDI_E_FAIL: Unspecified failure
  470. EXDI_E_COMMUNICATION: Communication error between host driver and target
  471. --*/
  472. HRESULT SetWaitOnConcurentUse
  473. (
  474. [in] BOOL fNewWaitOnConcurentUseFlag
  475. );
  476. /*++
  477. Routine Name:
  478. GetRunStatus
  479. Routine Description:
  480. Return the current Run Status (Running, Stopped due to Breakpoint ...).
  481. Argument(s):
  482. persCurrent - Returns the current Run Status Type
  483. pehrCurrent - Returns the current Halt Reason Type (hrNone if Run Status is not Halted)
  484. pCurrentExecAddress - Returns the current program / instruction pointer if Run Status is Halted, undefined otherwise.
  485. pdwExceptionCode - Returns the type / source of exception (Code is platform dependant) if Halted due to exception ((rsHalted == *persCurrent) && (hrException == *pehrCurrent)), undefined otherwise.
  486. Return Value:
  487. Error status:
  488. S_OK: Function successful
  489. EXDI_E_NOTIMPL: Not implemented
  490. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  491. EXDI_E_INVALIDARG: One or more arguments are invalid
  492. EXDI_E_ABORT: Operation aborted
  493. EXDI_E_FAIL: Unspecified failure
  494. EXDI_E_COMMUNICATION: Communication error between host driver and target
  495. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  496. --*/
  497. HRESULT GetRunStatus
  498. (
  499. [out] PRUN_STATUS_TYPE persCurrent,
  500. [out] PHALT_REASON_TYPE pehrCurrent,
  501. [out] ADDRESS_TYPE *pCurrentExecAddress,
  502. [out] DWORD *pdwExceptionCode
  503. );
  504. /*++
  505. Routine Name:
  506. GetLastException
  507. Routine Description:
  508. Return the last exception that happened.
  509. Argument(s):
  510. pexLast - Returns the last exception that occured (if none return value is EXDI_E_NOLASTEXCEPTION)
  511. Return Value:
  512. Error status:
  513. S_OK: Function successful
  514. EXDI_E_NOLASTEXCEPTION: No exception occured already, cannot return last
  515. EXDI_E_NOTIMPL: Not implemented
  516. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  517. EXDI_E_INVALIDARG: One or more arguments are invalid
  518. EXDI_E_ABORT: Operation aborted
  519. EXDI_E_FAIL: Unspecified failure
  520. EXDI_E_COMMUNICATION: Communication error between host driver and target
  521. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  522. --*/
  523. HRESULT GetLastException
  524. (
  525. [out] PEXCEPTION_TYPE pexLast
  526. );
  527. /*++
  528. Routine Name:
  529. Run
  530. Routine Description:
  531. Command target to Run.
  532. Argument(s):
  533. none
  534. Return Value:
  535. Error status:
  536. S_OK: Function successful (and target was not already running)
  537. EXDI_I_TGTALREADYRUNNING: Indicates that the target was already running
  538. EXDI_E_NOTIMPL: Not implemented
  539. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  540. EXDI_E_ABORT: Operation aborted
  541. EXDI_E_FAIL: Unspecified failure
  542. EXDI_E_COMMUNICATION: Communication error between host driver and target
  543. --*/
  544. HRESULT Run
  545. (
  546. void
  547. );
  548. /*++
  549. Routine Name:
  550. Halt
  551. Routine Description:
  552. Command target to Halt (complete control unit freeze).
  553. Argument(s):
  554. none
  555. Return Value:
  556. Error status:
  557. S_OK: Function successful (and target was not already halted)
  558. EXDI_I_TGTALREADYHALTED: Indicates that the target was already halted
  559. EXDI_E_NOTIMPL: Not implemented
  560. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  561. EXDI_E_ABORT: Operation aborted
  562. EXDI_E_FAIL: Unspecified failure
  563. EXDI_E_COMMUNICATION: Communication error between host driver and target
  564. --*/
  565. HRESULT Halt
  566. (
  567. void
  568. );
  569. /*++
  570. Routine Name:
  571. DoSingleStep
  572. Routine Description:
  573. Command target to execute a single instruction and then halt again.
  574. Argument(s):
  575. none
  576. Return Value:
  577. Error status:
  578. S_OK: Function successful
  579. EXDI_E_TGTWASNOTHALTED: The target was not halted
  580. EXDI_E_NORESAVAILABLE: No Resource available to do Single Step (not direct on-chip support or no bp resource avail)
  581. If Single Step support not available, return this error code too
  582. EXDI_E_NOTIMPL: Not implemented
  583. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  584. EXDI_E_ABORT: Operation aborted
  585. EXDI_E_FAIL: Unspecified failure
  586. EXDI_E_COMMUNICATION: Communication error between host driver and target
  587. --*/
  588. HRESULT DoSingleStep
  589. (
  590. void
  591. );
  592. /*++
  593. Routine Name:
  594. DoMultipleStep
  595. Routine Description:
  596. Command target to execute a fixed number of instructions and then halt again.
  597. Note that the target may still be running when the call returns.
  598. Argument(s):
  599. dwNbInstructions - Number of instructions to execute.
  600. Return Value:
  601. Error status:
  602. S_OK: Function successful
  603. EXDI_E_TGTWASNOTHALTED: The target was not halted
  604. EXDI_E_NORESAVAILABLE: No Resource available to do Stepping (not direct on-chip support or no bp resource avail)
  605. If Multiple Step support not available, return this error code too
  606. EXDI_E_NOTIMPL: Not implemented
  607. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  608. EXDI_E_INVALIDARG: One or more arguments are invalid
  609. EXDI_E_ABORT: Operation aborted
  610. EXDI_E_FAIL: Unspecified failure
  611. EXDI_E_COMMUNICATION: Communication error between host driver and target
  612. --*/
  613. HRESULT DoMultipleStep
  614. (
  615. [in] DWORD dwNbInstructions
  616. );
  617. /*++
  618. Routine Name:
  619. DoRangeStep
  620. Routine Description:
  621. Command target to step out of an address range and then halt again (run while in the given range).
  622. Note that the target may still be running when the call returns.
  623. Argument(s):
  624. FirstAddress - First address of the address range to run out of.
  625. LastAddress - Last address of the address range to run out of.
  626. Return Value:
  627. Error status:
  628. S_OK: Function successful
  629. EXDI_E_TGTWASNOTHALTED: The target was not halted
  630. EXDI_E_NORESAVAILABLE: No Resource available to do Range Step (not direct on-chip support or no bp resource avail)
  631. If Range Step support not available, return this error code too
  632. EXDI_E_NOTIMPL: Not implemented
  633. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  634. EXDI_E_INVALIDARG: One or more arguments are invalid
  635. EXDI_E_ABORT: Operation aborted
  636. EXDI_E_FAIL: Unspecified failure
  637. EXDI_E_COMMUNICATION: Communication error between host driver and target
  638. --*/
  639. HRESULT DoRangeStep
  640. (
  641. [in] ADDRESS_TYPE FirstAddress,
  642. [in] ADDRESS_TYPE LastAddress
  643. );
  644. /*++
  645. Routine Name:
  646. Reboot
  647. Routine Description:
  648. Command target to reboot (external Reset).
  649. Argument(s):
  650. none
  651. Return Value:
  652. Error status:
  653. S_OK: Function successful
  654. EXDI_E_NOREBOOTAVAIL: The external reset is not available programatically to the probe
  655. EXDI_E_NOTIMPL: Not implemented
  656. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  657. EXDI_E_ABORT: Operation aborted
  658. EXDI_E_FAIL: Unspecified failure
  659. EXDI_E_COMMUNICATION: Communication error between host driver and target
  660. --*/
  661. HRESULT Reboot
  662. (
  663. void
  664. );
  665. /*++
  666. Routine Name:
  667. GetBpSupport
  668. Routine Description:
  669. Get Breakpoint support
  670. Argument(s):
  671. pbps - Returns a structure that describes the breakpoint setting capabilities
  672. Return Value:
  673. Error status:
  674. S_OK: Function successful
  675. EXDI_E_NOTIMPL: Not implemented
  676. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  677. EXDI_E_INVALIDARG: One or more arguments are invalid
  678. EXDI_E_ABORT: Operation aborted
  679. EXDI_E_FAIL: Unspecified failure
  680. EXDI_E_COMMUNICATION: Communication error between host driver and target
  681. --*/
  682. HRESULT GetBpSupport
  683. (
  684. [out] PBREAKPOINT_SUPPORT_TYPE pbps
  685. );
  686. /*++
  687. Routine Name:
  688. GetNbCodeBpAvail
  689. Routine Description:
  690. Get Code Breakpoint availability
  691. Argument(s):
  692. pdwNbHwCodeBpAvail - Returns the number of Hardware Code Breakpoint still available on the target.
  693. If no limit known, returns -1 (4294967295)
  694. Note: If Code Breakpoint support not available, returns 0 and Error Status S_OK
  695. pdwNbSwCodeBpAvail - Returns the number of Software Code Breakpoint still available on the target.
  696. If no limit known, returns -1 (4294967295)
  697. Note: If code Breakpoint support not available, returns 0 and Error Status S_OK
  698. Return Value:
  699. Error status:
  700. S_OK: Function successful
  701. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  702. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  703. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  704. EXDI_E_NOTIMPL: Not implemented
  705. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  706. EXDI_E_INVALIDARG: One or more arguments are invalid
  707. EXDI_E_ABORT: Operation aborted
  708. EXDI_E_FAIL: Unspecified failure
  709. EXDI_E_COMMUNICATION: Communication error between host driver and target
  710. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  711. --*/
  712. HRESULT GetNbCodeBpAvail
  713. (
  714. [out] DWORD *pdwNbHwCodeBpAvail,
  715. [out] DWORD *pdwNbSwCodeBpAvail
  716. );
  717. /*++
  718. Routine Name:
  719. GetNbDataBpAvail
  720. Routine Description:
  721. Get Data Breakpoint availability
  722. Argument(s):
  723. pdwNbDataBpAvail - Returns the number of Data Breakpoint still available on the target.
  724. If no limit known, returns -1 (4294967295)
  725. Note: If Data Breakpoint support not available, returns 0 and Error Status S_OK
  726. Return Value:
  727. Error status:
  728. S_OK: Function successful
  729. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  730. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  731. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadDBPWhileRunning
  732. EXDI_E_NOTIMPL: Not implemented
  733. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  734. EXDI_E_INVALIDARG: One or more arguments are invalid
  735. EXDI_E_ABORT: Operation aborted
  736. EXDI_E_FAIL: Unspecified failure
  737. EXDI_E_COMMUNICATION: Communication error between host driver and target
  738. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  739. --*/
  740. HRESULT GetNbDataBpAvail
  741. (
  742. [out] DWORD *pdwNbDataBpAvail
  743. );
  744. /*++
  745. Routine Name:
  746. AddCodeBreakpoint
  747. Routine Description:
  748. Add new code Breakpoint. The newly created breakpoint is initially disabled (can be enabled with *ppieXdiCodeBreakpoint->SetState(...))
  749. and so should not use any resources.
  750. Note: Although several client can keep track of the same breakpoint(s), this is not recommended for the fact that there is no bp change notification.
  751. Argument(s):
  752. Address - Address of the instruction to break on
  753. cbpk - Indicates if the code breakpoint must be hardware, software (bp instruction) or
  754. if the probe driver can decide based on its algorithm and resources available.
  755. Note: In the case of sw bp, the probe driver must keep track of instruction being replaced.
  756. mt - Instruction Memory type. Indicates whether this memory address concerns virtual memory or physical
  757. memory (pheripherical IO is not applicable and mtContext value is not accepted)
  758. dwExecMode - In the case of multiple mode processors, give a hint (if necessary) on the process mode at the
  759. time of the execution of the code where to set the breakpoint. For example, in the case of a
  760. software breakpoint, the trap instruction may be different in 16 bit mode than 32 bit mode on
  761. processors having the 2 modes (ARM and MIPS).
  762. Should be 0 for 32 bit mode (default). Should be 1 for 16 bit mode.
  763. dwTotalBypassCount - Total number of bypass before triggering a CPU halt on this breakpoint
  764. Note: Should be 0 if Total Bypass Count is not supported - see BREAKPOINT_SUPPORT_TYPE.fCodeBpBypassCountSupported
  765. ppieXdiCodeBreakpoint - Returns a pointer to the newly created breakpoint object's interface.
  766. Return Value:
  767. Error status:
  768. S_OK: Function successful
  769. EXDI_E_NORESAVAILABLE: No (Breakpoint) Resource available, cannot instanciate Breakpoint (in the kind requested)
  770. If Code Breakpoint support not available, also return this error code
  771. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  772. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  773. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  774. EXDI_E_NOTIMPL: Not implemented
  775. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  776. EXDI_E_INVALIDARG: One or more arguments are invalid
  777. EXDI_E_ABORT: Operation aborted
  778. EXDI_E_FAIL: Unspecified failure
  779. EXDI_E_COMMUNICATION: Communication error between host driver and target
  780. --*/
  781. HRESULT AddCodeBreakpoint
  782. (
  783. [in] ADDRESS_TYPE Address,
  784. [in] CBP_KIND cbpk,
  785. [in] MEM_TYPE mt,
  786. [in] DWORD dwExecMode,
  787. [in] DWORD dwTotalBypassCount,
  788. [out] IeXdiCodeBreakpoint **ppieXdiCodeBreakpoint
  789. );
  790. /*++
  791. Routine Name:
  792. DelCodeBreakpoint
  793. Routine Description:
  794. Delete existing code Breakpoint from driver internal list. The breakpoint will be automatically disabled (so any triggering resources will be remove).
  795. The breakpoint instance will be removed only when all references to it are released.
  796. Argument(s):
  797. pieXdiCodeBreakpoint - Pointer to breakpoint object's interface.
  798. Return Value:
  799. Error status:
  800. S_OK: Function successful
  801. EXDI_E_NORESAVAILABLE: No (Breakpoint) Resource available, cannot instanciate Breakpoint (in the kind requested)
  802. If Code Breakpoint support not available, also return this error code
  803. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  804. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  805. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  806. EXDI_E_NOTIMPL: Not implemented
  807. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  808. EXDI_E_INVALIDARG: One or more arguments are invalid
  809. EXDI_E_ABORT: Operation aborted
  810. EXDI_E_FAIL: Unspecified failure
  811. EXDI_E_COMMUNICATION: Communication error between host driver and target
  812. --*/
  813. HRESULT DelCodeBreakpoint
  814. (
  815. [in] IeXdiCodeBreakpoint *pieXdiCodeBreakpoint
  816. );
  817. /*++
  818. Routine Name:
  819. AddDataBreakpoint
  820. Routine Description:
  821. Add new data Breakpoint. The newly created breakpoint is initially disabled (can be enabled with *ppieXdiDataBreakpoint->SetState(...))
  822. and so should not use any resources.
  823. Note: Although several client can keep track of the same breakpoint(s), this is not recommended for the fact that there is no bp change notification.
  824. Note: This function does not support definition of multiple access data breakpoints (array of element, an element being a memory object contained in a single access).
  825. Argument(s):
  826. Address - Address of the data to be accessed to break on (only bits set in AddressMask are significant).
  827. AddressMask - Mask to apply on Address comparison on for matching bits (if bit set, do compare, otherwize ignore).
  828. Note: Should be -1 if Address Mask not supported by target, otherwize the probe driver should return EXDI_E_INVALIDARG error.
  829. dwData - Value of the Data to be accessed to break on (only bits set in DataMask are significant).
  830. dwDataMask - Mask to apply on Data comparison on for matching bits (if bit set, do compare, otherwize ignore).
  831. Note: Should be -1 (4294967295) if Data Mask not supported by target, otherwize the probe driver should return EXDI_E_INVALIDARG error.
  832. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, and other if supported by target - the maximum being 32 bits)
  833. Note: Should be -1 (255) for "DON'T CARE" meaning (to be ignored - any size triggers the BP) or
  834. if Data Width specification not supported by target, otherwize the probe driver should return EXDI_E_INVALIDARG error.
  835. mt - Data memory type. Indicates whether this memory address concerns virtual memory, physical memory or pheripherical IO (mtContext value is not accepted)
  836. bAddressSpace - Address space of the data breakpoint if mt is mtPhysicalOrPeriIO (convention: 0 = Physical Memory, 1 = Peripherical I/O if not memory mapped, 2..255 = free for custom use)
  837. da - Data Access type: Read access, Write access or both (don't care)
  838. Note: Should be 2 (daBoth) if Data Access type specification not supported by target, otherwize the probe driver should return EXDI_E_INVALIDARG error.
  839. dwTotalBypassCount - Total number of bypass before triggering a CPU halt on this breakpoint
  840. Note: Should be 0 if Total Bypass Count is not supported - see BREAKPOINT_SUPPORT_TYPE.fDataBpBypassCountSupported
  841. ppieXdiDataBreakpoint - Returns a pointer to the newly created breakpoint object's interface.
  842. Return Value:
  843. Error status:
  844. S_OK: Function successful
  845. EXDI_E_NORESAVAILABLE: No (Breakpoint) Resource available, cannot instanciate Breakpoint
  846. If Data Breakpoint support not available, also return this error code.
  847. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  848. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  849. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteDBPWhileRunning
  850. EXDI_E_NOTIMPL: Not implemented
  851. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  852. EXDI_E_INVALIDARG: One or more arguments are invalid
  853. EXDI_E_ABORT: Operation aborted
  854. EXDI_E_FAIL: Unspecified failure
  855. EXDI_E_COMMUNICATION: Communication error between host driver and target
  856. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  857. --*/
  858. HRESULT AddDataBreakpoint
  859. (
  860. [in] ADDRESS_TYPE Address,
  861. [in] ADDRESS_TYPE AddressMask,
  862. [in] DWORD dwData,
  863. [in] DWORD dwDataMask,
  864. [in] BYTE bAccessWidth,
  865. [in] MEM_TYPE mt,
  866. [in] BYTE bAddressSpace,
  867. [in] DATA_ACCESS_TYPE da,
  868. [in] DWORD dwTotalBypassCount,
  869. [out] IeXdiDataBreakpoint **ppieXdiDataBreakpoint
  870. );
  871. /*++
  872. Routine Name:
  873. DelDataBreakpoint
  874. Routine Description:
  875. Delete existing data Breakpoint from driver internal list. The breakpoint will be automatically disabled (so any triggering resources will be remove).
  876. The breakpoint instance will be removed only when all references to it are released.
  877. Argument(s):
  878. pieXdiDataBreakpoint - Pointer to breakpoint object's interface.
  879. Return Value:
  880. Error status:
  881. S_OK: Function successful
  882. EXDI_E_NORESAVAILABLE: No (Breakpoint) Resource available, cannot instanciate Breakpoint (in the kind requested)
  883. If Data Breakpoint support not available, also return this error code
  884. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  885. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  886. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  887. EXDI_E_NOTIMPL: Not implemented
  888. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  889. EXDI_E_INVALIDARG: One or more arguments are invalid
  890. EXDI_E_ABORT: Operation aborted
  891. EXDI_E_FAIL: Unspecified failure
  892. EXDI_E_COMMUNICATION: Communication error between host driver and target
  893. --*/
  894. HRESULT DelDataBreakpoint
  895. (
  896. [in] IeXdiDataBreakpoint *pieXdiDataBreakpoint
  897. );
  898. /*++
  899. Routine Name:
  900. EnumAllCodeBreakpoints
  901. Routine Description:
  902. Create an enumeration list of all instanciated code breakpoints and return a pointer to its interface.
  903. Argument(s):
  904. ppieXdiEnumCodeBreakpoint - Returns a pointer to the newly created enumation list of breakpoint object's interface.
  905. Return Value:
  906. Error status:
  907. S_OK: Function successful
  908. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  909. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  910. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  911. EXDI_E_NOTIMPL: Not implemented
  912. If Code Breakpoint support not available, also return this error code
  913. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  914. EXDI_E_INVALIDARG: One or more arguments are invalid
  915. EXDI_E_ABORT: Operation aborted
  916. EXDI_E_FAIL: Unspecified failure
  917. EXDI_E_COMMUNICATION: Communication error between host driver and target
  918. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  919. --*/
  920. HRESULT EnumAllCodeBreakpoints
  921. (
  922. [out] IeXdiEnumCodeBreakpoint **ppieXdiEnumCodeBreakpoint
  923. );
  924. /*++
  925. Routine Name:
  926. EnumAllDataBreakpoints
  927. Routine Description:
  928. Create an enumeration list of all instanciated data breakpoints and return a pointer to its interface.
  929. Argument(s):
  930. ppieXdiEnumDataBreakpoint - Returns a pointer to the newly created enumation list of breakpoint object's interface.
  931. Return Value:
  932. Error status:
  933. S_OK: Function successful
  934. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  935. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  936. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadDBPWhileRunning
  937. EXDI_E_NOTIMPL: Not implemented
  938. If Data Breakpoint support not available, also return this error data
  939. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  940. EXDI_E_INVALIDARG: One or more arguments are invalid
  941. EXDI_E_ABORT: Operation aborted
  942. EXDI_E_FAIL: Unspecified failure
  943. EXDI_E_COMMUNICATION: Communication error between host driver and target
  944. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  945. --*/
  946. HRESULT EnumAllDataBreakpoints
  947. (
  948. [out] IeXdiEnumDataBreakpoint **ppieXdiEnumDataBreakpoint
  949. );
  950. /*++
  951. Routine Name:
  952. EnumCodeBreakpointsInAddrRange
  953. Routine Description:
  954. Create an enumeration list of the instanciated code breakpoints which address are whithin given range, and return a pointer to its interface.
  955. Argument(s):
  956. FirstAddress - First address of the filtering address range
  957. LastAddress - Last address of the filtering address range
  958. ppieXdiEnumCodeBreakpoint - Returns a pointer to the newly created enumation list of breakpoint object's interface.
  959. Return Value:
  960. Error status:
  961. S_OK: Function successful
  962. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  963. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  964. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  965. EXDI_E_NOTIMPL: Not implemented
  966. If Code Breakpoint support not available, also return this error code
  967. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  968. EXDI_E_INVALIDARG: One or more arguments are invalid
  969. EXDI_E_ABORT: Operation aborted
  970. EXDI_E_FAIL: Unspecified failure
  971. EXDI_E_COMMUNICATION: Communication error between host driver and target
  972. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  973. --*/
  974. HRESULT EnumCodeBreakpointsInAddrRange
  975. (
  976. [in] ADDRESS_TYPE FirstAddress,
  977. [in] ADDRESS_TYPE LastAddress,
  978. [out] IeXdiEnumCodeBreakpoint **ppieXdiEnumCodeBreakpoint
  979. );
  980. /*++
  981. Routine Name:
  982. EnumDataBreakpointsInAddrRange
  983. Routine Description:
  984. Create an enumeration list of the instanciated data breakpoints which address are whithin given range, and return a pointer to its interface.
  985. Argument(s):
  986. FirstAddress - First address of the filtering address range
  987. LastAddress - Last address of the filtering address range
  988. ppieXdiEnumDataBreakpoint - Returns a pointer to the newly created enumation list of breakpoint object's interface.
  989. Return Value:
  990. Error status:
  991. S_OK: Function successful
  992. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  993. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  994. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadDBPWhileRunning
  995. EXDI_E_NOTIMPL: Not implemented
  996. If Data Breakpoint support not available, also return this error data
  997. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  998. EXDI_E_INVALIDARG: One or more arguments are invalid
  999. EXDI_E_ABORT: Operation aborted
  1000. EXDI_E_FAIL: Unspecified failure
  1001. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1002. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1003. --*/
  1004. HRESULT EnumDataBreakpointsInAddrRange
  1005. (
  1006. [in] ADDRESS_TYPE FirstAddress,
  1007. [in] ADDRESS_TYPE LastAddress,
  1008. [out] IeXdiEnumDataBreakpoint **ppieXdiEnumDataBreakpoint
  1009. );
  1010. /*++
  1011. Routine Name:
  1012. StartNotifyingRunChg
  1013. Routine Description:
  1014. Add new object in list of one to notify of a Run State change.
  1015. The driver will immediately do a AddRef() on the object before returning.
  1016. Argument(s):
  1017. pieXdiClientNotifyRunChg - advise sink: pointer to the IeXdiClientNotifyRunChg callback interface of the object to be notified by the driver
  1018. pdwConnectionCookie - Returns cookie to the callback connection just made. This can be used later by the driver to delete the connection
  1019. (using StopNotifyingRunChg). If the connection is not successfully established, this cookie value is not meaningfull.
  1020. Return Value:
  1021. Error status:
  1022. S_OK: Function successful
  1023. EXDI_E_ADVISELIMIT The connection point has already reached its limit of connections and cannot accept any more.
  1024. EXDI_E_NOTIMPL: Not implemented
  1025. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1026. EXDI_E_INVALIDARG: One or more arguments are invalid
  1027. EXDI_E_ABORT: Operation aborted
  1028. EXDI_E_FAIL: Unspecified failure
  1029. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1030. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1031. --*/
  1032. HRESULT StartNotifyingRunChg
  1033. (
  1034. [in] IeXdiClientNotifyRunChg *pieXdiClientNotifyRunChg,
  1035. [out] DWORD *pdwConnectionCookie
  1036. );
  1037. /*++
  1038. Routine Name:
  1039. StopNotifyingRunChg
  1040. Routine Description:
  1041. Remove object in list of one to notify of a Run State change.
  1042. The driver will immediately do a Release() on the object before returning.
  1043. Argument(s):
  1044. dwConnectionCookie - Cookie to the callback connection to cancel.
  1045. Return Value:
  1046. Error status:
  1047. S_OK: Function successful
  1048. EXDI_E_NOTIMPL: Not implemented
  1049. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1050. EXDI_E_INVALIDARG: One or more arguments are invalid
  1051. EXDI_E_ABORT: Operation aborted
  1052. EXDI_E_FAIL: Unspecified failure
  1053. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1054. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1055. --*/
  1056. HRESULT StopNotifyingRunChg
  1057. (
  1058. [in] DWORD dwConnectionCookie
  1059. );
  1060. /////////////////////////////////////////////////////////////////////////////
  1061. // Memory, I/O and Register Access section of the Interface
  1062. /////////////////////////////////////////////////////////////////////////////
  1063. /*++
  1064. Routine Name:
  1065. ReadVirtualMemory
  1066. Routine Description:
  1067. Read Virtual Memory block. This is the default memory read.
  1068. Note: The memory content returned to this function should be "sanitized" (compensated for the artefacts of
  1069. software breakpoints - or of any other modifications of the memory produced by the debugging activity of
  1070. the driver, probe or target). In general, the driver internal mechanism should be transparent to the client.
  1071. Argument(s):
  1072. Address - Starting address of the data buffer to be accessed on the target.
  1073. dwNbElemToRead - Number of element(s) (of byDataWidth bits) to be accessed.
  1074. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  1075. pbReadBuffer - Buffer (of bytes) on which result of reading is written. Must be large enough to hold all elements returned (pdwNbElementEffectRead)
  1076. Note: Elements must be aligned on byte boundary. Bit padding must be added if byDataWidth is not multiple of 8.
  1077. pdwNbElementEffectRead - Returns the number of element effectively read. This is used by the client to speed up in case of access
  1078. violation (EXDI_E_ACCESSVIOLATION) in the range: If an entire range is not accessible, this returned value should be 0,
  1079. so there is no need to query the range with smaller granularity.
  1080. Return Value:
  1081. Error status:
  1082. S_OK: Function successful
  1083. EXDI_E_ACCESSVIOLATION: Access violation on at least one element in address range specificified by the operation
  1084. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1085. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1086. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadVMWhileRunning
  1087. EXDI_E_NOTIMPL: Not implemented
  1088. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1089. EXDI_E_INVALIDARG: One or more arguments are invalid
  1090. EXDI_E_ABORT: Operation aborted
  1091. EXDI_E_FAIL: Unspecified failure
  1092. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1093. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1094. --*/
  1095. HRESULT ReadVirtualMemory
  1096. (
  1097. [in] ADDRESS_TYPE Address,
  1098. [in] DWORD dwNbElemToRead,
  1099. [in] BYTE bAccessWidth,
  1100. [out, size_is(dwNbElemToRead * (((bAccessWidth - 1) >> 3) + 1))] BYTE *pbReadBuffer,
  1101. [out] DWORD *pdwNbElementEffectRead
  1102. );
  1103. /*++
  1104. Routine Name:
  1105. WriteVirtualMemory
  1106. Routine Description:
  1107. Write Virtual Memory block. This is the default memory write.
  1108. Note: The memory content provided to this function should be "sanitized" (compensated for the artefacts of
  1109. software breakpoints - or of any other modifications of the memory produced by the debugging activity of
  1110. the driver, probe or target). In general, the driver internal mechanism should be transparent to the client.
  1111. Argument(s):
  1112. Address - Starting address of the data buffer to be accessed on the target.
  1113. dwNbElemToWrite - Number of element(s) (of byDataWidth bits) to be accessed.
  1114. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  1115. pbWriteBuffer - Buffer (of bytes) on which result of writing is written. Must be large enough to hold all elements (dwNbElemToWrite)
  1116. Note: Elements must be aligned on byte boundary. Bit padding must be added if byDataWidth is not multiple of 8.
  1117. pdwNbElementEffectWritten - Returns the number of element effectively written. This is used by the client to speed up in case of access
  1118. violation (EXDI_E_ACCESSVIOLATION) in the range: If an entire range is not accessible, this returned value should be 0,
  1119. so there is no need to query the range with smaller granularity.
  1120. Return Value:
  1121. Error status:
  1122. S_OK: Function successful
  1123. EXDI_E_ACCESSVIOLATION: Access violation on at least one element in address range specificified by the operation
  1124. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1125. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1126. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteVMWhileRunning
  1127. EXDI_E_NOTIMPL: Not implemented
  1128. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1129. EXDI_E_INVALIDARG: One or more arguments are invalid
  1130. EXDI_E_ABORT: Operation aborted
  1131. EXDI_E_FAIL: Unspecified failure
  1132. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1133. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1134. --*/
  1135. HRESULT WriteVirtualMemory
  1136. (
  1137. [in] ADDRESS_TYPE Address,
  1138. [in] DWORD dwNbElemToWrite,
  1139. [in] BYTE bAccessWidth,
  1140. [in, size_is(dwNbElemToWrite * (((bAccessWidth - 1) >> 3) + 1))] const BYTE *pbWriteBuffer,
  1141. [out] DWORD *pdwNbElementEffectWritten
  1142. );
  1143. /*++
  1144. Routine Name:
  1145. ReadPhysicalMemoryOrPeriphIO
  1146. Routine Description:
  1147. Read block of data to Physical Memory or peripherical I/O.
  1148. Note: The memory content returned to this function should be "sanitized" (compensated for the artefacts of
  1149. software breakpoints - or of any other modifications of the memory produced by the debugging activity of
  1150. the driver, probe or target). In general, the driver internal mechanism should be transparent to the client.
  1151. Argument(s):
  1152. Address - Starting address of the data buffer to be accessed on the target.
  1153. bAddressSpace - Address space to be accessed (convention: 0 = Physical Memory, 1 = Peripherical I/O if not memory mapped, 2..255 = free for custom use)
  1154. dwNbElemToRead - Number of element(s) (of byDataWidth bits) to be accessed.
  1155. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  1156. pbReadBuffer - Buffer (of bytes) on which result of reading is written. Must be large enough to hold all elements (dwNbElemToRead)
  1157. Note: Elements must be aligned on byte boundary. Bit padding must be added if byDataWidth is not multiple of 8.
  1158. Return Value:
  1159. Error status:
  1160. S_OK: Function successful
  1161. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1162. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1163. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadPMWhileRunning
  1164. EXDI_E_NOTIMPL: Not implemented
  1165. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1166. EXDI_E_INVALIDARG: One or more arguments are invalid
  1167. EXDI_E_ABORT: Operation aborted
  1168. EXDI_E_FAIL: Unspecified failure
  1169. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1170. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1171. --*/
  1172. HRESULT ReadPhysicalMemoryOrPeriphIO
  1173. (
  1174. [in] ADDRESS_TYPE Address,
  1175. [in] BYTE bAddressSpace,
  1176. [in] DWORD dwNbElemToRead,
  1177. [in] BYTE bAccessWidth,
  1178. [out, size_is(dwNbElemToRead * (((bAccessWidth - 1) >> 3) + 1))] BYTE *pbReadBuffer
  1179. );
  1180. /*++
  1181. Routine Name:
  1182. WritePhysicalMemoryOrPeriphIO
  1183. Routine Description:
  1184. Write block of data to Physical Memory or peripherical I/O.
  1185. Note: The memory content provided to this function should be "sanitized" (compensated for the artefacts of
  1186. software breakpoints - or of any other modifications of the memory produced by the debugging activity of
  1187. the driver, probe or target). In general, the driver internal mechanism should be transparent to the client.
  1188. Argument(s):
  1189. Address - Starting address of the data buffer to be accessed on the target.
  1190. bAddressSpace - Address space to be accessed (convention: 0 = Physical Memory, 1 = Peripherical I/O if not memory mapped, 2..255 = free for custom use)
  1191. dwNbElemToWrite - Number of element(s) (of byDataWidth bits) to be accessed.
  1192. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  1193. pbWriteBuffer - Buffer (of bytes) on which result of writing is written. Must be large enough to hold all elements (dwNbElemToWrite)
  1194. Note: Elements must be aligned on byte boundary. Bit padding must be added if byDataWidth is not multiple of 8.
  1195. Return Value:
  1196. Error status:
  1197. S_OK: Function successful
  1198. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1199. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1200. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWritePMWhileRunning
  1201. EXDI_E_NOTIMPL: Not implemented
  1202. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1203. EXDI_E_INVALIDARG: One or more arguments are invalid
  1204. EXDI_E_ABORT: Operation aborted
  1205. EXDI_E_FAIL: Unspecified failure
  1206. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1207. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1208. --*/
  1209. HRESULT WritePhysicalMemoryOrPeriphIO
  1210. (
  1211. [in] ADDRESS_TYPE Address,
  1212. [in] BYTE bAddressSpace,
  1213. [in] DWORD dwNbElemToWrite,
  1214. [in] BYTE bAccessWidth,
  1215. [in, size_is(dwNbElemToWrite * (((bAccessWidth - 1) >> 3) + 1))] const BYTE *pbWriteBuffer
  1216. );
  1217. /*++
  1218. Routine Name:
  1219. StartNotifyingMemChg
  1220. Routine Description:
  1221. Add new object in list of one to notify of a Memory, I/O and Register Access.
  1222. The driver will immediately do a AddRef() on the object before returning.
  1223. Note: This call back method is used to notify of memory changes due to other debugger instances
  1224. but not due to target code execution. It is meant to give the debugger the possibility to invalidate
  1225. its cache of the target memory content. Consequently, no mem change notification should normally
  1226. be sent while the target is running and the debugger should also invalidate its cache of the target
  1227. based on the run status change notification.
  1228. Argument(s):
  1229. pieXdiClientNotifyMemChg - advise sink: pointer to the IeXdiClientNotifyMemChg callback interface of the object to be notified by the driver
  1230. pdwConnectionCookie - Returns cookie to the callback connection just made. This can be used later by the driver to delete the connection
  1231. (using StopNotifyingMemChg). If the connection is not successfully established, this cookie value is not meaningfull.
  1232. Return Value:
  1233. Error status:
  1234. S_OK: Function successful
  1235. EXDI_E_ADVISELIMIT The connection point has already reached its limit of connections and cannot accept any more.
  1236. EXDI_E_NOTIMPL: Not implemented
  1237. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1238. EXDI_E_INVALIDARG: One or more arguments are invalid
  1239. EXDI_E_ABORT: Operation aborted
  1240. EXDI_E_FAIL: Unspecified failure
  1241. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1242. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1243. --*/
  1244. HRESULT StartNotifyingMemChg
  1245. (
  1246. [in] IeXdiClientNotifyMemChg *pieXdiClientNotifyMemChg,
  1247. [out] DWORD *pdwConnectionCookie
  1248. );
  1249. /*++
  1250. Routine Name:
  1251. StopNotifyingMemChg
  1252. Routine Description:
  1253. Remove object in list of one to notify of a Memory, I/O and Register Access.
  1254. The driver will immediately do a Release() on the object before returning.
  1255. Argument(s):
  1256. dwConnectionCookie - Cookie to the callback connection to cancel.
  1257. Return Value:
  1258. Error status:
  1259. S_OK: Function successful
  1260. EXDI_E_NOTIMPL: Not implemented
  1261. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1262. EXDI_E_INVALIDARG: One or more arguments are invalid
  1263. EXDI_E_ABORT: Operation aborted
  1264. EXDI_E_FAIL: Unspecified failure
  1265. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1266. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1267. --*/
  1268. HRESULT StopNotifyingMemChg
  1269. (
  1270. [in] DWORD dwConnectionCookie
  1271. );
  1272. /////////////////////////////////////////////////////////////////////////////
  1273. // IoCtl (back door - non formated api) section of the Interface
  1274. /////////////////////////////////////////////////////////////////////////////
  1275. /*++
  1276. Routine Name:
  1277. Ioctl
  1278. Routine Description:
  1279. Back door / non formated interface.
  1280. Argument(s):
  1281. dwBuffInSize - Size in byte of *pbyBufferIn
  1282. pbBufferIn - Raw byte buffer to hold input parameter(s)
  1283. dwBuffOutSize - Size in byte of *pbyBufferOut
  1284. pdwEffectBuffOutSize - Returns effective size in byte of *pbyBufferOut (must be smaller than dwBuffOutSize)
  1285. pbBufferOut - Raw byte buffer to hold output parameter(s)
  1286. Return Value:
  1287. Error status:
  1288. S_OK: Function successful
  1289. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed requested operation while target running. Must halt the target first.
  1290. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1291. see DEBUG_ACCESS_CAPABILITIES_STRUCT (flag depends on operation requested)
  1292. EXDI_E_NOTIMPL: Not implemented
  1293. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1294. EXDI_E_INVALIDARG: One or more arguments are invalid
  1295. EXDI_E_ABORT: Operation aborted
  1296. EXDI_E_FAIL: Unspecified failure
  1297. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1298. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1299. --*/
  1300. HRESULT Ioctl
  1301. (
  1302. [in] DWORD dwBuffInSize,
  1303. [in, size_is(dwBuffInSize)] const BYTE *pbBufferIn,
  1304. [in] DWORD dwBuffOutSize,
  1305. [out] DWORD *pdwEffectBuffOutSize,
  1306. [out, size_is(dwBuffOutSize), length_is(*pdwEffectBuffOutSize)] BYTE *pbBufferOut
  1307. );
  1308. }; // interface IeXdiServer
  1309. /////////////////////////////////////////////////////////////////////////////
  1310. /////////////////////////////////////////////////////////////////////////////
  1311. //
  1312. // IeXdiCodeBreakpoint
  1313. //
  1314. /////////////////////////////////////////////////////////////////////////////
  1315. /////////////////////////////////////////////////////////////////////////////
  1316. /////////////////////////////////////////////////////////////////////////////
  1317. // Code Breakpoint Interface
  1318. /////////////////////////////////////////////////////////////////////////////
  1319. [
  1320. object,
  1321. uuid(47486F67-6461-6C65-5844-495342507401),
  1322. helpstring("IeXdiCodeBreakpoint interface - eXdi Server Code Breakpoint 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1323. pointer_default(ref)
  1324. ]
  1325. interface IeXdiCodeBreakpoint : IUnknown
  1326. {
  1327. // Note: Release() automatically Disable BP (and free resources)
  1328. /*++
  1329. Routine Name:
  1330. GetAttributes
  1331. Routine Description:
  1332. Get Code Breakpoint current characteristics.
  1333. Argument(s):
  1334. pAddress - Returns address of the instruction to be accessed to break on.
  1335. pcbpk - Returns the kind of code breakpoint (hardware, software (bp instruction) or if the probe driver
  1336. can decide based on its algorithm and resources available).
  1337. Note: In the case of sw bp, the probe driver must keep track of instruction being replaced.
  1338. pmt - Returns Instruction memory type. Indicates whether this memory address concerns virtual memory or physical
  1339. memory (pheripherical IO not applicable and mtContext value is not accepted)
  1340. pdwExecMode - Returns processor execution mode. In the case of multiple mode processors, this gives a hint
  1341. (if necessary) on the process mode at the time of the execution of the code where the breakpoint is set.
  1342. For example, in the case of a software breakpoint, the trap instruction may be different in 16 bit mode
  1343. than 32 bit mode on processors having the 2 modes (ARM and MIPS).
  1344. Should be 0 for 32 bit mode (default). Should be 1 for 16 bit mode.
  1345. pdwTotalBypassCount - Returns the number of time the trigger of a CPU halt should be bypassed if the breakpoint condition is met.
  1346. pdwBypassedOccurences - Returns the number of occurences of bypass related to this breakpoint already seen. Note: initial value (always if not supported) is 0
  1347. Note: this value is reset to 0 everytime the CPU is halted due to this breakpoint.
  1348. pfEnabled - Returns TRUE if Breakpoint is enabled. Note: default value at creation is FALSE
  1349. Return Value:
  1350. Error status:
  1351. S_OK: Function successful
  1352. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1353. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1354. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1355. EXDI_E_NOTIMPL: Not implemented
  1356. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1357. EXDI_E_INVALIDARG: One or more arguments are invalid
  1358. EXDI_E_ABORT: Operation aborted
  1359. EXDI_E_FAIL: Unspecified failure
  1360. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1361. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1362. --*/
  1363. HRESULT GetAttributes
  1364. (
  1365. [out] PADDRESS_TYPE pAddress,
  1366. [out] PCBP_KIND pcbpk,
  1367. [out] PMEM_TYPE pmt,
  1368. [out] DWORD *pdwExecMode,
  1369. [out] DWORD *pdwTotalBypassCount,
  1370. [out] DWORD *pdwBypassedOccurences,
  1371. [out] BOOL *pfEnabled
  1372. );
  1373. /*++
  1374. Routine Name:
  1375. SetState
  1376. Routine Description:
  1377. Enable or Disable Breakpoint.
  1378. Note: this function should free (in case of disable) or (re)allocate (in case of enable) breakpoint triggering resource if applicable
  1379. Argument(s):
  1380. fEnabled - TRUE if Breakpoint is enabled.
  1381. fResetBypassedOccurences - Reset the number of occurences of bypass related to this breakpoint already seen.
  1382. Note: this action is equivalent to the reset implicitely done everytime the CPU is halted due to this breakpoint.
  1383. Note: if this bypass counting feature is not supported, the value of this parameter is don't care
  1384. Return Value:
  1385. Error status:
  1386. S_OK: Function successful
  1387. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1388. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1389. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1390. EXDI_E_NOTIMPL: Not implemented
  1391. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1392. EXDI_E_INVALIDARG: One or more arguments are invalid
  1393. EXDI_E_ABORT: Operation aborted
  1394. EXDI_E_FAIL: Unspecified failure
  1395. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1396. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1397. --*/
  1398. HRESULT SetState
  1399. (
  1400. [in] BOOL fEnabled,
  1401. [in] BOOL fResetBypassedOccurences
  1402. );
  1403. }; // IeXdiCodeBreakpoint
  1404. /////////////////////////////////////////////////////////////////////////////
  1405. /////////////////////////////////////////////////////////////////////////////
  1406. //
  1407. // IeXdiDataBreakpoint
  1408. //
  1409. /////////////////////////////////////////////////////////////////////////////
  1410. /////////////////////////////////////////////////////////////////////////////
  1411. /////////////////////////////////////////////////////////////////////////////
  1412. // Data Breakpoint Interface
  1413. /////////////////////////////////////////////////////////////////////////////
  1414. [
  1415. object,
  1416. uuid(47486F67-6461-6C65-5844-495357507400),
  1417. helpstring("IeXdiDataBreakpoint interface - eXdi Server Data Breakpoint 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1418. pointer_default(ref)
  1419. ]
  1420. interface IeXdiDataBreakpoint : IUnknown
  1421. {
  1422. // Note: Release() automatically Disable BP (and free resources)
  1423. /*++
  1424. Routine Name:
  1425. GetAttributes
  1426. Routine Description:
  1427. Get Data Breakpoint current characteristics.
  1428. Argument(s):
  1429. pAddress - Returns address of the data to be accessed to break on (only bits set in AddressMask are significant).
  1430. pAddressMask - Returns mask to apply on Address comparison on for matching bits (if bit set, do compare, otherwize ignore).
  1431. Note: Returns -1 if Address Mask not supported by target.
  1432. pdwData - Returns value of the Data to be accessed to break on (only bits set in DataMask are significant).
  1433. pdwDataMask - Returns mask to apply on Data comparison on for matching bits (if bit set, do compare, otherwize ignore).
  1434. Note: Returns -1 (4294967295) if Data Mask not supported by target.
  1435. pbAccessWidth - Returns Data Width in bits (byte=8, word=16, dword=32, and other if supported by target - the maximum being 32 bits)
  1436. Note: Returns -1 (255) if Data Width specification not supported by target.
  1437. pmt - Returns Data memory type. Indicates whether this memory address concerns virtual memory, physical memory or pheripherical IO
  1438. (mtContext value is not accepted)
  1439. pbAddressSpace - Returns Address space of the data breakpoint if mt is mtPhysicalOrPeriIO (convention: 0 = Physical Memory, 1 = Peripherical I/O
  1440. if not memory mapped, 2..255 = free for custom use)
  1441. pda - Returns Data Access type: Read access, Write access or both (don't care)
  1442. Note: Returns 2 (daBoth) if Data Access type specification not supported by target.
  1443. pdwTotalBypassCount - Returns the number of time the trigger of a CPU halt should be bypassed if the breakpoint condition is met.
  1444. pdwBypassedOccurences - Returns the number of occurences of bypass related to this breakpoint already seen. Note: initial value (always if not supported) is 0
  1445. Note: this value is reset to 0 everytime the CPU is halted due to this breakpoint.
  1446. pfEnabled - Returns TRUE if Breakpoint is enabled. Note: default value at creation is FALSE
  1447. Return Value:
  1448. Error status:
  1449. S_OK: Function successful
  1450. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1451. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1452. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadDBPWhileRunning
  1453. EXDI_E_NOTIMPL: Not implemented
  1454. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1455. EXDI_E_INVALIDARG: One or more arguments are invalid
  1456. EXDI_E_ABORT: Operation aborted
  1457. EXDI_E_FAIL: Unspecified failure
  1458. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1459. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1460. --*/
  1461. HRESULT GetAttributes
  1462. (
  1463. [out] PADDRESS_TYPE pAddress,
  1464. [out] PADDRESS_TYPE pAddressMask,
  1465. [out] DWORD *pdwData,
  1466. [out] DWORD *pdwDataMask,
  1467. [out] BYTE *pbAccessWidth,
  1468. [out] PMEM_TYPE pmt,
  1469. [out] BYTE *pbAddressSpace,
  1470. [out] PDATA_ACCESS_TYPE pda,
  1471. [out] DWORD *pdwTotalBypassCount,
  1472. [out] DWORD *pdwBypassedOccurences,
  1473. [out] BOOL *pfEnabled
  1474. );
  1475. /*++
  1476. Routine Name:
  1477. SetState
  1478. Routine Description:
  1479. Enable or Disable Breakpoint.
  1480. Note: this function should free (in case of disable) or (re)allocate (in case of enable) breakpoint triggering resource if applicable
  1481. Argument(s):
  1482. fEnabled - TRUE if Breakpoint is enabled.
  1483. fResetBypassedOccurences - Reset the number of occurences of bypass related to this breakpoint already seen.
  1484. Note: this action is equivalent to the reset implicitely done everytime the CPU is halted due to this breakpoint.
  1485. Note: if this bypass counting feature is not supported, the value of this parameter is don't care
  1486. Return Value:
  1487. Error status:
  1488. S_OK: Function successful
  1489. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1490. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1491. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1492. EXDI_E_NOTIMPL: Not implemented
  1493. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1494. EXDI_E_INVALIDARG: One or more arguments are invalid
  1495. EXDI_E_ABORT: Operation aborted
  1496. EXDI_E_FAIL: Unspecified failure
  1497. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1498. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1499. --*/
  1500. HRESULT SetState
  1501. (
  1502. [in] BOOL fEnabled,
  1503. [in] BOOL fResetBypassedOccurences
  1504. );
  1505. }; // IeXdiDataBreakpoint
  1506. /////////////////////////////////////////////////////////////////////////////
  1507. /////////////////////////////////////////////////////////////////////////////
  1508. //
  1509. // IeXdiEnumCodeBreakpoint
  1510. //
  1511. /////////////////////////////////////////////////////////////////////////////
  1512. /////////////////////////////////////////////////////////////////////////////
  1513. // Code Breakpoint Enumeration List interface
  1514. [
  1515. object,
  1516. uuid(47486F67-6461-6C65-5844-495345425074),
  1517. helpstring("IeXdiEnumCodeBreakpoint interface - eXdi Server Enumerate Code Breakpoint 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1518. pointer_default(ref)
  1519. ]
  1520. interface IeXdiEnumCodeBreakpoint : IUnknown
  1521. {
  1522. /*++
  1523. Routine Name:
  1524. Next
  1525. Routine Description:
  1526. Get an array of a given number (celt requested - *pceltFetched actual) of pointers
  1527. to the next (from current position) Code Breakpoint objects in the enumerated list
  1528. Argument(s):
  1529. celt - Requested number of Code Breakpoint object pointers to be returned.
  1530. apieXdiCodeBreakpoint - Returns array of Code Breakpoint objects' interface pointers.
  1531. pceltFetched - Returns the actual number of pointers returned in rgelt
  1532. Return Value:
  1533. Error status:
  1534. S_OK: Function successful
  1535. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1536. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1537. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1538. EXDI_E_NOTIMPL: Not implemented
  1539. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1540. EXDI_E_INVALIDARG: One or more arguments are invalid
  1541. EXDI_E_ABORT: Operation aborted
  1542. EXDI_E_FAIL: Unspecified failure
  1543. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1544. --*/
  1545. HRESULT Next
  1546. (
  1547. [in] DWORD celt,
  1548. [out, size_is(celt), length_is(*pceltFetched)] IeXdiCodeBreakpoint *apieXdiCodeBreakpoint[],
  1549. [out] DWORD *pceltFetched
  1550. );
  1551. /*++
  1552. Routine Name:
  1553. Skip
  1554. Routine Description:
  1555. Skip a given number (celt) of Code Breakpoint objects next (from current position) in the enumerated list
  1556. Argument(s):
  1557. celt - Requested number of Code Breakpoint objects to be skipped.
  1558. Return Value:
  1559. Error status:
  1560. S_OK: Function successful
  1561. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1562. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1563. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1564. EXDI_E_NOTIMPL: Not implemented
  1565. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1566. EXDI_E_INVALIDARG: One or more arguments are invalid
  1567. EXDI_E_ABORT: Operation aborted
  1568. EXDI_E_FAIL: Unspecified failure
  1569. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1570. --*/
  1571. HRESULT Skip
  1572. (
  1573. [in] DWORD celt
  1574. );
  1575. /*++
  1576. Routine Name:
  1577. Reset
  1578. Routine Description:
  1579. Reset the current position in the enumerated list to first Code Breakpoint object
  1580. Argument(s):
  1581. none
  1582. Return Value:
  1583. Error status:
  1584. S_OK: Function successful
  1585. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1586. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1587. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1588. EXDI_E_NOTIMPL: Not implemented
  1589. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1590. EXDI_E_ABORT: Operation aborted
  1591. EXDI_E_FAIL: Unspecified failure
  1592. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1593. --*/
  1594. HRESULT Reset
  1595. (
  1596. void
  1597. );
  1598. /*++
  1599. Routine Name:
  1600. GetCount
  1601. Routine Description:
  1602. Gives the total number of Code Breakpoint objects in the enumerated list
  1603. Argument(s):
  1604. pcelt - Returns total number of Code Breakpoint objects in the enumerated list.
  1605. Return Value:
  1606. Error status:
  1607. S_OK: Function successful
  1608. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1609. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1610. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1611. EXDI_E_NOTIMPL: Not implemented
  1612. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1613. EXDI_E_INVALIDARG: One or more arguments are invalid
  1614. EXDI_E_ABORT: Operation aborted
  1615. EXDI_E_FAIL: Unspecified failure
  1616. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1617. --*/
  1618. HRESULT GetCount
  1619. (
  1620. [out] DWORD *pcelt
  1621. );
  1622. /*++
  1623. Routine Name:
  1624. GetNext
  1625. Routine Description:
  1626. Get a pointer to the next (from current position) Code Breakpoint object in the enumerated list
  1627. Argument(s):
  1628. ppieXdiCodeBreakpoint - Returns Code Breakpoint object's interface pointer.
  1629. Return Value:
  1630. Error status:
  1631. S_OK: Function successful
  1632. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1633. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1634. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1635. EXDI_E_NOTIMPL: Not implemented
  1636. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1637. EXDI_E_INVALIDARG: One or more arguments are invalid
  1638. EXDI_E_ABORT: Operation aborted
  1639. EXDI_E_FAIL: Unspecified failure
  1640. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1641. --*/
  1642. HRESULT GetNext
  1643. (
  1644. [out] IeXdiCodeBreakpoint **ppieXdiCodeBreakpoint
  1645. );
  1646. /*++
  1647. Routine Name:
  1648. DisableAll
  1649. Routine Description:
  1650. Disable all Code Breakpoints which objects are in the enumerated list
  1651. Argument(s):
  1652. none
  1653. Return Value:
  1654. Error status:
  1655. S_OK: Function successful
  1656. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1657. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1658. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  1659. EXDI_E_NOTIMPL: Not implemented
  1660. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1661. EXDI_E_ABORT: Operation aborted
  1662. EXDI_E_FAIL: Unspecified failure
  1663. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1664. --*/
  1665. HRESULT DisableAll
  1666. (
  1667. void
  1668. );
  1669. /*++
  1670. Routine Name:
  1671. EnableAll
  1672. Routine Description:
  1673. Enable all Code Breakpoints which objects are in the enumerated list
  1674. Argument(s):
  1675. none
  1676. Return Value:
  1677. Error status:
  1678. S_OK: Function successful
  1679. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1680. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1681. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  1682. EXDI_E_NOTIMPL: Not implemented
  1683. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1684. EXDI_E_ABORT: Operation aborted
  1685. EXDI_E_FAIL: Unspecified failure
  1686. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1687. --*/
  1688. HRESULT EnableAll
  1689. (
  1690. void
  1691. );
  1692. }; // IeXdiEnumCodeBreakpoint
  1693. /////////////////////////////////////////////////////////////////////////////
  1694. /////////////////////////////////////////////////////////////////////////////
  1695. //
  1696. // IeXdiEnumDataBreakpoint
  1697. //
  1698. /////////////////////////////////////////////////////////////////////////////
  1699. /////////////////////////////////////////////////////////////////////////////
  1700. // Data Breakpoint Enumeration List interface
  1701. [
  1702. object,
  1703. uuid(47486F67-6461-6C65-5844-495345575074),
  1704. helpstring("IeXdiEnumDataBreakpoint interface - eXdi Server Enumerate Data Breakpoint 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1705. pointer_default(ref)
  1706. ]
  1707. interface IeXdiEnumDataBreakpoint : IUnknown
  1708. {
  1709. /*++
  1710. Routine Name:
  1711. Next
  1712. Routine Description:
  1713. Get an array of a given number (celt requested - *pceltFetched actual) of pointers
  1714. to the next (from current position) Data Breakpoint objects in the enumerated list
  1715. Argument(s):
  1716. celt - Requested number of Data Breakpoint object pointers to be returned.
  1717. apieXdiDataBreakpoint - Returns array of Data Breakpoint objects interface pointers.
  1718. pceltFetched - Returns the actual number of pointers returned in rgelt
  1719. Return Value:
  1720. Error status:
  1721. S_OK: Function successful
  1722. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1723. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1724. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1725. EXDI_E_NOTIMPL: Not implemented
  1726. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1727. EXDI_E_INVALIDARG: One or more arguments are invalid
  1728. EXDI_E_ABORT: Operation aborted
  1729. EXDI_E_FAIL: Unspecified failure
  1730. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1731. --*/
  1732. HRESULT Next
  1733. (
  1734. [in] DWORD celt,
  1735. [out, size_is(celt), length_is(*pceltFetched)] IeXdiDataBreakpoint *apieXdiDataBreakpoint[],
  1736. [out] DWORD *pceltFetched
  1737. );
  1738. /*++
  1739. Routine Name:
  1740. Skip
  1741. Routine Description:
  1742. Skip a given number (celt) of Data Breakpoint objects next (from current position) in the enumerated list
  1743. Argument(s):
  1744. celt - Requested number of Data Breakpoint objects to be skipped.
  1745. Return Value:
  1746. Error status:
  1747. S_OK: Function successful
  1748. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1749. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1750. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1751. EXDI_E_NOTIMPL: Not implemented
  1752. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1753. EXDI_E_INVALIDARG: One or more arguments are invalid
  1754. EXDI_E_ABORT: Operation aborted
  1755. EXDI_E_FAIL: Unspecified failure
  1756. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1757. --*/
  1758. HRESULT Skip
  1759. (
  1760. [in] DWORD celt
  1761. );
  1762. /*++
  1763. Routine Name:
  1764. Reset
  1765. Routine Description:
  1766. Reset the current position in the enumerated list to first Data Breakpoint object
  1767. Argument(s):
  1768. none
  1769. Return Value:
  1770. Error status:
  1771. S_OK: Function successful
  1772. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1773. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1774. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1775. EXDI_E_NOTIMPL: Not implemented
  1776. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1777. EXDI_E_ABORT: Operation aborted
  1778. EXDI_E_FAIL: Unspecified failure
  1779. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1780. --*/
  1781. HRESULT Reset
  1782. (
  1783. void
  1784. );
  1785. /*++
  1786. Routine Name:
  1787. GetCount
  1788. Routine Description:
  1789. Gives the total number of Data Breakpoint objects in the enumerated list
  1790. Argument(s):
  1791. pcelt - Returns total number of Data Breakpoint objects in the enumerated list.
  1792. Return Value:
  1793. Error status:
  1794. S_OK: Function successful
  1795. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1796. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1797. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1798. EXDI_E_NOTIMPL: Not implemented
  1799. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1800. EXDI_E_INVALIDARG: One or more arguments are invalid
  1801. EXDI_E_ABORT: Operation aborted
  1802. EXDI_E_FAIL: Unspecified failure
  1803. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1804. --*/
  1805. HRESULT GetCount
  1806. (
  1807. [out] DWORD *pcelt
  1808. );
  1809. /*++
  1810. Routine Name:
  1811. GetNext
  1812. Routine Description:
  1813. Get a pointer to the next (from current position) Data Breakpoint object in the enumerated list
  1814. Argument(s):
  1815. ppieXdiDataBreakpoint - Returns Data Breakpoint object's interface pointer.
  1816. Return Value:
  1817. Error status:
  1818. S_OK: Function successful
  1819. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1820. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1821. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1822. EXDI_E_NOTIMPL: Not implemented
  1823. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1824. EXDI_E_INVALIDARG: One or more arguments are invalid
  1825. EXDI_E_ABORT: Operation aborted
  1826. EXDI_E_FAIL: Unspecified failure
  1827. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1828. --*/
  1829. HRESULT GetNext
  1830. (
  1831. [out] IeXdiDataBreakpoint **ppieXdiDataBreakpoint
  1832. );
  1833. /*++
  1834. Routine Name:
  1835. DisableAll
  1836. Routine Description:
  1837. Disable all Data Breakpoints which objects are in the enumerated list
  1838. Argument(s):
  1839. none
  1840. Return Value:
  1841. Error status:
  1842. S_OK: Function successful
  1843. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1844. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1845. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  1846. EXDI_E_NOTIMPL: Not implemented
  1847. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1848. EXDI_E_ABORT: Operation aborted
  1849. EXDI_E_FAIL: Unspecified failure
  1850. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1851. --*/
  1852. HRESULT DisableAll
  1853. (
  1854. void
  1855. );
  1856. /*++
  1857. Routine Name:
  1858. EnableAll
  1859. Routine Description:
  1860. Enable all Data Breakpoints which objects are in the enumerated list
  1861. Argument(s):
  1862. none
  1863. Return Value:
  1864. Error status:
  1865. S_OK: Function successful
  1866. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1867. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1868. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  1869. EXDI_E_NOTIMPL: Not implemented
  1870. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1871. EXDI_E_ABORT: Operation aborted
  1872. EXDI_E_FAIL: Unspecified failure
  1873. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1874. --*/
  1875. HRESULT EnableAll
  1876. (
  1877. void
  1878. );
  1879. }; // IeXdiEnumDataBreakpoint
  1880. const DWORD SIZE_OF_80387_REGISTERS_IN_BYTES = 80;
  1881. typedef
  1882. struct _CONTEXT_X86
  1883. {
  1884. struct
  1885. {
  1886. BOOL fSegmentRegs;
  1887. BOOL fControlRegs;
  1888. BOOL fIntegerRegs;
  1889. BOOL fFloatingPointRegs;
  1890. BOOL fDebugRegs;
  1891. } RegGroupSelection; // These flags are used to select groups of registers only
  1892. // (instead of the totality) for reading or writing.
  1893. // both Segment & Control registers (used if either RegGroupSelection.fSegmentRegs or
  1894. // RegGroupSelection.fControlRegs is TRUE).
  1895. DWORD SegCs;
  1896. DWORD SegSs;
  1897. // Segment registers (used if RegGroupSelection.fSegmentRegs is TRUE).
  1898. // except CS and SS which are in "Segment and Control" - see above
  1899. DWORD SegGs;
  1900. DWORD SegFs;
  1901. DWORD SegEs;
  1902. DWORD SegDs;
  1903. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  1904. // except CS and SS which are in "Segment and Control" - see above
  1905. DWORD EFlags;
  1906. DWORD Ebp;
  1907. DWORD Eip;
  1908. DWORD Esp;
  1909. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  1910. DWORD Eax;
  1911. DWORD Ebx;
  1912. DWORD Ecx;
  1913. DWORD Edx;
  1914. DWORD Esi;
  1915. DWORD Edi;
  1916. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  1917. DWORD ControlWord;
  1918. DWORD StatusWord;
  1919. DWORD TagWord;
  1920. DWORD ErrorOffset;
  1921. DWORD ErrorSelector;
  1922. DWORD DataOffset;
  1923. DWORD DataSelector;
  1924. BYTE RegisterArea [SIZE_OF_80387_REGISTERS_IN_BYTES];
  1925. DWORD Cr0NpxState;
  1926. // Debug registers (used if RegGroupSelection.fDebugRegs is TRUE)
  1927. DWORD Dr0;
  1928. DWORD Dr1;
  1929. DWORD Dr2;
  1930. DWORD Dr3;
  1931. DWORD Dr6;
  1932. DWORD Dr7;
  1933. } CONTEXT_X86, *PCONTEXT_X86;
  1934. /////////////////////////////////////////////////////////////////////////////
  1935. /////////////////////////////////////////////////////////////////////////////
  1936. //
  1937. // IeXdiX86Context
  1938. //
  1939. /////////////////////////////////////////////////////////////////////////////
  1940. /////////////////////////////////////////////////////////////////////////////
  1941. // X86 context access interface
  1942. [
  1943. object,
  1944. uuid(47486F67-6461-6C65-5844-495358383643),
  1945. helpstring("IeXdiX86Context interface - eXdi Context access for X86 processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1946. pointer_default(ref)
  1947. ]
  1948. interface IeXdiX86Context : IUnknown
  1949. {
  1950. /*++
  1951. Routine Name:
  1952. GetContext
  1953. Routine Description:
  1954. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  1955. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  1956. Argument(s):
  1957. pContext - Return context (CPU dependant structure).
  1958. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  1959. Return Value:
  1960. Error status:
  1961. S_OK: Function successful
  1962. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1963. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1964. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  1965. EXDI_E_NOTIMPL: Not implemented
  1966. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1967. EXDI_E_INVALIDARG: One or more arguments are invalid
  1968. EXDI_E_ABORT: Operation aborted
  1969. EXDI_E_FAIL: Unspecified failure
  1970. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1971. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1972. --*/
  1973. HRESULT GetContext
  1974. (
  1975. [in, out] PCONTEXT_X86 pContext
  1976. );
  1977. /*++
  1978. Routine Name:
  1979. SetContext
  1980. Routine Description:
  1981. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  1982. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  1983. Argument(s):
  1984. pContext - Return context (CPU dependant structure).
  1985. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  1986. Return Value:
  1987. Error status:
  1988. S_OK: Function successful
  1989. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1990. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1991. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  1992. EXDI_E_NOTIMPL: Not implemented
  1993. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1994. EXDI_E_INVALIDARG: One or more arguments are invalid
  1995. EXDI_E_ABORT: Operation aborted
  1996. EXDI_E_FAIL: Unspecified failure
  1997. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1998. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1999. --*/
  2000. HRESULT SetContext
  2001. (
  2002. [in] CONTEXT_X86 Context
  2003. );
  2004. }; // interface IeXdiX86Context
  2005. /////////////////////////////////////////////////////////////////////////////
  2006. /////////////////////////////////////////////////////////////////////////////
  2007. //
  2008. // IeXdiX86ExContext
  2009. //
  2010. /////////////////////////////////////////////////////////////////////////////
  2011. /////////////////////////////////////////////////////////////////////////////
  2012. typedef
  2013. struct _X86_SEG_DESC_INFO
  2014. {
  2015. DWORD Base;
  2016. DWORD Limit;
  2017. DWORD Flags;
  2018. } X86_SEG_DESC_INFO;
  2019. typedef
  2020. struct _X86_SSE_REG
  2021. {
  2022. DWORD Reg0;
  2023. DWORD Reg1;
  2024. DWORD Reg2;
  2025. DWORD Reg3;
  2026. } X86_SSE_REG;
  2027. #define X86_NUM_SSE_REGS 8
  2028. typedef
  2029. struct _CONTEXT_X86_EX
  2030. {
  2031. struct
  2032. {
  2033. BOOL fSegmentRegs;
  2034. BOOL fControlRegs;
  2035. BOOL fIntegerRegs;
  2036. BOOL fFloatingPointRegs;
  2037. BOOL fDebugRegs;
  2038. BOOL fSegmentDescriptors;
  2039. BOOL fSSERegisters;
  2040. BOOL fSystemRegisters;
  2041. } RegGroupSelection; // These flags are used to select groups of registers only
  2042. // (instead of the totality) for reading or writing.
  2043. // both Segment & Control registers (used if either RegGroupSelection.fSegmentRegs or
  2044. // RegGroupSelection.fControlRegs is TRUE).
  2045. DWORD SegCs;
  2046. DWORD SegSs;
  2047. // Segment registers (used if RegGroupSelection.fSegmentRegs is TRUE).
  2048. // except CS and SS which are in "Segment and Control" - see above
  2049. DWORD SegGs;
  2050. DWORD SegFs;
  2051. DWORD SegEs;
  2052. DWORD SegDs;
  2053. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  2054. // except CS and SS which are in "Segment and Control" - see above
  2055. DWORD EFlags;
  2056. DWORD Ebp;
  2057. DWORD Eip;
  2058. DWORD Esp;
  2059. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2060. DWORD Eax;
  2061. DWORD Ebx;
  2062. DWORD Ecx;
  2063. DWORD Edx;
  2064. DWORD Esi;
  2065. DWORD Edi;
  2066. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  2067. DWORD ControlWord;
  2068. DWORD StatusWord;
  2069. DWORD TagWord;
  2070. DWORD ErrorOffset;
  2071. DWORD ErrorSelector;
  2072. DWORD DataOffset;
  2073. DWORD DataSelector;
  2074. BYTE RegisterArea [SIZE_OF_80387_REGISTERS_IN_BYTES];
  2075. DWORD Cr0NpxState;
  2076. // Debug registers (used if RegGroupSelection.fDebugRegs is TRUE)
  2077. DWORD Dr0;
  2078. DWORD Dr1;
  2079. DWORD Dr2;
  2080. DWORD Dr3;
  2081. DWORD Dr6;
  2082. DWORD Dr7;
  2083. // Descriptors and base registers (used if RegGroupSelection.fSegmentDescriptors is TRUE)
  2084. X86_SEG_DESC_INFO DescriptorCs;
  2085. X86_SEG_DESC_INFO DescriptorSs;
  2086. X86_SEG_DESC_INFO DescriptorGs;
  2087. X86_SEG_DESC_INFO DescriptorFs;
  2088. X86_SEG_DESC_INFO DescriptorEs;
  2089. X86_SEG_DESC_INFO DescriptorDs;
  2090. DWORD IdtBase;
  2091. DWORD IdtLimit;
  2092. DWORD GdtBase;
  2093. DWORD GdtLimit;
  2094. DWORD Ldtr;
  2095. X86_SEG_DESC_INFO DescriptorLdtr;
  2096. DWORD Tr;
  2097. X86_SEG_DESC_INFO DescriptorTr;
  2098. // System registers (used if RegGroupSelection.fSystemRegisters is TRUE)
  2099. DWORD Cr0;
  2100. DWORD Cr2;
  2101. DWORD Cr3;
  2102. DWORD Cr4;
  2103. // SSE registers (used if RegGroupSelection.fSSERegisters is TRUE)
  2104. DWORD Mxcsr;
  2105. X86_SSE_REG Sse[X86_NUM_SSE_REGS];
  2106. } CONTEXT_X86_EX, *PCONTEXT_X86_EX;
  2107. // Extended X86 context access interface
  2108. [
  2109. object,
  2110. uuid(353ba159-ff30-4af9-86ae-393809fef440),
  2111. helpstring("IeXdiX86ExContext interface - eXdi Context access for X86 processors 1.1 for Platform Builder 3.0 debugger - Microsoft 2001"),
  2112. pointer_default(ref)
  2113. ]
  2114. interface IeXdiX86ExContext : IUnknown
  2115. {
  2116. /*++
  2117. Routine Name:
  2118. GetContext
  2119. Routine Description:
  2120. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2121. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2122. Argument(s):
  2123. pContext - Return context (CPU dependant structure).
  2124. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2125. Return Value:
  2126. Error status:
  2127. S_OK: Function successful
  2128. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2129. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2130. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2131. EXDI_E_NOTIMPL: Not implemented
  2132. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2133. EXDI_E_INVALIDARG: One or more arguments are invalid
  2134. EXDI_E_ABORT: Operation aborted
  2135. EXDI_E_FAIL: Unspecified failure
  2136. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2137. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2138. --*/
  2139. HRESULT GetContext
  2140. (
  2141. [in, out] PCONTEXT_X86_EX pContext
  2142. );
  2143. /*++
  2144. Routine Name:
  2145. SetContext
  2146. Routine Description:
  2147. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2148. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2149. Argument(s):
  2150. pContext - Return context (CPU dependant structure).
  2151. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2152. Return Value:
  2153. Error status:
  2154. S_OK: Function successful
  2155. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2156. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2157. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2158. EXDI_E_NOTIMPL: Not implemented
  2159. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2160. EXDI_E_INVALIDARG: One or more arguments are invalid
  2161. EXDI_E_ABORT: Operation aborted
  2162. EXDI_E_FAIL: Unspecified failure
  2163. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2164. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2165. --*/
  2166. HRESULT SetContext
  2167. (
  2168. [in] CONTEXT_X86_EX Context
  2169. );
  2170. }; // interface IeXdiX86ExContext
  2171. /////////////////////////////////////////////////////////////////////////////
  2172. /////////////////////////////////////////////////////////////////////////////
  2173. //
  2174. // IeXdiX86_64Context
  2175. //
  2176. /////////////////////////////////////////////////////////////////////////////
  2177. /////////////////////////////////////////////////////////////////////////////
  2178. cpp_quote("// The following constants are bit definitions for the ModeFlags value in CONTEXT_X86_64.")
  2179. cpp_quote("// They are provided to allow debuggers to correctly disassemble instructions based on")
  2180. cpp_quote("// the current operating mode of the processor.")
  2181. cpp_quote("#define X86_64_MODE_D (0x0001) // D bit from the current CS selector")
  2182. cpp_quote("#define X86_64_MODE_L (0x0002) // L bit (long mode) from the current CS selector")
  2183. cpp_quote("#define X86_64_MODE_LME (0x0004) // LME bit (lomg mode enable) from extended feature MSR")
  2184. cpp_quote("#define X86_64_MODE_REX (0x0008) // REX bit (register extension) from extended feature MSR")
  2185. typedef
  2186. struct _SEG64_DESC_INFO
  2187. {
  2188. DWORD64 SegBase;
  2189. DWORD64 SegLimit;
  2190. DWORD SegFlags;
  2191. } SEG64_DESC_INFO;
  2192. typedef
  2193. struct _SSE_REG
  2194. {
  2195. DWORD Reg0;
  2196. DWORD Reg1;
  2197. DWORD Reg2;
  2198. DWORD Reg3;
  2199. } SSE_REG;
  2200. #define NUM_SSE_REGS 16
  2201. typedef
  2202. struct _CONTEXT_X86_64
  2203. {
  2204. struct
  2205. {
  2206. BOOL fSegmentRegs;
  2207. BOOL fControlRegs;
  2208. BOOL fIntegerRegs;
  2209. BOOL fFloatingPointRegs;
  2210. BOOL fDebugRegs;
  2211. BOOL fSegmentDescriptors;
  2212. BOOL fSSERegisters;
  2213. BOOL fSystemRegisters;
  2214. } RegGroupSelection; // These flags are used to select groups of registers only
  2215. // (instead of the totality) for reading or writing.
  2216. // both Segment & Control registers (used if either RegGroupSelection.fSegmentRegs or
  2217. // RegGroupSelection.fControlRegs is TRUE).
  2218. DWORD SegCs;
  2219. DWORD SegSs;
  2220. // Segment registers (used if RegGroupSelection.fSegmentRegs is TRUE).
  2221. // except CS and SS which are in "Segment and Control" - see above
  2222. DWORD SegGs;
  2223. DWORD SegFs;
  2224. DWORD SegEs;
  2225. DWORD SegDs;
  2226. // Mode flags define the current processor mode (16/32/64 bit)
  2227. DWORD64 ModeFlags;
  2228. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  2229. // except CS and SS which are in "Segment and Control" - see above
  2230. DWORD64 EFlags;
  2231. DWORD64 Rbp;
  2232. DWORD64 Rip;
  2233. DWORD64 Rsp;
  2234. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2235. DWORD64 Rax;
  2236. DWORD64 Rbx;
  2237. DWORD64 Rcx;
  2238. DWORD64 Rdx;
  2239. DWORD64 Rsi;
  2240. DWORD64 Rdi;
  2241. DWORD64 R8;
  2242. DWORD64 R9;
  2243. DWORD64 R10;
  2244. DWORD64 R11;
  2245. DWORD64 R12;
  2246. DWORD64 R13;
  2247. DWORD64 R14;
  2248. DWORD64 R15;
  2249. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  2250. DWORD ControlWord;
  2251. DWORD StatusWord;
  2252. DWORD TagWord;
  2253. DWORD ErrorOffset;
  2254. DWORD ErrorSelector;
  2255. DWORD DataOffset;
  2256. DWORD DataSelector;
  2257. BYTE RegisterArea [SIZE_OF_80387_REGISTERS_IN_BYTES];
  2258. // Debug registers (used if RegGroupSelection.fDebugRegs is TRUE)
  2259. DWORD64 Dr0;
  2260. DWORD64 Dr1;
  2261. DWORD64 Dr2;
  2262. DWORD64 Dr3;
  2263. DWORD64 Dr6;
  2264. DWORD64 Dr7;
  2265. // Descriptors and base registers (used if RegGroupSelection.fSegmentDescriptors is TRUE)
  2266. SEG64_DESC_INFO DescriptorCs;
  2267. SEG64_DESC_INFO DescriptorSs;
  2268. SEG64_DESC_INFO DescriptorGs;
  2269. SEG64_DESC_INFO DescriptorFs;
  2270. SEG64_DESC_INFO DescriptorEs;
  2271. SEG64_DESC_INFO DescriptorDs;
  2272. DWORD64 IDTBase;
  2273. DWORD64 IDTLimit;
  2274. DWORD64 GDTBase;
  2275. DWORD64 GDTLimit;
  2276. DWORD SelLDT;
  2277. SEG64_DESC_INFO SegLDT;
  2278. DWORD SelTSS;
  2279. SEG64_DESC_INFO SegTSS;
  2280. // System registers (used if RegGroupSelection.fSystemRegisters is TRUE)
  2281. DWORD64 RegCr0;
  2282. DWORD64 RegCr2;
  2283. DWORD64 RegCr3;
  2284. DWORD64 RegCr4;
  2285. DWORD64 RegCr8; // Cr8 - Task priority register.
  2286. // SSE registers (used if RegGroupSelection.fSSERegisters is TRUE)
  2287. DWORD RegMXCSR;
  2288. SSE_REG RegSSE[NUM_SSE_REGS];
  2289. } CONTEXT_X86_64, *PCONTEXT_X86_64;
  2290. // X86_64 context access interface
  2291. [
  2292. object,
  2293. uuid(4795B125-6CDE-4e76-B8D3-D5ED69ECE739),
  2294. helpstring("IeXdiX86_64Context interface - eXdi Context access for 64 Bit X86 processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2295. pointer_default(ref)
  2296. ]
  2297. interface IeXdiX86_64Context : IUnknown
  2298. {
  2299. /*++
  2300. Routine Name:
  2301. GetContext
  2302. Routine Description:
  2303. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2304. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2305. Argument(s):
  2306. pContext - Return context (CPU dependant structure).
  2307. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2308. Return Value:
  2309. Error status:
  2310. S_OK: Function successful
  2311. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2312. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2313. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2314. EXDI_E_NOTIMPL: Not implemented
  2315. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2316. EXDI_E_INVALIDARG: One or more arguments are invalid
  2317. EXDI_E_ABORT: Operation aborted
  2318. EXDI_E_FAIL: Unspecified failure
  2319. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2320. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2321. --*/
  2322. HRESULT GetContext
  2323. (
  2324. [in, out] PCONTEXT_X86_64 pContext
  2325. );
  2326. /*++
  2327. Routine Name:
  2328. SetContext
  2329. Routine Description:
  2330. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2331. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2332. Argument(s):
  2333. pContext - Return context (CPU dependant structure).
  2334. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2335. Return Value:
  2336. Error status:
  2337. S_OK: Function successful
  2338. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2339. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2340. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2341. EXDI_E_NOTIMPL: Not implemented
  2342. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2343. EXDI_E_INVALIDARG: One or more arguments are invalid
  2344. EXDI_E_ABORT: Operation aborted
  2345. EXDI_E_FAIL: Unspecified failure
  2346. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2347. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2348. --*/
  2349. HRESULT SetContext
  2350. (
  2351. [in] CONTEXT_X86_64 Context
  2352. );
  2353. }; // interface IeXdiX86_64Context
  2354. typedef
  2355. struct _CONTEXT_SHX
  2356. {
  2357. struct
  2358. {
  2359. BOOL fControlRegs; // control and system registers
  2360. BOOL fIntegerRegs;
  2361. BOOL fFloatingPointRegs; // Only available for SH4
  2362. BOOL fDebugRegs;
  2363. } RegGroupSelection; // These flags are used to select groups of registers only
  2364. // (instead of the totality) for reading or writing.
  2365. // Control registers (used if RegGroupSelection.fControlRegs is TRUE)
  2366. // except R14 (Fp) and R15 (Sp) which are in "Integer and Control" - see further
  2367. DWORD Pr; // Procedure Register (Return Address)
  2368. DWORD Mach; // Multiply and accumulate High
  2369. DWORD Macl; // Multiply and accumulate Low
  2370. DWORD Gbr; // Global base register
  2371. DWORD Pc; // Program Counter
  2372. DWORD Sr; // Status register
  2373. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2374. // except R14 and R15 which are in "Integer and Control" - see further
  2375. DWORD R0; // Return val - Temp
  2376. DWORD R1; // Temp
  2377. DWORD R2; // Temp
  2378. DWORD R3; // Temp
  2379. DWORD R4; // Arg - Temp
  2380. DWORD R5; // Arg - Temp
  2381. DWORD R6; // Arg - Temp
  2382. DWORD R7; // Arg - Temp
  2383. DWORD R8; // Permanent
  2384. DWORD R9; // Permanent
  2385. DWORD R10; // Permanent
  2386. DWORD R11; // Permanent
  2387. DWORD R12; // Permanent
  2388. DWORD R13; // Permanent
  2389. // both Integer & Control registers (used if either RegGroupSelection.fIntegerRegs or
  2390. // RegGroupSelection.fControlRegs is TRUE).
  2391. DWORD R14; // Frame pointer (recommended)
  2392. DWORD R15; // Stack pointer
  2393. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  2394. // NOTE: this group is only used for SH4. On SH3, the data are just ignored
  2395. DWORD Fpscr; // Floating point status/control register
  2396. DWORD Fpul; // Floating point communication register
  2397. DWORD FR_B0 [16]; // Floating point regs bank 0
  2398. DWORD FR_B1 [16]; // Floating point regs bank 1
  2399. // Debug registers (used if RegGroupSelection.fDebugRegs is TRUE)
  2400. DWORD BarA;
  2401. BYTE BasrA;
  2402. BYTE BamrA;
  2403. WORD BbrA;
  2404. DWORD BarB;
  2405. BYTE BasrB;
  2406. BYTE BamrB;
  2407. WORD BbrB;
  2408. DWORD BdrB;
  2409. DWORD BdmrB;
  2410. WORD Brcr;
  2411. WORD Align;
  2412. } CONTEXT_SHX, *PCONTEXT_SHX;
  2413. /////////////////////////////////////////////////////////////////////////////
  2414. /////////////////////////////////////////////////////////////////////////////
  2415. //
  2416. // IeXdiSHXContext
  2417. //
  2418. /////////////////////////////////////////////////////////////////////////////
  2419. /////////////////////////////////////////////////////////////////////////////
  2420. // SHX context access interface
  2421. [
  2422. object,
  2423. uuid(47486F67-6461-6C65-5844-495353475843),
  2424. helpstring("IeXdiSHXContext interface - eXdi Context access for SHX processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2425. pointer_default(ref)
  2426. ]
  2427. interface IeXdiSHXContext : IUnknown
  2428. {
  2429. /*++
  2430. Routine Name:
  2431. GetContext
  2432. Routine Description:
  2433. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2434. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2435. Argument(s):
  2436. pContext - Return context (CPU dependant structure).
  2437. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2438. Return Value:
  2439. Error status:
  2440. S_OK: Function successful
  2441. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2442. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2443. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2444. EXDI_E_NOTIMPL: Not implemented
  2445. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2446. EXDI_E_INVALIDARG: One or more arguments are invalid
  2447. EXDI_E_ABORT: Operation aborted
  2448. EXDI_E_FAIL: Unspecified failure
  2449. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2450. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2451. --*/
  2452. HRESULT GetContext
  2453. (
  2454. [in, out] PCONTEXT_SHX pContext
  2455. );
  2456. /*++
  2457. Routine Name:
  2458. SetContext
  2459. Routine Description:
  2460. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2461. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2462. Argument(s):
  2463. pContext - Return context (CPU dependant structure).
  2464. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2465. Return Value:
  2466. Error status:
  2467. S_OK: Function successful
  2468. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2469. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2470. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2471. EXDI_E_NOTIMPL: Not implemented
  2472. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2473. EXDI_E_INVALIDARG: One or more arguments are invalid
  2474. EXDI_E_ABORT: Operation aborted
  2475. EXDI_E_FAIL: Unspecified failure
  2476. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2477. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2478. --*/
  2479. HRESULT SetContext
  2480. (
  2481. [in] CONTEXT_SHX Context
  2482. );
  2483. }; // interface IeXdiSHXContext
  2484. typedef
  2485. struct _CONTEXT_MIPS
  2486. {
  2487. struct
  2488. {
  2489. BOOL fMode64bits;
  2490. BOOL fControlRegs;
  2491. BOOL fIntegerRegs;
  2492. BOOL fFloatingPointRegs;
  2493. BOOL fExceptRegs; // Exception processing regs
  2494. BOOL fMemoryMgmRegs; // Memory Management regs
  2495. } RegGroupSelection; // These flags are used to select groups of registers only
  2496. // (instead of the totality) for reading or writing.
  2497. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2498. // Note: The registers gp, sp, and ra are both part of Integer register and Control register
  2499. // (used if either RegGroupSelection.fIntegerRegs or RegGroupSelection.fControlRegs is TRUE).
  2500. // Note: Register zero ($0) is not stored in the frame.
  2501. // 32 bit mode - 64 bit mode
  2502. DWORD IntAt; DWORD Hi32_IntAt; // $1
  2503. DWORD IntV0; DWORD Hi32_IntV0; // $2
  2504. DWORD IntV1; DWORD Hi32_IntV1; // $3
  2505. DWORD IntA0; DWORD Hi32_IntA0; // $4
  2506. DWORD IntA1; DWORD Hi32_IntA1; // $5
  2507. DWORD IntA2; DWORD Hi32_IntA2; // $6
  2508. DWORD IntA3; DWORD Hi32_IntA3; // $7
  2509. DWORD IntT0; DWORD Hi32_IntT0; // $8
  2510. DWORD IntT1; DWORD Hi32_IntT1; // $9
  2511. DWORD IntT2; DWORD Hi32_IntT2; // $10
  2512. DWORD IntT3; DWORD Hi32_IntT3; // $11
  2513. DWORD IntT4; DWORD Hi32_IntT4; // $12
  2514. DWORD IntT5; DWORD Hi32_IntT5; // $13
  2515. DWORD IntT6; DWORD Hi32_IntT6; // $14
  2516. DWORD IntT7; DWORD Hi32_IntT7; // $15
  2517. DWORD IntS0; DWORD Hi32_IntS0; // $16
  2518. DWORD IntS1; DWORD Hi32_IntS1; // $17
  2519. DWORD IntS2; DWORD Hi32_IntS2; // $18
  2520. DWORD IntS3; DWORD Hi32_IntS3; // $19
  2521. DWORD IntS4; DWORD Hi32_IntS4; // $20
  2522. DWORD IntS5; DWORD Hi32_IntS5; // $21
  2523. DWORD IntS6; DWORD Hi32_IntS6; // $22
  2524. DWORD IntS7; DWORD Hi32_IntS7; // $23
  2525. DWORD IntT8; DWORD Hi32_IntT8; // $24
  2526. DWORD IntT9; DWORD Hi32_IntT9; // $25
  2527. DWORD IntK0; DWORD Hi32_IntK0; // $26
  2528. DWORD IntK1; DWORD Hi32_IntK1; // $27
  2529. DWORD IntGp; DWORD Hi32_IntGp; // $28 - Also part of Control registers (in addition to Integer register)
  2530. DWORD IntSp; DWORD Hi32_IntSp; // $29 - Also part of Control registers (in addition to Integer register)
  2531. DWORD IntS8; DWORD Hi32_IntS8; // $30
  2532. DWORD IntRa; DWORD Hi32_IntRa; // $31 - Also part of Control registers (in addition to Integer register)
  2533. DWORD IntLo; DWORD Hi32_IntLo;
  2534. DWORD IntHi; DWORD Hi32_IntHi;
  2535. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  2536. // 32 bit mode - 64 bit mode
  2537. DWORD FltF0; DWORD Hi32_FltF0;
  2538. DWORD FltF1; DWORD Hi32_FltF1;
  2539. DWORD FltF2; DWORD Hi32_FltF2;
  2540. DWORD FltF3; DWORD Hi32_FltF3;
  2541. DWORD FltF4; DWORD Hi32_FltF4;
  2542. DWORD FltF5; DWORD Hi32_FltF5;
  2543. DWORD FltF6; DWORD Hi32_FltF6;
  2544. DWORD FltF7; DWORD Hi32_FltF7;
  2545. DWORD FltF8; DWORD Hi32_FltF8;
  2546. DWORD FltF9; DWORD Hi32_FltF9;
  2547. DWORD FltF10; DWORD Hi32_FltF10;
  2548. DWORD FltF11; DWORD Hi32_FltF11;
  2549. DWORD FltF12; DWORD Hi32_FltF12;
  2550. DWORD FltF13; DWORD Hi32_FltF13;
  2551. DWORD FltF14; DWORD Hi32_FltF14;
  2552. DWORD FltF15; DWORD Hi32_FltF15;
  2553. DWORD FltF16; DWORD Hi32_FltF16;
  2554. DWORD FltF17; DWORD Hi32_FltF17;
  2555. DWORD FltF18; DWORD Hi32_FltF18;
  2556. DWORD FltF19; DWORD Hi32_FltF19;
  2557. DWORD FltF20; DWORD Hi32_FltF20;
  2558. DWORD FltF21; DWORD Hi32_FltF21;
  2559. DWORD FltF22; DWORD Hi32_FltF22;
  2560. DWORD FltF23; DWORD Hi32_FltF23;
  2561. DWORD FltF24; DWORD Hi32_FltF24;
  2562. DWORD FltF25; DWORD Hi32_FltF25;
  2563. DWORD FltF26; DWORD Hi32_FltF26;
  2564. DWORD FltF27; DWORD Hi32_FltF27;
  2565. DWORD FltF28; DWORD Hi32_FltF28;
  2566. DWORD FltF29; DWORD Hi32_FltF29;
  2567. DWORD FltF30; DWORD Hi32_FltF30;
  2568. DWORD FltF31; DWORD Hi32_FltF31;
  2569. DWORD FCR0; // floating-point control register: implementation / revision
  2570. DWORD FCR31; // floating-point control register: control / status
  2571. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  2572. // Note: The registers gp, sp, and ra defined above are both part of Integer register and Control register
  2573. // (used if either RegGroupSelection.fControlRegs or RegGroupSelection.fControlRegs is TRUE).
  2574. // Note: The registers Sr defined later are both part of Exception registers and Control registers
  2575. // (used if either RegGroupSelection.fExceptRegs or RegGroupSelection.fControlRegs is TRUE).
  2576. // 32 bit mode - 64 bit mode
  2577. DWORD Pc; DWORD Hi32_Pc; // Program counter
  2578. // Exception processing registers (used if RegGroupSelection.fExceptRegs is TRUE).
  2579. DWORD Context; DWORD Hi32_Context; // Pointer to kernel virtual page table entry (PTE) in 32-bit addressing mode
  2580. DWORD BadVAddr; DWORD Hi32_BadVAddr; // Bad virtual address
  2581. DWORD EPC; DWORD Hi32_EPC; // Exception Program Counter
  2582. DWORD XContextReg; DWORD Hi32_XContextReg; // Pointer to kernel virtual PTE table in 64-bit addressing mode
  2583. DWORD ErrorEPC; DWORD Hi32_ErrorEPC; // Error Exception Program Counter
  2584. DWORD Count; // Timer Count
  2585. DWORD Compare; // Timer Compare
  2586. DWORD Sr; // Status register - Also part of Control registers (in addition to Exception registers)
  2587. DWORD Cause; // Cause of last exception
  2588. DWORD WatchLo; // Physical Memory Reference trap address low bits
  2589. DWORD WatchHi; // Physical Memory Reference trap address high bits
  2590. DWORD ECC; // Secondary-cache error checking and correcting (ECC) and Primary parity
  2591. DWORD CacheErr; // Cache Error and Status register
  2592. // Memory Management registers (used if RegGroupSelection.fMemoryMgmRegs is TRUE).
  2593. DWORD Index; // Programmable pointer into TLB array
  2594. DWORD Random; // Pseudorandom point into TLB array
  2595. DWORD EntryLo0; DWORD Hi32_EntryLo0; // Low half of TLB entry for even virtual address (VPN)
  2596. DWORD EntryLo1; DWORD Hi32_EntryLo1; // Low half of TLB entry for odd virtual address (VPN)
  2597. DWORD PageMask; // TLB Page Mask
  2598. DWORD Wired; // Number of wired TLB entries
  2599. DWORD EntryHi; DWORD Hi32_EntryHi; // High half of TLB entry
  2600. DWORD PRId; // Processor Revision Identifier
  2601. DWORD Config; // Configuration register
  2602. DWORD LLAddr; // Load Linked Address
  2603. DWORD TagLo; // Cache Tag register
  2604. DWORD TagHi; // Cache Tag register
  2605. } CONTEXT_MIPS, *PCONTEXT_MIPS;
  2606. /////////////////////////////////////////////////////////////////////////////
  2607. /////////////////////////////////////////////////////////////////////////////
  2608. //
  2609. // IeXdiMIPSContext
  2610. //
  2611. /////////////////////////////////////////////////////////////////////////////
  2612. /////////////////////////////////////////////////////////////////////////////
  2613. // MIPS context access interface
  2614. [
  2615. object,
  2616. uuid(47486F67-6461-6C65-5844-49534D495043),
  2617. helpstring("IeXdiMIPSContext interface - eXdi Context access for MIPS processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2618. pointer_default(ref)
  2619. ]
  2620. interface IeXdiMIPSContext : IUnknown
  2621. {
  2622. /*++
  2623. Routine Name:
  2624. GetContext
  2625. Routine Description:
  2626. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2627. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2628. Argument(s):
  2629. pContext - Return context (CPU dependant structure).
  2630. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2631. Return Value:
  2632. Error status:
  2633. S_OK: Function successful
  2634. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2635. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2636. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2637. EXDI_E_NOTIMPL: Not implemented
  2638. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2639. EXDI_E_INVALIDARG: One or more arguments are invalid
  2640. EXDI_E_ABORT: Operation aborted
  2641. EXDI_E_FAIL: Unspecified failure
  2642. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2643. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2644. --*/
  2645. HRESULT GetContext
  2646. (
  2647. [in, out] PCONTEXT_MIPS pContext
  2648. );
  2649. /*++
  2650. Routine Name:
  2651. SetContext
  2652. Routine Description:
  2653. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2654. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2655. Argument(s):
  2656. pContext - Return context (CPU dependant structure).
  2657. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2658. Return Value:
  2659. Error status:
  2660. S_OK: Function successful
  2661. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2662. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2663. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2664. EXDI_E_NOTIMPL: Not implemented
  2665. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2666. EXDI_E_INVALIDARG: One or more arguments are invalid
  2667. EXDI_E_ABORT: Operation aborted
  2668. EXDI_E_FAIL: Unspecified failure
  2669. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2670. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2671. --*/
  2672. HRESULT SetContext
  2673. (
  2674. [in] CONTEXT_MIPS Context
  2675. );
  2676. }; // interface IeXdiMIPSContext
  2677. typedef
  2678. struct _CONTEXT_ARM
  2679. {
  2680. struct
  2681. {
  2682. BOOL fControlRegs;
  2683. BOOL fIntegerRegs;
  2684. BOOL fDebugRegs;
  2685. } RegGroupSelection; // These flags are used to select groups of registers only
  2686. // (instead of the totality) for reading or writing.
  2687. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  2688. DWORD Sp;
  2689. DWORD Lr;
  2690. DWORD Pc;
  2691. DWORD Psr;
  2692. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2693. DWORD R0;
  2694. DWORD R1;
  2695. DWORD R2;
  2696. DWORD R3;
  2697. DWORD R4;
  2698. DWORD R5;
  2699. DWORD R6;
  2700. DWORD R7;
  2701. DWORD R8;
  2702. DWORD R9;
  2703. DWORD R10;
  2704. DWORD R11;
  2705. DWORD R12;
  2706. } CONTEXT_ARM, *PCONTEXT_ARM;
  2707. /////////////////////////////////////////////////////////////////////////////
  2708. /////////////////////////////////////////////////////////////////////////////
  2709. //
  2710. // IeXdiARMContext
  2711. //
  2712. /////////////////////////////////////////////////////////////////////////////
  2713. /////////////////////////////////////////////////////////////////////////////
  2714. // ARM context access interface
  2715. [
  2716. object,
  2717. uuid(47486F67-6461-6C65-5844-495341524D43),
  2718. helpstring("IeXdiARMContext interface - eXdi Context access for ARM processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2719. pointer_default(ref)
  2720. ]
  2721. interface IeXdiARMContext : IUnknown
  2722. {
  2723. /*++
  2724. Routine Name:
  2725. GetContext
  2726. Routine Description:
  2727. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2728. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2729. Argument(s):
  2730. pContext - Return context (CPU dependant structure).
  2731. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2732. Return Value:
  2733. Error status:
  2734. S_OK: Function successful
  2735. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2736. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2737. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2738. EXDI_E_NOTIMPL: Not implemented
  2739. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2740. EXDI_E_INVALIDARG: One or more arguments are invalid
  2741. EXDI_E_ABORT: Operation aborted
  2742. EXDI_E_FAIL: Unspecified failure
  2743. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2744. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2745. --*/
  2746. HRESULT GetContext
  2747. (
  2748. [in, out] PCONTEXT_ARM pContext
  2749. );
  2750. /*++
  2751. Routine Name:
  2752. SetContext
  2753. Routine Description:
  2754. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2755. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2756. Argument(s):
  2757. pContext - Return context (CPU dependant structure).
  2758. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2759. Return Value:
  2760. Error status:
  2761. S_OK: Function successful
  2762. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2763. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2764. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2765. EXDI_E_NOTIMPL: Not implemented
  2766. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2767. EXDI_E_INVALIDARG: One or more arguments are invalid
  2768. EXDI_E_ABORT: Operation aborted
  2769. EXDI_E_FAIL: Unspecified failure
  2770. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2771. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2772. --*/
  2773. HRESULT SetContext
  2774. (
  2775. [in] CONTEXT_ARM Context
  2776. );
  2777. }; // interface IeXdiARMContext
  2778. typedef
  2779. struct _CONTEXT_PPC
  2780. {
  2781. struct
  2782. {
  2783. BOOL fControlRegs;
  2784. BOOL fIntegerRegs;
  2785. BOOL fFloatingPointRegs;
  2786. BOOL fDebugRegs;
  2787. } RegGroupSelection; // These flags are used to select groups of registers only
  2788. // (instead of the totality) for reading or writing.
  2789. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  2790. double Fpr0;
  2791. double Fpr1;
  2792. double Fpr2;
  2793. double Fpr3;
  2794. double Fpr4;
  2795. double Fpr5;
  2796. double Fpr6;
  2797. double Fpr7;
  2798. double Fpr8;
  2799. double Fpr9;
  2800. double Fpr10;
  2801. double Fpr11;
  2802. double Fpr12;
  2803. double Fpr13;
  2804. double Fpr14;
  2805. double Fpr15;
  2806. double Fpr16;
  2807. double Fpr17;
  2808. double Fpr18;
  2809. double Fpr19;
  2810. double Fpr20;
  2811. double Fpr21;
  2812. double Fpr22;
  2813. double Fpr23;
  2814. double Fpr24;
  2815. double Fpr25;
  2816. double Fpr26;
  2817. double Fpr27;
  2818. double Fpr28;
  2819. double Fpr29;
  2820. double Fpr30;
  2821. double Fpr31;
  2822. double Fpscr; // Floating point status/control reg
  2823. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2824. DWORD Gpr0; // General registers 0..31
  2825. DWORD Gpr1;
  2826. DWORD Gpr2;
  2827. DWORD Gpr3;
  2828. DWORD Gpr4;
  2829. DWORD Gpr5;
  2830. DWORD Gpr6;
  2831. DWORD Gpr7;
  2832. DWORD Gpr8;
  2833. DWORD Gpr9;
  2834. DWORD Gpr10;
  2835. DWORD Gpr11;
  2836. DWORD Gpr12;
  2837. DWORD Gpr13;
  2838. DWORD Gpr14;
  2839. DWORD Gpr15;
  2840. DWORD Gpr16;
  2841. DWORD Gpr17;
  2842. DWORD Gpr18;
  2843. DWORD Gpr19;
  2844. DWORD Gpr20;
  2845. DWORD Gpr21;
  2846. DWORD Gpr22;
  2847. DWORD Gpr23;
  2848. DWORD Gpr24;
  2849. DWORD Gpr25;
  2850. DWORD Gpr26;
  2851. DWORD Gpr27;
  2852. DWORD Gpr28;
  2853. DWORD Gpr29;
  2854. DWORD Gpr30;
  2855. DWORD Gpr31;
  2856. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  2857. DWORD Msr; // Machine status register
  2858. DWORD Iar; // Instruction address register
  2859. DWORD Lr; // Link register
  2860. DWORD Ctr; // Count register
  2861. DWORD Cr; // Condition register
  2862. DWORD Xer; // Fixed point exception register
  2863. // Debug registers (used if RegGroupSelection.fDebugRegs is TRUE)
  2864. DWORD Dr0; // Breakpoint Register 1
  2865. DWORD Dr1; // Breakpoint Register 2
  2866. DWORD Dr2; // Breakpoint Register 3
  2867. DWORD Dr3; // Breakpoint Register 4
  2868. DWORD Dr4; // Breakpoint Register 5
  2869. DWORD Dr5; // Breakpoint Register 6
  2870. DWORD Dr6; // Debug Status Register
  2871. DWORD Dr7; // Debug Control Register
  2872. } CONTEXT_PPC, *PCONTEXT_PPC;
  2873. /////////////////////////////////////////////////////////////////////////////
  2874. /////////////////////////////////////////////////////////////////////////////
  2875. //
  2876. // IeXdiPPCContext
  2877. //
  2878. /////////////////////////////////////////////////////////////////////////////
  2879. /////////////////////////////////////////////////////////////////////////////
  2880. // PPC context access interface
  2881. [
  2882. object,
  2883. uuid(47486F67-6461-6C65-5844-495350504343),
  2884. helpstring("IeXdiPPCContext interface - eXdi Context access for PPC processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2885. pointer_default(ref)
  2886. ]
  2887. interface IeXdiPPCContext : IUnknown
  2888. {
  2889. /*++
  2890. Routine Name:
  2891. GetContext
  2892. Routine Description:
  2893. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2894. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2895. Argument(s):
  2896. pContext - Return context (CPU dependant structure).
  2897. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2898. Return Value:
  2899. Error status:
  2900. S_OK: Function successful
  2901. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2902. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2903. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2904. EXDI_E_NOTIMPL: Not implemented
  2905. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2906. EXDI_E_INVALIDARG: One or more arguments are invalid
  2907. EXDI_E_ABORT: Operation aborted
  2908. EXDI_E_FAIL: Unspecified failure
  2909. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2910. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2911. --*/
  2912. HRESULT GetContext
  2913. (
  2914. [in, out] PCONTEXT_PPC pContext
  2915. );
  2916. /*++
  2917. Routine Name:
  2918. SetContext
  2919. Routine Description:
  2920. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2921. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2922. Argument(s):
  2923. pContext - Return context (CPU dependant structure).
  2924. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2925. Return Value:
  2926. Error status:
  2927. S_OK: Function successful
  2928. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2929. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2930. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2931. EXDI_E_NOTIMPL: Not implemented
  2932. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2933. EXDI_E_INVALIDARG: One or more arguments are invalid
  2934. EXDI_E_ABORT: Operation aborted
  2935. EXDI_E_FAIL: Unspecified failure
  2936. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2937. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2938. --*/
  2939. HRESULT SetContext
  2940. (
  2941. [in] CONTEXT_PPC Context
  2942. );
  2943. }; // interface IeXdiPPCContext
  2944. /////////////////////////////////////////////////////////////////////////////
  2945. /////////////////////////////////////////////////////////////////////////////
  2946. //
  2947. // IeXdiIA64Context
  2948. //
  2949. /////////////////////////////////////////////////////////////////////////////
  2950. /////////////////////////////////////////////////////////////////////////////
  2951. typedef
  2952. struct _IA64_FLOAT128
  2953. {
  2954. DWORD64 Low;
  2955. DWORD64 High;
  2956. } IA64_FLOAT128;
  2957. typedef
  2958. struct _EXDI_CONTEXT_IA64
  2959. {
  2960. struct
  2961. {
  2962. BOOL fIntegerRegs;
  2963. BOOL fBranchRegs;
  2964. BOOL fLowFloatRegs;
  2965. BOOL fHighFloatRegs;
  2966. BOOL fDebugRegs;
  2967. BOOL fControlRegs;
  2968. BOOL fSystemRegs;
  2969. } RegGroupSelection;
  2970. //
  2971. // fIntegerRegs.
  2972. //
  2973. DWORD64 IntR1;
  2974. DWORD64 IntR2;
  2975. DWORD64 IntR3;
  2976. DWORD64 IntR4;
  2977. DWORD64 IntR5;
  2978. DWORD64 IntR6;
  2979. DWORD64 IntR7;
  2980. DWORD64 IntR8;
  2981. DWORD64 IntR9;
  2982. DWORD64 IntR10;
  2983. DWORD64 IntR11;
  2984. DWORD64 IntR12;
  2985. DWORD64 IntR13;
  2986. DWORD64 IntR14;
  2987. DWORD64 IntR15;
  2988. DWORD64 IntR16;
  2989. DWORD64 IntR17;
  2990. DWORD64 IntR18;
  2991. DWORD64 IntR19;
  2992. DWORD64 IntR20;
  2993. DWORD64 IntR21;
  2994. DWORD64 IntR22;
  2995. DWORD64 IntR23;
  2996. DWORD64 IntR24;
  2997. DWORD64 IntR25;
  2998. DWORD64 IntR26;
  2999. DWORD64 IntR27;
  3000. DWORD64 IntR28;
  3001. DWORD64 IntR29;
  3002. DWORD64 IntR30;
  3003. DWORD64 IntR31;
  3004. DWORD64 IntNats;
  3005. //
  3006. // fBranchRegs.
  3007. //
  3008. DWORD64 Preds;
  3009. DWORD64 Br0;
  3010. DWORD64 Br1;
  3011. DWORD64 Br2;
  3012. DWORD64 Br3;
  3013. DWORD64 Br4;
  3014. DWORD64 Br5;
  3015. DWORD64 Br6;
  3016. DWORD64 Br7;
  3017. //
  3018. // fLowFloatRegs or fHighFloatRegs.
  3019. //
  3020. DWORD64 StFPSR;
  3021. //
  3022. // fLowFloatRegs.
  3023. //
  3024. IA64_FLOAT128 FltF2;
  3025. IA64_FLOAT128 FltF3;
  3026. IA64_FLOAT128 FltF4;
  3027. IA64_FLOAT128 FltF5;
  3028. IA64_FLOAT128 FltF6;
  3029. IA64_FLOAT128 FltF7;
  3030. IA64_FLOAT128 FltF8;
  3031. IA64_FLOAT128 FltF9;
  3032. IA64_FLOAT128 FltF10;
  3033. IA64_FLOAT128 FltF11;
  3034. IA64_FLOAT128 FltF12;
  3035. IA64_FLOAT128 FltF13;
  3036. IA64_FLOAT128 FltF14;
  3037. IA64_FLOAT128 FltF15;
  3038. //
  3039. // fHighFloatRegs.
  3040. //
  3041. IA64_FLOAT128 FltF16;
  3042. IA64_FLOAT128 FltF17;
  3043. IA64_FLOAT128 FltF18;
  3044. IA64_FLOAT128 FltF19;
  3045. IA64_FLOAT128 FltF20;
  3046. IA64_FLOAT128 FltF21;
  3047. IA64_FLOAT128 FltF22;
  3048. IA64_FLOAT128 FltF23;
  3049. IA64_FLOAT128 FltF24;
  3050. IA64_FLOAT128 FltF25;
  3051. IA64_FLOAT128 FltF26;
  3052. IA64_FLOAT128 FltF27;
  3053. IA64_FLOAT128 FltF28;
  3054. IA64_FLOAT128 FltF29;
  3055. IA64_FLOAT128 FltF30;
  3056. IA64_FLOAT128 FltF31;
  3057. IA64_FLOAT128 FltF32;
  3058. IA64_FLOAT128 FltF33;
  3059. IA64_FLOAT128 FltF34;
  3060. IA64_FLOAT128 FltF35;
  3061. IA64_FLOAT128 FltF36;
  3062. IA64_FLOAT128 FltF37;
  3063. IA64_FLOAT128 FltF38;
  3064. IA64_FLOAT128 FltF39;
  3065. IA64_FLOAT128 FltF40;
  3066. IA64_FLOAT128 FltF41;
  3067. IA64_FLOAT128 FltF42;
  3068. IA64_FLOAT128 FltF43;
  3069. IA64_FLOAT128 FltF44;
  3070. IA64_FLOAT128 FltF45;
  3071. IA64_FLOAT128 FltF46;
  3072. IA64_FLOAT128 FltF47;
  3073. IA64_FLOAT128 FltF48;
  3074. IA64_FLOAT128 FltF49;
  3075. IA64_FLOAT128 FltF50;
  3076. IA64_FLOAT128 FltF51;
  3077. IA64_FLOAT128 FltF52;
  3078. IA64_FLOAT128 FltF53;
  3079. IA64_FLOAT128 FltF54;
  3080. IA64_FLOAT128 FltF55;
  3081. IA64_FLOAT128 FltF56;
  3082. IA64_FLOAT128 FltF57;
  3083. IA64_FLOAT128 FltF58;
  3084. IA64_FLOAT128 FltF59;
  3085. IA64_FLOAT128 FltF60;
  3086. IA64_FLOAT128 FltF61;
  3087. IA64_FLOAT128 FltF62;
  3088. IA64_FLOAT128 FltF63;
  3089. IA64_FLOAT128 FltF64;
  3090. IA64_FLOAT128 FltF65;
  3091. IA64_FLOAT128 FltF66;
  3092. IA64_FLOAT128 FltF67;
  3093. IA64_FLOAT128 FltF68;
  3094. IA64_FLOAT128 FltF69;
  3095. IA64_FLOAT128 FltF70;
  3096. IA64_FLOAT128 FltF71;
  3097. IA64_FLOAT128 FltF72;
  3098. IA64_FLOAT128 FltF73;
  3099. IA64_FLOAT128 FltF74;
  3100. IA64_FLOAT128 FltF75;
  3101. IA64_FLOAT128 FltF76;
  3102. IA64_FLOAT128 FltF77;
  3103. IA64_FLOAT128 FltF78;
  3104. IA64_FLOAT128 FltF79;
  3105. IA64_FLOAT128 FltF80;
  3106. IA64_FLOAT128 FltF81;
  3107. IA64_FLOAT128 FltF82;
  3108. IA64_FLOAT128 FltF83;
  3109. IA64_FLOAT128 FltF84;
  3110. IA64_FLOAT128 FltF85;
  3111. IA64_FLOAT128 FltF86;
  3112. IA64_FLOAT128 FltF87;
  3113. IA64_FLOAT128 FltF88;
  3114. IA64_FLOAT128 FltF89;
  3115. IA64_FLOAT128 FltF90;
  3116. IA64_FLOAT128 FltF91;
  3117. IA64_FLOAT128 FltF92;
  3118. IA64_FLOAT128 FltF93;
  3119. IA64_FLOAT128 FltF94;
  3120. IA64_FLOAT128 FltF95;
  3121. IA64_FLOAT128 FltF96;
  3122. IA64_FLOAT128 FltF97;
  3123. IA64_FLOAT128 FltF98;
  3124. IA64_FLOAT128 FltF99;
  3125. IA64_FLOAT128 FltF100;
  3126. IA64_FLOAT128 FltF101;
  3127. IA64_FLOAT128 FltF102;
  3128. IA64_FLOAT128 FltF103;
  3129. IA64_FLOAT128 FltF104;
  3130. IA64_FLOAT128 FltF105;
  3131. IA64_FLOAT128 FltF106;
  3132. IA64_FLOAT128 FltF107;
  3133. IA64_FLOAT128 FltF108;
  3134. IA64_FLOAT128 FltF109;
  3135. IA64_FLOAT128 FltF110;
  3136. IA64_FLOAT128 FltF111;
  3137. IA64_FLOAT128 FltF112;
  3138. IA64_FLOAT128 FltF113;
  3139. IA64_FLOAT128 FltF114;
  3140. IA64_FLOAT128 FltF115;
  3141. IA64_FLOAT128 FltF116;
  3142. IA64_FLOAT128 FltF117;
  3143. IA64_FLOAT128 FltF118;
  3144. IA64_FLOAT128 FltF119;
  3145. IA64_FLOAT128 FltF120;
  3146. IA64_FLOAT128 FltF121;
  3147. IA64_FLOAT128 FltF122;
  3148. IA64_FLOAT128 FltF123;
  3149. IA64_FLOAT128 FltF124;
  3150. IA64_FLOAT128 FltF125;
  3151. IA64_FLOAT128 FltF126;
  3152. IA64_FLOAT128 FltF127;
  3153. //
  3154. // fDebugRegs.
  3155. //
  3156. DWORD64 DbI0;
  3157. DWORD64 DbI1;
  3158. DWORD64 DbI2;
  3159. DWORD64 DbI3;
  3160. DWORD64 DbI4;
  3161. DWORD64 DbI5;
  3162. DWORD64 DbI6;
  3163. DWORD64 DbI7;
  3164. DWORD64 DbD0;
  3165. DWORD64 DbD1;
  3166. DWORD64 DbD2;
  3167. DWORD64 DbD3;
  3168. DWORD64 DbD4;
  3169. DWORD64 DbD5;
  3170. DWORD64 DbD6;
  3171. DWORD64 DbD7;
  3172. //
  3173. // fControlRegs.
  3174. //
  3175. // Application registers.
  3176. DWORD64 ApUNAT;
  3177. DWORD64 ApLC;
  3178. DWORD64 ApEC;
  3179. DWORD64 ApCCV;
  3180. DWORD64 ApDCR;
  3181. // Register stack registers.
  3182. DWORD64 RsPFS;
  3183. DWORD64 RsBSP;
  3184. DWORD64 RsBSPSTORE;
  3185. DWORD64 RsRSC;
  3186. DWORD64 RsRNAT;
  3187. // Trap status information.
  3188. DWORD64 StIPSR;
  3189. DWORD64 StIIP;
  3190. DWORD64 StIFS;
  3191. // iA32 related control registers.
  3192. DWORD64 StFCR;
  3193. DWORD64 Eflag;
  3194. DWORD64 SegCSD;
  3195. DWORD64 SegSSD;
  3196. DWORD64 Cflag;
  3197. DWORD64 StFSR;
  3198. DWORD64 StFIR;
  3199. DWORD64 StFDR;
  3200. //
  3201. // fSystemRegs.
  3202. //
  3203. // Performance monitor registers.
  3204. DWORD64 PfC0;
  3205. DWORD64 PfC1;
  3206. DWORD64 PfC2;
  3207. DWORD64 PfC3;
  3208. DWORD64 PfC4;
  3209. DWORD64 PfC5;
  3210. DWORD64 PfC6;
  3211. DWORD64 PfC7;
  3212. DWORD64 PfD0;
  3213. DWORD64 PfD1;
  3214. DWORD64 PfD2;
  3215. DWORD64 PfD3;
  3216. DWORD64 PfD4;
  3217. DWORD64 PfD5;
  3218. DWORD64 PfD6;
  3219. DWORD64 PfD7;
  3220. // Kernel bank shadow (hidden) registers.
  3221. DWORD64 IntH16;
  3222. DWORD64 IntH17;
  3223. DWORD64 IntH18;
  3224. DWORD64 IntH19;
  3225. DWORD64 IntH20;
  3226. DWORD64 IntH21;
  3227. DWORD64 IntH22;
  3228. DWORD64 IntH23;
  3229. DWORD64 IntH24;
  3230. DWORD64 IntH25;
  3231. DWORD64 IntH26;
  3232. DWORD64 IntH27;
  3233. DWORD64 IntH28;
  3234. DWORD64 IntH29;
  3235. DWORD64 IntH30;
  3236. DWORD64 IntH31;
  3237. // CPUID Registers - AR.
  3238. DWORD64 ApCPUID0;
  3239. DWORD64 ApCPUID1;
  3240. DWORD64 ApCPUID2;
  3241. DWORD64 ApCPUID3;
  3242. DWORD64 ApCPUID4;
  3243. DWORD64 ApCPUID5;
  3244. DWORD64 ApCPUID6;
  3245. DWORD64 ApCPUID7;
  3246. // Kernel Registers - AR.
  3247. DWORD64 ApKR0;
  3248. DWORD64 ApKR1;
  3249. DWORD64 ApKR2;
  3250. DWORD64 ApKR3;
  3251. DWORD64 ApKR4;
  3252. DWORD64 ApKR5;
  3253. DWORD64 ApKR6;
  3254. DWORD64 ApKR7;
  3255. // Interval time counter.
  3256. DWORD64 ApITC;
  3257. // Global control registers.
  3258. DWORD64 ApITM;
  3259. DWORD64 ApIVA;
  3260. DWORD64 ApPTA;
  3261. DWORD64 ApGPTA;
  3262. // Interruption information.
  3263. DWORD64 StISR;
  3264. DWORD64 StIFA;
  3265. DWORD64 StITIR;
  3266. DWORD64 StIIPA;
  3267. DWORD64 StIIM;
  3268. DWORD64 StIHA;
  3269. // External Interrupt control registers (SAPIC).
  3270. DWORD64 SaLID;
  3271. DWORD64 SaIVR;
  3272. DWORD64 SaTPR;
  3273. DWORD64 SaEOI;
  3274. DWORD64 SaIRR0;
  3275. DWORD64 SaIRR1;
  3276. DWORD64 SaIRR2;
  3277. DWORD64 SaIRR3;
  3278. DWORD64 SaITV;
  3279. DWORD64 SaPMV;
  3280. DWORD64 SaCMCV;
  3281. DWORD64 SaLRR0;
  3282. DWORD64 SaLRR1;
  3283. // Region registers.
  3284. DWORD64 Rr0;
  3285. DWORD64 Rr1;
  3286. DWORD64 Rr2;
  3287. DWORD64 Rr3;
  3288. DWORD64 Rr4;
  3289. DWORD64 Rr5;
  3290. DWORD64 Rr6;
  3291. DWORD64 Rr7;
  3292. // Protection Key registers.
  3293. DWORD64 Pkr0;
  3294. DWORD64 Pkr1;
  3295. DWORD64 Pkr2;
  3296. DWORD64 Pkr3;
  3297. DWORD64 Pkr4;
  3298. DWORD64 Pkr5;
  3299. DWORD64 Pkr6;
  3300. DWORD64 Pkr7;
  3301. DWORD64 Pkr8;
  3302. DWORD64 Pkr9;
  3303. DWORD64 Pkr10;
  3304. DWORD64 Pkr11;
  3305. DWORD64 Pkr12;
  3306. DWORD64 Pkr13;
  3307. DWORD64 Pkr14;
  3308. DWORD64 Pkr15;
  3309. // Translation Lookaside buffers.
  3310. DWORD64 TrI0;
  3311. DWORD64 TrI1;
  3312. DWORD64 TrI2;
  3313. DWORD64 TrI3;
  3314. DWORD64 TrI4;
  3315. DWORD64 TrI5;
  3316. DWORD64 TrI6;
  3317. DWORD64 TrI7;
  3318. DWORD64 TrD0;
  3319. DWORD64 TrD1;
  3320. DWORD64 TrD2;
  3321. DWORD64 TrD3;
  3322. DWORD64 TrD4;
  3323. DWORD64 TrD5;
  3324. DWORD64 TrD6;
  3325. DWORD64 TrD7;
  3326. // Machine Specific Registers.
  3327. DWORD64 SrMSR0;
  3328. DWORD64 SrMSR1;
  3329. DWORD64 SrMSR2;
  3330. DWORD64 SrMSR3;
  3331. DWORD64 SrMSR4;
  3332. DWORD64 SrMSR5;
  3333. DWORD64 SrMSR6;
  3334. DWORD64 SrMSR7;
  3335. } EXDI_CONTEXT_IA64, *PEXDI_CONTEXT_IA64;
  3336. // IA64 context access interface
  3337. [
  3338. object,
  3339. uuid(40c9adbb-de25-4ef4-a206-024440f78839),
  3340. helpstring("IeXdiIA64Context interface - eXdi Context access for IA64 processors 1.0 for Platform Builder 3.0 debugger - Microsoft 2002"),
  3341. pointer_default(ref)
  3342. ]
  3343. interface IeXdiIA64Context : IUnknown
  3344. {
  3345. /*++
  3346. Routine Name:
  3347. GetContext
  3348. Routine Description:
  3349. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  3350. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  3351. Argument(s):
  3352. pContext - Return context (CPU dependant structure).
  3353. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  3354. Return Value:
  3355. Error status:
  3356. S_OK: Function successful
  3357. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  3358. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  3359. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  3360. EXDI_E_NOTIMPL: Not implemented
  3361. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  3362. EXDI_E_INVALIDARG: One or more arguments are invalid
  3363. EXDI_E_ABORT: Operation aborted
  3364. EXDI_E_FAIL: Unspecified failure
  3365. EXDI_E_COMMUNICATION: Communication error between host driver and target
  3366. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  3367. --*/
  3368. HRESULT GetContext
  3369. (
  3370. [in, out] PEXDI_CONTEXT_IA64 pContext
  3371. );
  3372. /*++
  3373. Routine Name:
  3374. SetContext
  3375. Routine Description:
  3376. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  3377. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  3378. Argument(s):
  3379. pContext - Return context (CPU dependant structure).
  3380. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  3381. Return Value:
  3382. Error status:
  3383. S_OK: Function successful
  3384. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  3385. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  3386. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  3387. EXDI_E_NOTIMPL: Not implemented
  3388. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  3389. EXDI_E_INVALIDARG: One or more arguments are invalid
  3390. EXDI_E_ABORT: Operation aborted
  3391. EXDI_E_FAIL: Unspecified failure
  3392. EXDI_E_COMMUNICATION: Communication error between host driver and target
  3393. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  3394. --*/
  3395. HRESULT SetContext
  3396. (
  3397. [in] EXDI_CONTEXT_IA64 Context
  3398. );
  3399. }; // interface IeXdiIA64Context
  3400. /////////////////////////////////////////////////////////////////////////////
  3401. /////////////////////////////////////////////////////////////////////////////
  3402. //
  3403. // IeXdiClientNotifyMemChg
  3404. //
  3405. /////////////////////////////////////////////////////////////////////////////
  3406. /////////////////////////////////////////////////////////////////////////////
  3407. /////////////////////////////////////////////////////////////////////////////
  3408. // Notify Memory/IO/Reg change
  3409. /////////////////////////////////////////////////////////////////////////////
  3410. [
  3411. object,
  3412. uuid(47486F67-6461-6C65-5844-49434E4D4300),
  3413. helpstring("IeXdiClientNotifyMemChg interface - eXdi Notify Memory Changes 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  3414. pointer_default(ref)
  3415. ]
  3416. interface IeXdiClientNotifyMemChg : IUnknown
  3417. {
  3418. /*++
  3419. Routine Name:
  3420. NotifyMemoryChange
  3421. Routine Description:
  3422. Indicate a change in memory (virtual or physical or peripherical I/O or CPU reg - context) - The debugger can use this function to invalidate its internal cache.
  3423. This function should be called by the driver only when the target is halted. When the target is running, all memory cache should be invalidated.
  3424. Argument(s):
  3425. mtChanged - Memory change type. Indicates whether this memory change notification concerns virtual memory, physical memory or pheripherical IO, or CPU register
  3426. Address - Starting address of the data buffer to be accessed on the target.
  3427. bAddressSpace - If mtChanged != mtPhysicalOrPeriIO, Address space to be accessed (convention: 0 = Physical Memory, 1 = Peripherical I/O if not memory mapped, 2..255 = free for custom use)
  3428. otherwize, don't care.
  3429. dwNbElemChanged - Number of element(s) (of byDataWidth bits) to be accessed.
  3430. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  3431. Return Value:
  3432. Error status:
  3433. S_OK: Function successful
  3434. EXDI_E_NOTIMPL: Not implemented
  3435. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  3436. EXDI_E_INVALIDARG: One or more arguments are invalid
  3437. EXDI_E_ABORT: Operation aborted
  3438. EXDI_E_FAIL: Unspecified failure
  3439. EXDI_E_COMMUNICATION: Communication error between host driver and target
  3440. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  3441. --*/
  3442. HRESULT NotifyMemoryChange
  3443. (
  3444. [in] MEM_TYPE mtChanged,
  3445. [in] ADDRESS_TYPE Address,
  3446. [in] BYTE bAddressSpace,
  3447. [in] DWORD dwNbElemChanged,
  3448. [in] BYTE bAccessWidth
  3449. );
  3450. }; // interface IeXdiClientNotifyMemChg
  3451. /////////////////////////////////////////////////////////////////////////////
  3452. /////////////////////////////////////////////////////////////////////////////
  3453. //
  3454. // IeXdiClientNotifyRunChg
  3455. //
  3456. /////////////////////////////////////////////////////////////////////////////
  3457. /////////////////////////////////////////////////////////////////////////////
  3458. /////////////////////////////////////////////////////////////////////////////
  3459. // Notify Run state change
  3460. /////////////////////////////////////////////////////////////////////////////
  3461. [
  3462. object,
  3463. uuid(47486F67-6461-6C65-5844-49434E525343),
  3464. helpstring("IeXdiClientNotifyRunChg interface - eXdi Notify Run State Changes 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  3465. pointer_default(ref)
  3466. ]
  3467. interface IeXdiClientNotifyRunChg : IUnknown
  3468. {
  3469. /*++
  3470. Routine Name:
  3471. NotifyRunStateChange
  3472. Routine Description:
  3473. Indicate a change in Run state - The debugger can use this function to invalidate its internal cache.
  3474. This function should be called by the driver only when the target is halted. When the target is running, all memory cache should be invalidated.
  3475. Argument(s):
  3476. ersCurrent - Supplies the current Run Status Type
  3477. ehrCurrent - Suppliest the current Halt Reason Type (hrNone if Run Status is not Halted)
  3478. CurrentExecAddress - Current program / instruction pointer if Run Status is Halted, undefined otherwise.
  3479. dwExceptionCode - indicate type / source of exception (Code is platform dependant) if Halted due to exception ((rsHalted == ersCurrent) && (hrException == ehrCurrent)), undefined otherwise.
  3480. Return Value:
  3481. Error status:
  3482. S_OK: Function successful
  3483. EXDI_E_NOTIMPL: Not implemented
  3484. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  3485. EXDI_E_INVALIDARG: One or more arguments are invalid
  3486. EXDI_E_ABORT: Operation aborted
  3487. EXDI_E_FAIL: Unspecified failure
  3488. EXDI_E_COMMUNICATION: Communication error between host driver and target
  3489. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  3490. --*/
  3491. HRESULT NotifyRunStateChange
  3492. (
  3493. [in] RUN_STATUS_TYPE ersCurrent,
  3494. [in] HALT_REASON_TYPE ehrCurrent,
  3495. [in] ADDRESS_TYPE CurrentExecAddress,
  3496. [in] DWORD dwExceptionCode
  3497. );
  3498. }; // interface IeXdiClientNotifyRunChg
  3499. /////////////////////////////////////////////////////////////////////////////
  3500. /////////////////////////////////////////////////////////////////////////////
  3501. //
  3502. // IeXdiClientCfg
  3503. //
  3504. /////////////////////////////////////////////////////////////////////////////
  3505. /////////////////////////////////////////////////////////////////////////////
  3506. /////////////////////////////////////////////////////////////////////////////
  3507. // Probe / Emulator Configuration
  3508. /////////////////////////////////////////////////////////////////////////////
  3509. // This is totally probe vendor specific
  3510. /////////////////////////////////////////////////////////////////////////////
  3511. /////////////////////////////////////////////////////////////////////////////
  3512. //
  3513. // IeXdiClientTraceCtrl
  3514. //
  3515. /////////////////////////////////////////////////////////////////////////////
  3516. /////////////////////////////////////////////////////////////////////////////
  3517. /////////////////////////////////////////////////////////////////////////////
  3518. // Trace Control
  3519. /////////////////////////////////////////////////////////////////////////////
  3520. // This can be probe vendor specific because there are so many variation in
  3521. // probe support of trigger / event / trace type. The probe vendor will also
  3522. // write the data collectors. An example of complex trace control and trace
  3523. // notification APIs are described later.
  3524. /////////////////////////////////////////////////////////////////////////////
  3525. /////////////////////////////////////////////////////////////////////////////
  3526. //
  3527. // IeXdiClientSubstCtrl
  3528. //
  3529. /////////////////////////////////////////////////////////////////////////////
  3530. /////////////////////////////////////////////////////////////////////////////
  3531. /////////////////////////////////////////////////////////////////////////////
  3532. // Memory and IO Substitution Control
  3533. /////////////////////////////////////////////////////////////////////////////
  3534. // This can be probe vendor specific because there are so many variation in
  3535. // probe support of IO or Memory substition mechanism (overlay, query by
  3536. // port). The probe vendor will also write the data collectors. An example of
  3537. // complex trace control and trace notification APIs are described later.