Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3670 lines
141 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 IeXdiSHXContext;
  114. // HRESULT GetContext ([in, out] PCONTEXT_SHX pContext);
  115. // HRESULT SetContext ([in] CONTEXT_SHX Context);
  116. interface IeXdiMIPSContext;
  117. // HRESULT GetContext ([in, out] PCONTEXT_MIPS pContext);
  118. // HRESULT SetContext ([in] CONTEXT_MIPS Context);
  119. interface IeXdiARMContext;
  120. // HRESULT GetContext ([in, out] PCONTEXT_ARM pContext);
  121. // HRESULT SetContext ([in] CONTEXT_ARM Context);
  122. interface IeXdiPPCContext;
  123. // HRESULT GetContext ([in, out] PCONTEXT_PPC pContext);
  124. // HRESULT SetContext ([in] CONTEXT_PPC Context);
  125. // Other interfaces
  126. interface IeXdiCodeBreakpoint;
  127. // 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);
  128. // HRESULT SetState ([in] BOOL fEnabled, [in] BOOL fResetBypassedOccurences);
  129. interface IeXdiDataBreakpoint;
  130. // 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);
  131. // HRESULT SetState ([in] BOOL fEnabled, [in] BOOL fResetBypassedOccurences);
  132. interface IeXdiEnumCodeBreakpoint;
  133. // HRESULT Next ([in] DWORD celt, [out, size_is(celt), length_is(*pceltFetched)] IeXdiCodeBreakpoint *apieXdiCodeBreakpoint[], [out] DWORD *pceltFetched);
  134. // HRESULT Skip ([in] DWORD celt);
  135. // HRESULT Reset (void);
  136. // HRESULT GetCount ([out] DWORD *pcelt);
  137. // HRESULT GetNext ([out] IeXdiCodeBreakpoint **ppieXdiCodeBreakpoint);
  138. // HRESULT DisableAll (void);
  139. // HRESULT EnableAll (void);
  140. interface IeXdiEnumDataBreakpoint;
  141. // HRESULT Next ([in] DWORD celt, [out, size_is(celt), length_is(*pceltFetched)] IeXdiDataBreakpoint *apieXdiDataBreakpoint[], [out] DWORD *pceltFetched);
  142. // HRESULT Skip ([in] DWORD celt);
  143. // HRESULT Reset (void);
  144. // HRESULT GetCount ([out] DWORD *pcelt);
  145. // HRESULT GetNext ([out] IeXdiDataBreakpoint **ppieXdiDataBreakpoint);
  146. // HRESULT DisableAll (void);
  147. // HRESULT EnableAll (void);
  148. //
  149. // error codes
  150. //
  151. cpp_quote("// Common eXDI HRESULT values:")
  152. cpp_quote("//")
  153. cpp_quote("#define FACILITY_EXDI (130)")
  154. cpp_quote("#define CUSTOMER_FLAG (1)")
  155. cpp_quote("//")
  156. cpp_quote("#define SEV_SUCCESS (0)")
  157. cpp_quote("#define SEV_INFORMATIONAL (1)")
  158. cpp_quote("#define SEV_WARNING (2)")
  159. cpp_quote("#define SEV_ERROR (3)")
  160. cpp_quote("//")
  161. cpp_quote("#define MAKE_EXDI_ERROR(ErrorCode,Severity) ((DWORD)(ErrorCode) | (FACILITY_EXDI << 16) | (CUSTOMER_FLAG << 29) | (Severity << 30))")
  162. cpp_quote("//")
  163. cpp_quote("// S_OK (0) // Operation successful")
  164. 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)")
  165. cpp_quote("#define EXDI_E_OUTOFMEMORY MAKE_EXDI_ERROR (0x000E, SEV_ERROR) // Failed to allocate necessary memory")
  166. cpp_quote("#define EXDI_E_INVALIDARG MAKE_EXDI_ERROR (0x0057, SEV_ERROR) // One or more arguments are invalid")
  167. cpp_quote("#define EXDI_E_ABORT MAKE_EXDI_ERROR (0x4004, SEV_ERROR) // Operation aborted")
  168. cpp_quote("#define EXDI_E_FAIL MAKE_EXDI_ERROR (0x4005, SEV_ERROR) // Unspecified failure")
  169. cpp_quote("#define EXDI_E_COMMUNICATION MAKE_EXDI_ERROR (0x0001, SEV_ERROR) // Communication error between host driver and target")
  170. cpp_quote("//")
  171. cpp_quote("#define EXDI_E_NOLASTEXCEPTION MAKE_EXDI_ERROR (0x0002, SEV_ERROR) // No exception occured already, cannot return last")
  172. cpp_quote("#define EXDI_I_TGTALREADYRUNNING MAKE_EXDI_ERROR (0x0003, SEV_INFORMATIONAL) // Indicates that the target was already running")
  173. cpp_quote("#define EXDI_I_TGTALREADYHALTED MAKE_EXDI_ERROR (0x0004, SEV_INFORMATIONAL) // Indicates that the target was already halted")
  174. cpp_quote("#define EXDI_E_TGTWASNOTHALTED MAKE_EXDI_ERROR (0x0005, SEV_ERROR) // The target was not halted (before Single Step command issued)")
  175. cpp_quote("#define EXDI_E_NORESAVAILABLE MAKE_EXDI_ERROR (0x0006, SEV_ERROR) // No resource available, cannot instanciate Breakpoint (in the kind requested)")
  176. cpp_quote("#define EXDI_E_NOREBOOTAVAIL MAKE_EXDI_ERROR (0x0007, SEV_ERROR) // The external reset is not available programatically to the probe")
  177. 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")
  178. 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")
  179. 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")
  180. 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")
  181. // 0x000E is used by EXDI_E_OUTOFMEMORY
  182. // From definition in winerror.h
  183. // Values are 32 bit values layed out as follows:
  184. //
  185. // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  186. // 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
  187. // +---+-+-+-----------------------+-------------------------------+
  188. // |Sev|C|R| Facility | Code |
  189. // +---+-+-+-----------------------+-------------------------------+
  190. // where
  191. // Sev - is the severity code
  192. // 00 - Success
  193. // 01 - Informational
  194. // 10 - Warning
  195. // 11 - Error
  196. // C - is the Customer code flag
  197. // R - is a reserved bit
  198. // Facility - is the facility code
  199. // Code - is the facility's status code
  200. // Already define the facility codes
  201. // FACILITY_WINDOWS 8
  202. // FACILITY_STORAGE 3
  203. // FACILITY_SSPI 9
  204. // FACILITY_SETUPAPI 15
  205. // FACILITY_RPC 1
  206. // FACILITY_WIN32 7
  207. // FACILITY_CONTROL 10
  208. // FACILITY_NULL 0
  209. // FACILITY_MSMQ 14
  210. // FACILITY_MEDIASERVER 13
  211. // FACILITY_INTERNET 12
  212. // FACILITY_ITF 4
  213. // FACILITY_DISPATCH 2
  214. // FACILITY_CERT 11
  215. /////////////////////////////////////////////////////////////////////////////
  216. /////////////////////////////////////////////////////////////////////////////
  217. //
  218. // IeXdiServer
  219. //
  220. /////////////////////////////////////////////////////////////////////////////
  221. /////////////////////////////////////////////////////////////////////////////
  222. /////////////////////////////////////////////////////////////////////////////
  223. // Run Control section of the Interface
  224. /////////////////////////////////////////////////////////////////////////////
  225. typedef __int64 ADDRESS_TYPE, *PADDRESS_TYPE;
  226. typedef unsigned __int64 DWORD64, *PDWORD64;
  227. // Used by field TargetProcessorFamily in GLOBAL_TARGET_INFO_STRUCT. This info is the strict necessary to enable the debugger to identify completely the target.
  228. const DWORD PROCESSOR_FAMILY_X86 = 0;
  229. const DWORD PROCESSOR_FAMILY_SH3 = 1;
  230. const DWORD PROCESSOR_FAMILY_SH4 = 2;
  231. const DWORD PROCESSOR_FAMILY_MIPS = 3;
  232. const DWORD PROCESSOR_FAMILY_ARM = 4;
  233. const DWORD PROCESSOR_FAMILY_PPC = 5;
  234. const DWORD PROCESSOR_FAMILY_UNK = 0xFFFFFFFF; // unknown
  235. // 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
  236. // 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
  237. typedef
  238. struct _DEBUG_ACCESS_CAPABILITIES_STRUCT
  239. {
  240. BOOL fWriteCBPWhileRunning; // if TRUE, can set or clear code breakpoint while running (on the fly, no need to be halted)
  241. BOOL fReadCBPWhileRunning; // if TRUE, can read code breakpoint (list) while running (on the fly, no need to be halted)
  242. BOOL fWriteDBPWhileRunning; // if TRUE, can set or clear data breakpoint while running (on the fly, no need to be halted)
  243. BOOL fReadDBPWhileRunning; // if TRUE, can read data breakpoint (list) while running (on the fly, no need to be halted)
  244. BOOL fWriteVMWhileRunning; // if TRUE, can write virtual memory while running (on the fly, no need to be halted)
  245. BOOL fReadVMWhileRunning; // if TRUE, can read virtual memory while running (on the fly, no need to be halted)
  246. BOOL fWritePMWhileRunning; // if TRUE, can write physical memory or peripherical I/O while running (on the fly, no need to be halted)
  247. BOOL fReadPMWhileRunning; // if TRUE, can read physical memory or peripherical I/O while running (on the fly, no need to be halted)
  248. BOOL fWriteRegWhileRunning; // if TRUE, can write CPU / CP registers while running (on the fly, no need to be halted)
  249. BOOL fReadRegWhileRunning; // if TRUE, can read CPU / CP registers while running (on the fly, no need to be halted)
  250. }
  251. DEBUG_ACCESS_CAPABILITIES_STRUCT, *PDEBUG_ACCESS_CAPABILITIES_STRUCT;
  252. typedef
  253. struct _GLOBAL_TARGET_INFO_STRUCT
  254. {
  255. DWORD TargetProcessorFamily;
  256. DEBUG_ACCESS_CAPABILITIES_STRUCT dbc;
  257. LPOLESTR szTargetName;
  258. LPOLESTR szProbeName;
  259. }
  260. GLOBAL_TARGET_INFO_STRUCT, *PGLOBAL_TARGET_INFO_STRUCT;
  261. typedef
  262. enum _RUN_STATUS_TYPE
  263. {
  264. rsRunning, // The target is currently executing code
  265. rsHalted, // The target is completely stopped
  266. rsError, // The target is in an error state (warning: different than exception)
  267. rsUnknown
  268. }
  269. RUN_STATUS_TYPE, *PRUN_STATUS_TYPE;
  270. typedef
  271. enum _PHALT_REASON_TYPE
  272. {
  273. hrNone, // Status type is not rsHalted
  274. hrUser, // "Manual" asynchronous halt
  275. hrException, // An execption just occured
  276. hrBp, // Breakpoint (code or data)
  277. hrStep, // We just excuted a single / multiple / range step
  278. hrUnknown
  279. }
  280. HALT_REASON_TYPE, *PHALT_REASON_TYPE;
  281. typedef
  282. struct _EXCEPTION_TYPE
  283. {
  284. DWORD dwCode; // indicate type / source of exception (platfrom dependant)
  285. ADDRESS_TYPE Address; // program / instruction pointer where the exception occured
  286. } EXCEPTION_TYPE, *PEXCEPTION_TYPE; // Platform dependant
  287. typedef
  288. enum _CBP_KIND
  289. {
  290. cbptAlgo, // Let the probe driver decide if code breakpoint can be hw or sw based on resources available
  291. cbptHW, // Force the code breakpoint to be a hardware one (address comparator in hardware debug logic)
  292. cbptSW // Force the code breakpoint to be a software one (bp instruction replacing the regulare instruction)
  293. } CBP_KIND, *PCBP_KIND;
  294. typedef
  295. enum _DATA_ACCESS_TYPE
  296. {
  297. daWrite = 0,
  298. daRead = 1,
  299. daBoth = 2 // Don't care
  300. }
  301. DATA_ACCESS_TYPE, *PDATA_ACCESS_TYPE;
  302. typedef
  303. struct _BREAKPOINT_SUPPORT_TYPE
  304. {
  305. BOOL fCodeBpBypassCountSupported; // if TRUE, Bypass counter is supported on Code Breakpoint
  306. BOOL fDataBpBypassCountSupported; // if TRUE, Bypass counter is supported on Data Breakpoint
  307. BOOL fDataBpSupported; // if FALSE, no Data Breakpoint resource are ever available from the target
  308. BOOL fDataBpMaskableAddress; // if TRUE, Data Breakpoint address mask can be defined (implies that fDataBpSupported field is TRUE)
  309. BOOL fDataBpMaskableData; // if TRUE, Data Breakpoint data mask can be defined (implies that fDataBpSupported field is TRUE)
  310. BOOL fDataBpDataWidthSpecifiable; // if TRUE, Data Breakpoint specific data width can be defined (implies that fDataBpSupported field is TRUE)
  311. BOOL fDataBpReadWriteSpecifiable; // if TRUE, Data Breakpoint specific data access type can be defined (implies that fDataBpSupported field is TRUE)
  312. 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)
  313. } BREAKPOINT_SUPPORT_TYPE, *PBREAKPOINT_SUPPORT_TYPE;
  314. typedef
  315. enum _MEM_TYPE
  316. {
  317. mtVirtual,
  318. mtPhysicalOrPeriIO,
  319. mtContext
  320. } MEM_TYPE, *PMEM_TYPE;
  321. // Exception information
  322. // These are the actions which the debugger may take in response to an exception raised in the debuggee.
  323. typedef
  324. enum _EXCEPTION_DEFAULT_ACTION_TYPE
  325. {
  326. edaIgnore,
  327. edaNotify,
  328. edaStop
  329. } EXCEPTION_DEFAULT_ACTION_TYPE;
  330. typedef
  331. struct _EXCEPTION_DESCRIPTION_TYPE
  332. {
  333. DWORD dwExceptionCode;
  334. EXCEPTION_DEFAULT_ACTION_TYPE efd;
  335. wchar_t szDescription [60];
  336. } EXCEPTION_DESCRIPTION_TYPE;
  337. [
  338. object,
  339. uuid(47486F67-6461-6C65-5844-495352435201),
  340. helpstring("IeXdiServer interface - eXdi Server Run Control and Ressource Access 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  341. pointer_default(ref)
  342. ]
  343. interface IeXdiServer : IUnknown
  344. {
  345. /*++
  346. Routine Name:
  347. GetTargetInfo
  348. Routine Description:
  349. Return Global information on Target (and Probe / emulator)
  350. Argument(s):
  351. pgti - Returns Global Target Info structure
  352. Return Value:
  353. Error status:
  354. S_OK: Function successful
  355. EXDI_E_NOTIMPL: Not implemented
  356. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  357. EXDI_E_INVALIDARG: One or more arguments are invalid
  358. EXDI_E_ABORT: Operation aborted
  359. EXDI_E_FAIL: Unspecified failure
  360. EXDI_E_COMMUNICATION: Communication error between host driver and target
  361. --*/
  362. HRESULT GetTargetInfo
  363. (
  364. [out] PGLOBAL_TARGET_INFO_STRUCT pgti
  365. );
  366. // Used in parameter dwModeBitField of function SetDebugMode
  367. 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)")
  368. cpp_quote(" // may be optionaly handled (can return EXDI_E_NOTIMPL)")
  369. cpp_quote(" // If FALSE indicates that Kernel Debugger is not active so HW on-chip debug capabilities are the only ")
  370. cpp_quote(" // one available and should be implemented.")
  371. /*++
  372. Routine Name:
  373. SetDebugMode
  374. Routine Description:
  375. Indicates that the debugger can control the target via KDAPI (kernel debug capabilities)
  376. Argument(s):
  377. dwModeBitField - Bit field defining the new debug mode.
  378. Return Value:
  379. Error status:
  380. S_OK: Function successful
  381. EXDI_E_NOTIMPL: Not implemented
  382. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  383. EXDI_E_INVALIDARG: One or more arguments are invalid
  384. EXDI_E_ABORT: Operation aborted
  385. EXDI_E_FAIL: Unspecified failure
  386. EXDI_E_COMMUNICATION: Communication error between host driver and target
  387. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  388. --*/
  389. HRESULT SetDebugMode
  390. (
  391. [in] DWORD dwModeBitField
  392. );
  393. /*++
  394. Routine Name:
  395. GetExceptionDescriptionList
  396. Routine Description:
  397. Return the supported Exception Description Table
  398. Argument(s):
  399. dwNbElementToReturn - number of EXCEPTION_DESCRIPTION_TYPE elements to be provided in pedTable
  400. pedTable - Table of EXCEPTION_DESCRIPTION_TYPE elements (association between exception number / name / debugger action)
  401. pdwNbTotalExceptionInList - Returns the total number of EXCEPTION_DESCRIPTION_TYPE elements available
  402. Return Value:
  403. Error status:
  404. S_OK: Function successful
  405. EXDI_E_NOTIMPL: Not implemented
  406. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  407. EXDI_E_INVALIDARG: One or more arguments are invalid
  408. EXDI_E_ABORT: Operation aborted
  409. EXDI_E_FAIL: Unspecified failure
  410. EXDI_E_COMMUNICATION: Communication error between host driver and target
  411. --*/
  412. HRESULT GetExceptionDescriptionList
  413. (
  414. [in] DWORD dwNbElementToReturn,
  415. [out, size_is(dwNbElementToReturn)] EXCEPTION_DESCRIPTION_TYPE* pedTable,
  416. [out] DWORD *pdwNbTotalExceptionInList
  417. );
  418. /*++
  419. Routine Name:
  420. GetErrorDescription
  421. Routine Description:
  422. Return text description of an Error code returned by the eXDI driver
  423. Argument(s):
  424. pszLastErrorDesc - Returns the description of an error seen with the probe or target. This should mainly be used for debugging purposes.
  425. Return Value:
  426. Error status:
  427. S_OK: Function successful
  428. EXDI_E_NOTIMPL: Not implemented
  429. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  430. EXDI_E_INVALIDARG: One or more arguments are invalid
  431. EXDI_E_ABORT: Operation aborted
  432. EXDI_E_FAIL: Unspecified failure
  433. EXDI_E_COMMUNICATION: Communication error between host driver and target
  434. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  435. --*/
  436. HRESULT GetErrorDescription
  437. (
  438. [in] HRESULT ErrorCode,
  439. [out] LPOLESTR *pszErrorDesc
  440. );
  441. /*++
  442. Routine Name:
  443. SetWaitOnConcurentUse
  444. Routine Description:
  445. Set Wait on Concurent Use flag - if TRUE, if a driver function needs to access the a resource already used, the driver function should
  446. wait for availibility of resource before returning.
  447. - if FALSE, if a driver function needs to access the a resource already used, the driver function should
  448. return immediately with the EXDI_E_USEDBYCONCURENTTHREAD error code.
  449. Note: the default value for the flag (at initialization of the probe driver) is TRUE.
  450. Argument(s):
  451. fNewWaitOnConcurentUseFlag - New value to set the Wait on Concurent Use flag.
  452. Return Value:
  453. Error status:
  454. S_OK: Function successful
  455. EXDI_E_NOTIMPL: Not implemented
  456. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  457. EXDI_E_INVALIDARG: One or more arguments are invalid
  458. EXDI_E_ABORT: Operation aborted
  459. EXDI_E_FAIL: Unspecified failure
  460. EXDI_E_COMMUNICATION: Communication error between host driver and target
  461. --*/
  462. HRESULT SetWaitOnConcurentUse
  463. (
  464. [in] BOOL fNewWaitOnConcurentUseFlag
  465. );
  466. /*++
  467. Routine Name:
  468. GetRunStatus
  469. Routine Description:
  470. Return the current Run Status (Running, Stopped due to Breakpoint ...).
  471. Argument(s):
  472. persCurrent - Returns the current Run Status Type
  473. pehrCurrent - Returns the current Halt Reason Type (hrNone if Run Status is not Halted)
  474. pCurrentExecAddress - Returns the current program / instruction pointer if Run Status is Halted, undefined otherwise.
  475. pdwExceptionCode - Returns the type / source of exception (Code is platform dependant) if Halted due to exception ((rsHalted == *persCurrent) && (hrException == *pehrCurrent)), undefined otherwise.
  476. Return Value:
  477. Error status:
  478. S_OK: Function successful
  479. EXDI_E_NOTIMPL: Not implemented
  480. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  481. EXDI_E_INVALIDARG: One or more arguments are invalid
  482. EXDI_E_ABORT: Operation aborted
  483. EXDI_E_FAIL: Unspecified failure
  484. EXDI_E_COMMUNICATION: Communication error between host driver and target
  485. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  486. --*/
  487. HRESULT GetRunStatus
  488. (
  489. [out] PRUN_STATUS_TYPE persCurrent,
  490. [out] PHALT_REASON_TYPE pehrCurrent,
  491. [out] ADDRESS_TYPE *pCurrentExecAddress,
  492. [out] DWORD *pdwExceptionCode
  493. );
  494. /*++
  495. Routine Name:
  496. GetLastException
  497. Routine Description:
  498. Return the last exception that happened.
  499. Argument(s):
  500. pexLast - Returns the last exception that occured (if none return value is EXDI_E_NOLASTEXCEPTION)
  501. Return Value:
  502. Error status:
  503. S_OK: Function successful
  504. EXDI_E_NOLASTEXCEPTION: No exception occured already, cannot return last
  505. EXDI_E_NOTIMPL: Not implemented
  506. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  507. EXDI_E_INVALIDARG: One or more arguments are invalid
  508. EXDI_E_ABORT: Operation aborted
  509. EXDI_E_FAIL: Unspecified failure
  510. EXDI_E_COMMUNICATION: Communication error between host driver and target
  511. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  512. --*/
  513. HRESULT GetLastException
  514. (
  515. [out] PEXCEPTION_TYPE pexLast
  516. );
  517. /*++
  518. Routine Name:
  519. Run
  520. Routine Description:
  521. Command target to Run.
  522. Argument(s):
  523. none
  524. Return Value:
  525. Error status:
  526. S_OK: Function successful (and target was not already running)
  527. EXDI_I_TGTALREADYRUNNING: Indicates that the target was already running
  528. EXDI_E_NOTIMPL: Not implemented
  529. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  530. EXDI_E_ABORT: Operation aborted
  531. EXDI_E_FAIL: Unspecified failure
  532. EXDI_E_COMMUNICATION: Communication error between host driver and target
  533. --*/
  534. HRESULT Run
  535. (
  536. void
  537. );
  538. /*++
  539. Routine Name:
  540. Halt
  541. Routine Description:
  542. Command target to Halt (complete control unit freeze).
  543. Argument(s):
  544. none
  545. Return Value:
  546. Error status:
  547. S_OK: Function successful (and target was not already halted)
  548. EXDI_I_TGTALREADYHALTED: Indicates that the target was already halted
  549. EXDI_E_NOTIMPL: Not implemented
  550. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  551. EXDI_E_ABORT: Operation aborted
  552. EXDI_E_FAIL: Unspecified failure
  553. EXDI_E_COMMUNICATION: Communication error between host driver and target
  554. --*/
  555. HRESULT Halt
  556. (
  557. void
  558. );
  559. /*++
  560. Routine Name:
  561. DoSingleStep
  562. Routine Description:
  563. Command target to execute a single instruction and then halt again.
  564. Argument(s):
  565. none
  566. Return Value:
  567. Error status:
  568. S_OK: Function successful
  569. EXDI_E_TGTWASNOTHALTED: The target was not halted
  570. EXDI_E_NORESAVAILABLE: No Resource available to do Single Step (not direct on-chip support or no bp resource avail)
  571. If Single Step support not available, return this error code too
  572. EXDI_E_NOTIMPL: Not implemented
  573. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  574. EXDI_E_ABORT: Operation aborted
  575. EXDI_E_FAIL: Unspecified failure
  576. EXDI_E_COMMUNICATION: Communication error between host driver and target
  577. --*/
  578. HRESULT DoSingleStep
  579. (
  580. void
  581. );
  582. /*++
  583. Routine Name:
  584. DoMultipleStep
  585. Routine Description:
  586. Command target to execute a fixed number of instructions and then halt again.
  587. Note that the target may still be running when the call returns.
  588. Argument(s):
  589. dwNbInstructions - Number of instructions to execute.
  590. Return Value:
  591. Error status:
  592. S_OK: Function successful
  593. EXDI_E_TGTWASNOTHALTED: The target was not halted
  594. EXDI_E_NORESAVAILABLE: No Resource available to do Stepping (not direct on-chip support or no bp resource avail)
  595. If Multiple Step support not available, return this error code too
  596. EXDI_E_NOTIMPL: Not implemented
  597. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  598. EXDI_E_INVALIDARG: One or more arguments are invalid
  599. EXDI_E_ABORT: Operation aborted
  600. EXDI_E_FAIL: Unspecified failure
  601. EXDI_E_COMMUNICATION: Communication error between host driver and target
  602. --*/
  603. HRESULT DoMultipleStep
  604. (
  605. [in] DWORD dwNbInstructions
  606. );
  607. /*++
  608. Routine Name:
  609. DoRangeStep
  610. Routine Description:
  611. Command target to step out of an address range and then halt again (run while in the given range).
  612. Note that the target may still be running when the call returns.
  613. Argument(s):
  614. FirstAddress - First address of the address range to run out of.
  615. LastAddress - Last address of the address range to run out of.
  616. Return Value:
  617. Error status:
  618. S_OK: Function successful
  619. EXDI_E_TGTWASNOTHALTED: The target was not halted
  620. EXDI_E_NORESAVAILABLE: No Resource available to do Range Step (not direct on-chip support or no bp resource avail)
  621. If Range Step support not available, return this error code too
  622. EXDI_E_NOTIMPL: Not implemented
  623. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  624. EXDI_E_INVALIDARG: One or more arguments are invalid
  625. EXDI_E_ABORT: Operation aborted
  626. EXDI_E_FAIL: Unspecified failure
  627. EXDI_E_COMMUNICATION: Communication error between host driver and target
  628. --*/
  629. HRESULT DoRangeStep
  630. (
  631. [in] ADDRESS_TYPE FirstAddress,
  632. [in] ADDRESS_TYPE LastAddress
  633. );
  634. /*++
  635. Routine Name:
  636. Reboot
  637. Routine Description:
  638. Command target to reboot (external Reset).
  639. Argument(s):
  640. none
  641. Return Value:
  642. Error status:
  643. S_OK: Function successful
  644. EXDI_E_NOREBOOTAVAIL: The external reset is not available programatically to the probe
  645. EXDI_E_NOTIMPL: Not implemented
  646. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  647. EXDI_E_ABORT: Operation aborted
  648. EXDI_E_FAIL: Unspecified failure
  649. EXDI_E_COMMUNICATION: Communication error between host driver and target
  650. --*/
  651. HRESULT Reboot
  652. (
  653. void
  654. );
  655. /*++
  656. Routine Name:
  657. GetBpSupport
  658. Routine Description:
  659. Get Breakpoint support
  660. Argument(s):
  661. pbps - Returns a structure that describes the breakpoint setting capabilities
  662. Return Value:
  663. Error status:
  664. S_OK: Function successful
  665. EXDI_E_NOTIMPL: Not implemented
  666. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  667. EXDI_E_INVALIDARG: One or more arguments are invalid
  668. EXDI_E_ABORT: Operation aborted
  669. EXDI_E_FAIL: Unspecified failure
  670. EXDI_E_COMMUNICATION: Communication error between host driver and target
  671. --*/
  672. HRESULT GetBpSupport
  673. (
  674. [out] PBREAKPOINT_SUPPORT_TYPE pbps
  675. );
  676. /*++
  677. Routine Name:
  678. GetNbCodeBpAvail
  679. Routine Description:
  680. Get Code Breakpoint availability
  681. Argument(s):
  682. pdwNbHwCodeBpAvail - Returns the number of Hardware Code Breakpoint still available on the target.
  683. If no limit known, returns -1 (4294967295)
  684. Note: If Code Breakpoint support not available, returns 0 and Error Status S_OK
  685. pdwNbSwCodeBpAvail - Returns the number of Software Code Breakpoint still available on the target.
  686. If no limit known, returns -1 (4294967295)
  687. Note: If code Breakpoint support not available, returns 0 and Error Status S_OK
  688. Return Value:
  689. Error status:
  690. S_OK: Function successful
  691. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  692. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  693. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  694. EXDI_E_NOTIMPL: Not implemented
  695. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  696. EXDI_E_INVALIDARG: One or more arguments are invalid
  697. EXDI_E_ABORT: Operation aborted
  698. EXDI_E_FAIL: Unspecified failure
  699. EXDI_E_COMMUNICATION: Communication error between host driver and target
  700. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  701. --*/
  702. HRESULT GetNbCodeBpAvail
  703. (
  704. [out] DWORD *pdwNbHwCodeBpAvail,
  705. [out] DWORD *pdwNbSwCodeBpAvail
  706. );
  707. /*++
  708. Routine Name:
  709. GetNbDataBpAvail
  710. Routine Description:
  711. Get Data Breakpoint availability
  712. Argument(s):
  713. pdwNbDataBpAvail - Returns the number of Data Breakpoint still available on the target.
  714. If no limit known, returns -1 (4294967295)
  715. Note: If Data Breakpoint support not available, returns 0 and Error Status S_OK
  716. Return Value:
  717. Error status:
  718. S_OK: Function successful
  719. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  720. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  721. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadDBPWhileRunning
  722. EXDI_E_NOTIMPL: Not implemented
  723. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  724. EXDI_E_INVALIDARG: One or more arguments are invalid
  725. EXDI_E_ABORT: Operation aborted
  726. EXDI_E_FAIL: Unspecified failure
  727. EXDI_E_COMMUNICATION: Communication error between host driver and target
  728. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  729. --*/
  730. HRESULT GetNbDataBpAvail
  731. (
  732. [out] DWORD *pdwNbDataBpAvail
  733. );
  734. /*++
  735. Routine Name:
  736. AddCodeBreakpoint
  737. Routine Description:
  738. Add new code Breakpoint. The newly created breakpoint is initially disabled (can be enabled with *ppieXdiCodeBreakpoint->SetState(...))
  739. and so should not use any resources.
  740. 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.
  741. Argument(s):
  742. Address - Address of the instruction to break on
  743. cbpk - Indicates if the code breakpoint must be hardware, software (bp instruction) or
  744. if the probe driver can decide based on its algorithm and resources available.
  745. Note: In the case of sw bp, the probe driver must keep track of instruction being replaced.
  746. mt - Instruction Memory type. Indicates whether this memory address concerns virtual memory or physical
  747. memory (pheripherical IO is not applicable and mtContext value is not accepted)
  748. dwExecMode - In the case of multiple mode processors, give a hint (if necessary) on the process mode at the
  749. time of the execution of the code where to set the breakpoint. For example, in the case of a
  750. software breakpoint, the trap instruction may be different in 16 bit mode than 32 bit mode on
  751. processors having the 2 modes (ARM and MIPS).
  752. Should be 0 for 32 bit mode (default). Should be 1 for 16 bit mode.
  753. dwTotalBypassCount - Total number of bypass before triggering a CPU halt on this breakpoint
  754. Note: Should be 0 if Total Bypass Count is not supported - see BREAKPOINT_SUPPORT_TYPE.fCodeBpBypassCountSupported
  755. ppieXdiCodeBreakpoint - Returns a pointer to the newly created breakpoint object's interface.
  756. Return Value:
  757. Error status:
  758. S_OK: Function successful
  759. EXDI_E_NORESAVAILABLE: No (Breakpoint) Resource available, cannot instanciate Breakpoint (in the kind requested)
  760. If Code Breakpoint support not available, also return this error code
  761. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  762. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  763. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  764. EXDI_E_NOTIMPL: Not implemented
  765. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  766. EXDI_E_INVALIDARG: One or more arguments are invalid
  767. EXDI_E_ABORT: Operation aborted
  768. EXDI_E_FAIL: Unspecified failure
  769. EXDI_E_COMMUNICATION: Communication error between host driver and target
  770. --*/
  771. HRESULT AddCodeBreakpoint
  772. (
  773. [in] ADDRESS_TYPE Address,
  774. [in] CBP_KIND cbpk,
  775. [in] MEM_TYPE mt,
  776. [in] DWORD dwExecMode,
  777. [in] DWORD dwTotalBypassCount,
  778. [out] IeXdiCodeBreakpoint **ppieXdiCodeBreakpoint
  779. );
  780. /*++
  781. Routine Name:
  782. DelCodeBreakpoint
  783. Routine Description:
  784. Delete existing code Breakpoint from driver internal list. The breakpoint will be automatically disabled (so any triggering resources will be remove).
  785. The breakpoint instance will be removed only when all references to it are released.
  786. Argument(s):
  787. pieXdiCodeBreakpoint - Pointer to breakpoint object's interface.
  788. Return Value:
  789. Error status:
  790. S_OK: Function successful
  791. EXDI_E_NORESAVAILABLE: No (Breakpoint) Resource available, cannot instanciate Breakpoint (in the kind requested)
  792. If Code Breakpoint support not available, also return this error code
  793. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  794. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  795. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  796. EXDI_E_NOTIMPL: Not implemented
  797. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  798. EXDI_E_INVALIDARG: One or more arguments are invalid
  799. EXDI_E_ABORT: Operation aborted
  800. EXDI_E_FAIL: Unspecified failure
  801. EXDI_E_COMMUNICATION: Communication error between host driver and target
  802. --*/
  803. HRESULT DelCodeBreakpoint
  804. (
  805. [in] IeXdiCodeBreakpoint *pieXdiCodeBreakpoint
  806. );
  807. /*++
  808. Routine Name:
  809. AddDataBreakpoint
  810. Routine Description:
  811. Add new data Breakpoint. The newly created breakpoint is initially disabled (can be enabled with *ppieXdiDataBreakpoint->SetState(...))
  812. and so should not use any resources.
  813. 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.
  814. 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).
  815. Argument(s):
  816. Address - Address of the data to be accessed to break on (only bits set in AddressMask are significant).
  817. AddressMask - Mask to apply on Address comparison on for matching bits (if bit set, do compare, otherwize ignore).
  818. Note: Should be -1 if Address Mask not supported by target, otherwize the probe driver should return EXDI_E_INVALIDARG error.
  819. dwData - Value of the Data to be accessed to break on (only bits set in DataMask are significant).
  820. dwDataMask - Mask to apply on Data comparison on for matching bits (if bit set, do compare, otherwize ignore).
  821. Note: Should be -1 (4294967295) if Data Mask not supported by target, otherwize the probe driver should return EXDI_E_INVALIDARG error.
  822. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, and other if supported by target - the maximum being 32 bits)
  823. Note: Should be -1 (255) for "DON'T CARE" meaning (to be ignored - any size triggers the BP) or
  824. if Data Width specification not supported by target, otherwize the probe driver should return EXDI_E_INVALIDARG error.
  825. mt - Data memory type. Indicates whether this memory address concerns virtual memory, physical memory or pheripherical IO (mtContext value is not accepted)
  826. 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)
  827. da - Data Access type: Read access, Write access or both (don't care)
  828. Note: Should be 2 (daBoth) if Data Access type specification not supported by target, otherwize the probe driver should return EXDI_E_INVALIDARG error.
  829. dwTotalBypassCount - Total number of bypass before triggering a CPU halt on this breakpoint
  830. Note: Should be 0 if Total Bypass Count is not supported - see BREAKPOINT_SUPPORT_TYPE.fDataBpBypassCountSupported
  831. ppieXdiDataBreakpoint - Returns a pointer to the newly created breakpoint object's interface.
  832. Return Value:
  833. Error status:
  834. S_OK: Function successful
  835. EXDI_E_NORESAVAILABLE: No (Breakpoint) Resource available, cannot instanciate Breakpoint
  836. If Data Breakpoint support not available, also return this error code.
  837. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  838. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  839. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteDBPWhileRunning
  840. EXDI_E_NOTIMPL: Not implemented
  841. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  842. EXDI_E_INVALIDARG: One or more arguments are invalid
  843. EXDI_E_ABORT: Operation aborted
  844. EXDI_E_FAIL: Unspecified failure
  845. EXDI_E_COMMUNICATION: Communication error between host driver and target
  846. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  847. --*/
  848. HRESULT AddDataBreakpoint
  849. (
  850. [in] ADDRESS_TYPE Address,
  851. [in] ADDRESS_TYPE AddressMask,
  852. [in] DWORD dwData,
  853. [in] DWORD dwDataMask,
  854. [in] BYTE bAccessWidth,
  855. [in] MEM_TYPE mt,
  856. [in] BYTE bAddressSpace,
  857. [in] DATA_ACCESS_TYPE da,
  858. [in] DWORD dwTotalBypassCount,
  859. [out] IeXdiDataBreakpoint **ppieXdiDataBreakpoint
  860. );
  861. /*++
  862. Routine Name:
  863. DelDataBreakpoint
  864. Routine Description:
  865. Delete existing data Breakpoint from driver internal list. The breakpoint will be automatically disabled (so any triggering resources will be remove).
  866. The breakpoint instance will be removed only when all references to it are released.
  867. Argument(s):
  868. pieXdiDataBreakpoint - Pointer to breakpoint object's interface.
  869. Return Value:
  870. Error status:
  871. S_OK: Function successful
  872. EXDI_E_NORESAVAILABLE: No (Breakpoint) Resource available, cannot instanciate Breakpoint (in the kind requested)
  873. If Data Breakpoint support not available, also return this error code
  874. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  875. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  876. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  877. EXDI_E_NOTIMPL: Not implemented
  878. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  879. EXDI_E_INVALIDARG: One or more arguments are invalid
  880. EXDI_E_ABORT: Operation aborted
  881. EXDI_E_FAIL: Unspecified failure
  882. EXDI_E_COMMUNICATION: Communication error between host driver and target
  883. --*/
  884. HRESULT DelDataBreakpoint
  885. (
  886. [in] IeXdiDataBreakpoint *pieXdiDataBreakpoint
  887. );
  888. /*++
  889. Routine Name:
  890. EnumAllCodeBreakpoints
  891. Routine Description:
  892. Create an enumeration list of all instanciated code breakpoints and return a pointer to its interface.
  893. Argument(s):
  894. ppieXdiEnumCodeBreakpoint - Returns a pointer to the newly created enumation list of breakpoint object's interface.
  895. Return Value:
  896. Error status:
  897. S_OK: Function successful
  898. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  899. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  900. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  901. EXDI_E_NOTIMPL: Not implemented
  902. If Code Breakpoint support not available, also return this error code
  903. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  904. EXDI_E_INVALIDARG: One or more arguments are invalid
  905. EXDI_E_ABORT: Operation aborted
  906. EXDI_E_FAIL: Unspecified failure
  907. EXDI_E_COMMUNICATION: Communication error between host driver and target
  908. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  909. --*/
  910. HRESULT EnumAllCodeBreakpoints
  911. (
  912. [out] IeXdiEnumCodeBreakpoint **ppieXdiEnumCodeBreakpoint
  913. );
  914. /*++
  915. Routine Name:
  916. EnumAllDataBreakpoints
  917. Routine Description:
  918. Create an enumeration list of all instanciated data breakpoints and return a pointer to its interface.
  919. Argument(s):
  920. ppieXdiEnumDataBreakpoint - Returns a pointer to the newly created enumation list of breakpoint object's interface.
  921. Return Value:
  922. Error status:
  923. S_OK: Function successful
  924. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  925. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  926. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadDBPWhileRunning
  927. EXDI_E_NOTIMPL: Not implemented
  928. If Data Breakpoint support not available, also return this error data
  929. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  930. EXDI_E_INVALIDARG: One or more arguments are invalid
  931. EXDI_E_ABORT: Operation aborted
  932. EXDI_E_FAIL: Unspecified failure
  933. EXDI_E_COMMUNICATION: Communication error between host driver and target
  934. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  935. --*/
  936. HRESULT EnumAllDataBreakpoints
  937. (
  938. [out] IeXdiEnumDataBreakpoint **ppieXdiEnumDataBreakpoint
  939. );
  940. /*++
  941. Routine Name:
  942. EnumCodeBreakpointsInAddrRange
  943. Routine Description:
  944. Create an enumeration list of the instanciated code breakpoints which address are whithin given range, and return a pointer to its interface.
  945. Argument(s):
  946. FirstAddress - First address of the filtering address range
  947. LastAddress - Last address of the filtering address range
  948. ppieXdiEnumCodeBreakpoint - Returns a pointer to the newly created enumation list of breakpoint object's interface.
  949. Return Value:
  950. Error status:
  951. S_OK: Function successful
  952. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  953. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  954. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  955. EXDI_E_NOTIMPL: Not implemented
  956. If Code Breakpoint support not available, also return this error code
  957. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  958. EXDI_E_INVALIDARG: One or more arguments are invalid
  959. EXDI_E_ABORT: Operation aborted
  960. EXDI_E_FAIL: Unspecified failure
  961. EXDI_E_COMMUNICATION: Communication error between host driver and target
  962. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  963. --*/
  964. HRESULT EnumCodeBreakpointsInAddrRange
  965. (
  966. [in] ADDRESS_TYPE FirstAddress,
  967. [in] ADDRESS_TYPE LastAddress,
  968. [out] IeXdiEnumCodeBreakpoint **ppieXdiEnumCodeBreakpoint
  969. );
  970. /*++
  971. Routine Name:
  972. EnumDataBreakpointsInAddrRange
  973. Routine Description:
  974. Create an enumeration list of the instanciated data breakpoints which address are whithin given range, and return a pointer to its interface.
  975. Argument(s):
  976. FirstAddress - First address of the filtering address range
  977. LastAddress - Last address of the filtering address range
  978. ppieXdiEnumDataBreakpoint - Returns a pointer to the newly created enumation list of breakpoint object's interface.
  979. Return Value:
  980. Error status:
  981. S_OK: Function successful
  982. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  983. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  984. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadDBPWhileRunning
  985. EXDI_E_NOTIMPL: Not implemented
  986. If Data Breakpoint support not available, also return this error data
  987. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  988. EXDI_E_INVALIDARG: One or more arguments are invalid
  989. EXDI_E_ABORT: Operation aborted
  990. EXDI_E_FAIL: Unspecified failure
  991. EXDI_E_COMMUNICATION: Communication error between host driver and target
  992. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  993. --*/
  994. HRESULT EnumDataBreakpointsInAddrRange
  995. (
  996. [in] ADDRESS_TYPE FirstAddress,
  997. [in] ADDRESS_TYPE LastAddress,
  998. [out] IeXdiEnumDataBreakpoint **ppieXdiEnumDataBreakpoint
  999. );
  1000. /*++
  1001. Routine Name:
  1002. StartNotifyingRunChg
  1003. Routine Description:
  1004. Add new object in list of one to notify of a Run State change.
  1005. The driver will immediately do a AddRef() on the object before returning.
  1006. Argument(s):
  1007. pieXdiClientNotifyRunChg - advise sink: pointer to the IeXdiClientNotifyRunChg callback interface of the object to be notified by the driver
  1008. pdwConnectionCookie - Returns cookie to the callback connection just made. This can be used later by the driver to delete the connection
  1009. (using StopNotifyingRunChg). If the connection is not successfully established, this cookie value is not meaningfull.
  1010. Return Value:
  1011. Error status:
  1012. S_OK: Function successful
  1013. EXDI_E_ADVISELIMIT The connection point has already reached its limit of connections and cannot accept any more.
  1014. EXDI_E_NOTIMPL: Not implemented
  1015. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1016. EXDI_E_INVALIDARG: One or more arguments are invalid
  1017. EXDI_E_ABORT: Operation aborted
  1018. EXDI_E_FAIL: Unspecified failure
  1019. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1020. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1021. --*/
  1022. HRESULT StartNotifyingRunChg
  1023. (
  1024. [in] IeXdiClientNotifyRunChg *pieXdiClientNotifyRunChg,
  1025. [out] DWORD *pdwConnectionCookie
  1026. );
  1027. /*++
  1028. Routine Name:
  1029. StopNotifyingRunChg
  1030. Routine Description:
  1031. Remove object in list of one to notify of a Run State change.
  1032. The driver will immediately do a Release() on the object before returning.
  1033. Argument(s):
  1034. dwConnectionCookie - Cookie to the callback connection to cancel.
  1035. Return Value:
  1036. Error status:
  1037. S_OK: Function successful
  1038. EXDI_E_NOTIMPL: Not implemented
  1039. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1040. EXDI_E_INVALIDARG: One or more arguments are invalid
  1041. EXDI_E_ABORT: Operation aborted
  1042. EXDI_E_FAIL: Unspecified failure
  1043. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1044. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1045. --*/
  1046. HRESULT StopNotifyingRunChg
  1047. (
  1048. [in] DWORD dwConnectionCookie
  1049. );
  1050. /////////////////////////////////////////////////////////////////////////////
  1051. // Memory, I/O and Register Access section of the Interface
  1052. /////////////////////////////////////////////////////////////////////////////
  1053. /*++
  1054. Routine Name:
  1055. ReadVirtualMemory
  1056. Routine Description:
  1057. Read Virtual Memory block. This is the default memory read.
  1058. Note: The memory content returned to this function should be "sanitized" (compensated for the artefacts of
  1059. software breakpoints - or of any other modifications of the memory produced by the debugging activity of
  1060. the driver, probe or target). In general, the driver internal mechanism should be transparent to the client.
  1061. Argument(s):
  1062. Address - Starting address of the data buffer to be accessed on the target.
  1063. dwNbElemToRead - Number of element(s) (of byDataWidth bits) to be accessed.
  1064. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  1065. pbReadBuffer - Buffer (of bytes) on which result of reading is written. Must be large enough to hold all elements returned (pdwNbElementEffectRead)
  1066. Note: Elements must be aligned on byte boundary. Bit padding must be added if byDataWidth is not multiple of 8.
  1067. pdwNbElementEffectRead - Returns the number of element effectively read. This is used by the client to speed up in case of access
  1068. violation (EXDI_E_ACCESSVIOLATION) in the range: If an entire range is not accessible, this returned value should be 0,
  1069. so there is no need to query the range with smaller granularity.
  1070. Return Value:
  1071. Error status:
  1072. S_OK: Function successful
  1073. EXDI_E_ACCESSVIOLATION: Access violation on at least one element in address range specificified by the operation
  1074. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1075. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1076. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadVMWhileRunning
  1077. EXDI_E_NOTIMPL: Not implemented
  1078. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1079. EXDI_E_INVALIDARG: One or more arguments are invalid
  1080. EXDI_E_ABORT: Operation aborted
  1081. EXDI_E_FAIL: Unspecified failure
  1082. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1083. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1084. --*/
  1085. HRESULT ReadVirtualMemory
  1086. (
  1087. [in] ADDRESS_TYPE Address,
  1088. [in] DWORD dwNbElemToRead,
  1089. [in] BYTE bAccessWidth,
  1090. [out, size_is(dwNbElemToRead * (((bAccessWidth - 1) >> 3) + 1))] BYTE *pbReadBuffer,
  1091. [out] DWORD *pdwNbElementEffectRead
  1092. );
  1093. /*++
  1094. Routine Name:
  1095. WriteVirtualMemory
  1096. Routine Description:
  1097. Write Virtual Memory block. This is the default memory write.
  1098. Note: The memory content provided to this function should be "sanitized" (compensated for the artefacts of
  1099. software breakpoints - or of any other modifications of the memory produced by the debugging activity of
  1100. the driver, probe or target). In general, the driver internal mechanism should be transparent to the client.
  1101. Argument(s):
  1102. Address - Starting address of the data buffer to be accessed on the target.
  1103. dwNbElemToWrite - Number of element(s) (of byDataWidth bits) to be accessed.
  1104. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  1105. pbWriteBuffer - Buffer (of bytes) on which result of writing is written. Must be large enough to hold all elements (dwNbElemToWrite)
  1106. Note: Elements must be aligned on byte boundary. Bit padding must be added if byDataWidth is not multiple of 8.
  1107. pdwNbElementEffectWritten - Returns the number of element effectively written. This is used by the client to speed up in case of access
  1108. violation (EXDI_E_ACCESSVIOLATION) in the range: If an entire range is not accessible, this returned value should be 0,
  1109. so there is no need to query the range with smaller granularity.
  1110. Return Value:
  1111. Error status:
  1112. S_OK: Function successful
  1113. EXDI_E_ACCESSVIOLATION: Access violation on at least one element in address range specificified by the operation
  1114. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1115. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1116. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteVMWhileRunning
  1117. EXDI_E_NOTIMPL: Not implemented
  1118. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1119. EXDI_E_INVALIDARG: One or more arguments are invalid
  1120. EXDI_E_ABORT: Operation aborted
  1121. EXDI_E_FAIL: Unspecified failure
  1122. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1123. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1124. --*/
  1125. HRESULT WriteVirtualMemory
  1126. (
  1127. [in] ADDRESS_TYPE Address,
  1128. [in] DWORD dwNbElemToWrite,
  1129. [in] BYTE bAccessWidth,
  1130. [in, size_is(dwNbElemToWrite * (((bAccessWidth - 1) >> 3) + 1))] const BYTE *pbWriteBuffer,
  1131. [out] DWORD *pdwNbElementEffectWritten
  1132. );
  1133. /*++
  1134. Routine Name:
  1135. ReadPhysicalMemoryOrPeriphIO
  1136. Routine Description:
  1137. Read block of data to Physical Memory or peripherical I/O.
  1138. Note: The memory content returned to this function should be "sanitized" (compensated for the artefacts of
  1139. software breakpoints - or of any other modifications of the memory produced by the debugging activity of
  1140. the driver, probe or target). In general, the driver internal mechanism should be transparent to the client.
  1141. Argument(s):
  1142. Address - Starting address of the data buffer to be accessed on the target.
  1143. bAddressSpace - Address space to be accessed (convention: 0 = Physical Memory, 1 = Peripherical I/O if not memory mapped, 2..255 = free for custom use)
  1144. dwNbElemToRead - Number of element(s) (of byDataWidth bits) to be accessed.
  1145. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  1146. pbReadBuffer - Buffer (of bytes) on which result of reading is written. Must be large enough to hold all elements (dwNbElemToRead)
  1147. Note: Elements must be aligned on byte boundary. Bit padding must be added if byDataWidth is not multiple of 8.
  1148. Return Value:
  1149. Error status:
  1150. S_OK: Function successful
  1151. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1152. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1153. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadPMWhileRunning
  1154. EXDI_E_NOTIMPL: Not implemented
  1155. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1156. EXDI_E_INVALIDARG: One or more arguments are invalid
  1157. EXDI_E_ABORT: Operation aborted
  1158. EXDI_E_FAIL: Unspecified failure
  1159. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1160. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1161. --*/
  1162. HRESULT ReadPhysicalMemoryOrPeriphIO
  1163. (
  1164. [in] ADDRESS_TYPE Address,
  1165. [in] BYTE bAddressSpace,
  1166. [in] DWORD dwNbElemToRead,
  1167. [in] BYTE bAccessWidth,
  1168. [out, size_is(dwNbElemToRead * (((bAccessWidth - 1) >> 3) + 1))] BYTE *pbReadBuffer
  1169. );
  1170. /*++
  1171. Routine Name:
  1172. WritePhysicalMemoryOrPeriphIO
  1173. Routine Description:
  1174. Write block of data to Physical Memory or peripherical I/O.
  1175. Note: The memory content provided to this function should be "sanitized" (compensated for the artefacts of
  1176. software breakpoints - or of any other modifications of the memory produced by the debugging activity of
  1177. the driver, probe or target). In general, the driver internal mechanism should be transparent to the client.
  1178. Argument(s):
  1179. Address - Starting address of the data buffer to be accessed on the target.
  1180. bAddressSpace - Address space to be accessed (convention: 0 = Physical Memory, 1 = Peripherical I/O if not memory mapped, 2..255 = free for custom use)
  1181. dwNbElemToWrite - Number of element(s) (of byDataWidth bits) to be accessed.
  1182. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  1183. pbWriteBuffer - Buffer (of bytes) on which result of writing is written. Must be large enough to hold all elements (dwNbElemToWrite)
  1184. Note: Elements must be aligned on byte boundary. Bit padding must be added if byDataWidth is not multiple of 8.
  1185. Return Value:
  1186. Error status:
  1187. S_OK: Function successful
  1188. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1189. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1190. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWritePMWhileRunning
  1191. EXDI_E_NOTIMPL: Not implemented
  1192. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1193. EXDI_E_INVALIDARG: One or more arguments are invalid
  1194. EXDI_E_ABORT: Operation aborted
  1195. EXDI_E_FAIL: Unspecified failure
  1196. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1197. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1198. --*/
  1199. HRESULT WritePhysicalMemoryOrPeriphIO
  1200. (
  1201. [in] ADDRESS_TYPE Address,
  1202. [in] BYTE bAddressSpace,
  1203. [in] DWORD dwNbElemToWrite,
  1204. [in] BYTE bAccessWidth,
  1205. [in, size_is(dwNbElemToWrite * (((bAccessWidth - 1) >> 3) + 1))] const BYTE *pbWriteBuffer
  1206. );
  1207. /*++
  1208. Routine Name:
  1209. StartNotifyingMemChg
  1210. Routine Description:
  1211. Add new object in list of one to notify of a Memory, I/O and Register Access.
  1212. The driver will immediately do a AddRef() on the object before returning.
  1213. Note: This call back method is used to notify of memory changes due to other debugger instances
  1214. but not due to target code execution. It is meant to give the debugger the possibility to invalidate
  1215. its cache of the target memory content. Consequently, no mem change notification should normally
  1216. be sent while the target is running and the debugger should also invalidate its cache of the target
  1217. based on the run status change notification.
  1218. Argument(s):
  1219. pieXdiClientNotifyMemChg - advise sink: pointer to the IeXdiClientNotifyMemChg callback interface of the object to be notified by the driver
  1220. pdwConnectionCookie - Returns cookie to the callback connection just made. This can be used later by the driver to delete the connection
  1221. (using StopNotifyingMemChg). If the connection is not successfully established, this cookie value is not meaningfull.
  1222. Return Value:
  1223. Error status:
  1224. S_OK: Function successful
  1225. EXDI_E_ADVISELIMIT The connection point has already reached its limit of connections and cannot accept any more.
  1226. EXDI_E_NOTIMPL: Not implemented
  1227. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1228. EXDI_E_INVALIDARG: One or more arguments are invalid
  1229. EXDI_E_ABORT: Operation aborted
  1230. EXDI_E_FAIL: Unspecified failure
  1231. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1232. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1233. --*/
  1234. HRESULT StartNotifyingMemChg
  1235. (
  1236. [in] IeXdiClientNotifyMemChg *pieXdiClientNotifyMemChg,
  1237. [out] DWORD *pdwConnectionCookie
  1238. );
  1239. /*++
  1240. Routine Name:
  1241. StopNotifyingMemChg
  1242. Routine Description:
  1243. Remove object in list of one to notify of a Memory, I/O and Register Access.
  1244. The driver will immediately do a Release() on the object before returning.
  1245. Argument(s):
  1246. dwConnectionCookie - Cookie to the callback connection to cancel.
  1247. Return Value:
  1248. Error status:
  1249. S_OK: Function successful
  1250. EXDI_E_NOTIMPL: Not implemented
  1251. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1252. EXDI_E_INVALIDARG: One or more arguments are invalid
  1253. EXDI_E_ABORT: Operation aborted
  1254. EXDI_E_FAIL: Unspecified failure
  1255. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1256. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1257. --*/
  1258. HRESULT StopNotifyingMemChg
  1259. (
  1260. [in] DWORD dwConnectionCookie
  1261. );
  1262. /////////////////////////////////////////////////////////////////////////////
  1263. // IoCtl (back door - non formated api) section of the Interface
  1264. /////////////////////////////////////////////////////////////////////////////
  1265. /*++
  1266. Routine Name:
  1267. Ioctl
  1268. Routine Description:
  1269. Back door / non formated interface.
  1270. Argument(s):
  1271. dwBuffInSize - Size in byte of *pbyBufferIn
  1272. pbBufferIn - Raw byte buffer to hold input parameter(s)
  1273. dwBuffOutSize - Size in byte of *pbyBufferOut
  1274. pdwEffectBuffOutSize - Returns effective size in byte of *pbyBufferOut (must be smaller than dwBuffOutSize)
  1275. pbBufferOut - Raw byte buffer to hold output parameter(s)
  1276. Return Value:
  1277. Error status:
  1278. S_OK: Function successful
  1279. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed requested operation while target running. Must halt the target first.
  1280. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1281. see DEBUG_ACCESS_CAPABILITIES_STRUCT (flag depends on operation requested)
  1282. EXDI_E_NOTIMPL: Not implemented
  1283. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1284. EXDI_E_INVALIDARG: One or more arguments are invalid
  1285. EXDI_E_ABORT: Operation aborted
  1286. EXDI_E_FAIL: Unspecified failure
  1287. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1288. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1289. --*/
  1290. HRESULT Ioctl
  1291. (
  1292. [in] DWORD dwBuffInSize,
  1293. [in, size_is(dwBuffInSize)] const BYTE *pbBufferIn,
  1294. [in] DWORD dwBuffOutSize,
  1295. [out] DWORD *pdwEffectBuffOutSize,
  1296. [out, size_is(dwBuffOutSize), length_is(*pdwEffectBuffOutSize)] BYTE *pbBufferOut
  1297. );
  1298. }; // interface IeXdiServer
  1299. /////////////////////////////////////////////////////////////////////////////
  1300. /////////////////////////////////////////////////////////////////////////////
  1301. //
  1302. // IeXdiCodeBreakpoint
  1303. //
  1304. /////////////////////////////////////////////////////////////////////////////
  1305. /////////////////////////////////////////////////////////////////////////////
  1306. /////////////////////////////////////////////////////////////////////////////
  1307. // Code Breakpoint Interface
  1308. /////////////////////////////////////////////////////////////////////////////
  1309. [
  1310. object,
  1311. uuid(47486F67-6461-6C65-5844-495342507401),
  1312. helpstring("IeXdiCodeBreakpoint interface - eXdi Server Code Breakpoint 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1313. pointer_default(ref)
  1314. ]
  1315. interface IeXdiCodeBreakpoint : IUnknown
  1316. {
  1317. // Note: Release() automatically Disable BP (and free resources)
  1318. /*++
  1319. Routine Name:
  1320. GetAttributes
  1321. Routine Description:
  1322. Get Code Breakpoint current characteristics.
  1323. Argument(s):
  1324. pAddress - Returns address of the instruction to be accessed to break on.
  1325. pcbpk - Returns the kind of code breakpoint (hardware, software (bp instruction) or if the probe driver
  1326. can decide based on its algorithm and resources available).
  1327. Note: In the case of sw bp, the probe driver must keep track of instruction being replaced.
  1328. pmt - Returns Instruction memory type. Indicates whether this memory address concerns virtual memory or physical
  1329. memory (pheripherical IO not applicable and mtContext value is not accepted)
  1330. pdwExecMode - Returns processor execution mode. In the case of multiple mode processors, this gives a hint
  1331. (if necessary) on the process mode at the time of the execution of the code where the breakpoint is set.
  1332. For example, in the case of a software breakpoint, the trap instruction may be different in 16 bit mode
  1333. than 32 bit mode on processors having the 2 modes (ARM and MIPS).
  1334. Should be 0 for 32 bit mode (default). Should be 1 for 16 bit mode.
  1335. pdwTotalBypassCount - Returns the number of time the trigger of a CPU halt should be bypassed if the breakpoint condition is met.
  1336. pdwBypassedOccurences - Returns the number of occurences of bypass related to this breakpoint already seen. Note: initial value (always if not supported) is 0
  1337. Note: this value is reset to 0 everytime the CPU is halted due to this breakpoint.
  1338. pfEnabled - Returns TRUE if Breakpoint is enabled. Note: default value at creation is FALSE
  1339. Return Value:
  1340. Error status:
  1341. S_OK: Function successful
  1342. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1343. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1344. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1345. EXDI_E_NOTIMPL: Not implemented
  1346. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1347. EXDI_E_INVALIDARG: One or more arguments are invalid
  1348. EXDI_E_ABORT: Operation aborted
  1349. EXDI_E_FAIL: Unspecified failure
  1350. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1351. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1352. --*/
  1353. HRESULT GetAttributes
  1354. (
  1355. [out] PADDRESS_TYPE pAddress,
  1356. [out] PCBP_KIND pcbpk,
  1357. [out] PMEM_TYPE pmt,
  1358. [out] DWORD *pdwExecMode,
  1359. [out] DWORD *pdwTotalBypassCount,
  1360. [out] DWORD *pdwBypassedOccurences,
  1361. [out] BOOL *pfEnabled
  1362. );
  1363. /*++
  1364. Routine Name:
  1365. SetState
  1366. Routine Description:
  1367. Enable or Disable Breakpoint.
  1368. Note: this function should free (in case of disable) or (re)allocate (in case of enable) breakpoint triggering resource if applicable
  1369. Argument(s):
  1370. fEnabled - TRUE if Breakpoint is enabled.
  1371. fResetBypassedOccurences - Reset the number of occurences of bypass related to this breakpoint already seen.
  1372. Note: this action is equivalent to the reset implicitely done everytime the CPU is halted due to this breakpoint.
  1373. Note: if this bypass counting feature is not supported, the value of this parameter is don't care
  1374. Return Value:
  1375. Error status:
  1376. S_OK: Function successful
  1377. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1378. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1379. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1380. EXDI_E_NOTIMPL: Not implemented
  1381. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1382. EXDI_E_INVALIDARG: One or more arguments are invalid
  1383. EXDI_E_ABORT: Operation aborted
  1384. EXDI_E_FAIL: Unspecified failure
  1385. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1386. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1387. --*/
  1388. HRESULT SetState
  1389. (
  1390. [in] BOOL fEnabled,
  1391. [in] BOOL fResetBypassedOccurences
  1392. );
  1393. }; // IeXdiCodeBreakpoint
  1394. /////////////////////////////////////////////////////////////////////////////
  1395. /////////////////////////////////////////////////////////////////////////////
  1396. //
  1397. // IeXdiDataBreakpoint
  1398. //
  1399. /////////////////////////////////////////////////////////////////////////////
  1400. /////////////////////////////////////////////////////////////////////////////
  1401. /////////////////////////////////////////////////////////////////////////////
  1402. // Data Breakpoint Interface
  1403. /////////////////////////////////////////////////////////////////////////////
  1404. [
  1405. object,
  1406. uuid(47486F67-6461-6C65-5844-495357507400),
  1407. helpstring("IeXdiDataBreakpoint interface - eXdi Server Data Breakpoint 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1408. pointer_default(ref)
  1409. ]
  1410. interface IeXdiDataBreakpoint : IUnknown
  1411. {
  1412. // Note: Release() automatically Disable BP (and free resources)
  1413. /*++
  1414. Routine Name:
  1415. GetAttributes
  1416. Routine Description:
  1417. Get Data Breakpoint current characteristics.
  1418. Argument(s):
  1419. pAddress - Returns address of the data to be accessed to break on (only bits set in AddressMask are significant).
  1420. pAddressMask - Returns mask to apply on Address comparison on for matching bits (if bit set, do compare, otherwize ignore).
  1421. Note: Returns -1 if Address Mask not supported by target.
  1422. pdwData - Returns value of the Data to be accessed to break on (only bits set in DataMask are significant).
  1423. pdwDataMask - Returns mask to apply on Data comparison on for matching bits (if bit set, do compare, otherwize ignore).
  1424. Note: Returns -1 (4294967295) if Data Mask not supported by target.
  1425. pbAccessWidth - Returns Data Width in bits (byte=8, word=16, dword=32, and other if supported by target - the maximum being 32 bits)
  1426. Note: Returns -1 (255) if Data Width specification not supported by target.
  1427. pmt - Returns Data memory type. Indicates whether this memory address concerns virtual memory, physical memory or pheripherical IO
  1428. (mtContext value is not accepted)
  1429. pbAddressSpace - Returns Address space of the data breakpoint if mt is mtPhysicalOrPeriIO (convention: 0 = Physical Memory, 1 = Peripherical I/O
  1430. if not memory mapped, 2..255 = free for custom use)
  1431. pda - Returns Data Access type: Read access, Write access or both (don't care)
  1432. Note: Returns 2 (daBoth) if Data Access type specification not supported by target.
  1433. pdwTotalBypassCount - Returns the number of time the trigger of a CPU halt should be bypassed if the breakpoint condition is met.
  1434. pdwBypassedOccurences - Returns the number of occurences of bypass related to this breakpoint already seen. Note: initial value (always if not supported) is 0
  1435. Note: this value is reset to 0 everytime the CPU is halted due to this breakpoint.
  1436. pfEnabled - Returns TRUE if Breakpoint is enabled. Note: default value at creation is FALSE
  1437. Return Value:
  1438. Error status:
  1439. S_OK: Function successful
  1440. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1441. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1442. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadDBPWhileRunning
  1443. EXDI_E_NOTIMPL: Not implemented
  1444. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1445. EXDI_E_INVALIDARG: One or more arguments are invalid
  1446. EXDI_E_ABORT: Operation aborted
  1447. EXDI_E_FAIL: Unspecified failure
  1448. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1449. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1450. --*/
  1451. HRESULT GetAttributes
  1452. (
  1453. [out] PADDRESS_TYPE pAddress,
  1454. [out] PADDRESS_TYPE pAddressMask,
  1455. [out] DWORD *pdwData,
  1456. [out] DWORD *pdwDataMask,
  1457. [out] BYTE *pbAccessWidth,
  1458. [out] PMEM_TYPE pmt,
  1459. [out] BYTE *pbAddressSpace,
  1460. [out] PDATA_ACCESS_TYPE pda,
  1461. [out] DWORD *pdwTotalBypassCount,
  1462. [out] DWORD *pdwBypassedOccurences,
  1463. [out] BOOL *pfEnabled
  1464. );
  1465. /*++
  1466. Routine Name:
  1467. SetState
  1468. Routine Description:
  1469. Enable or Disable Breakpoint.
  1470. Note: this function should free (in case of disable) or (re)allocate (in case of enable) breakpoint triggering resource if applicable
  1471. Argument(s):
  1472. fEnabled - TRUE if Breakpoint is enabled.
  1473. fResetBypassedOccurences - Reset the number of occurences of bypass related to this breakpoint already seen.
  1474. Note: this action is equivalent to the reset implicitely done everytime the CPU is halted due to this breakpoint.
  1475. Note: if this bypass counting feature is not supported, the value of this parameter is don't care
  1476. Return Value:
  1477. Error status:
  1478. S_OK: Function successful
  1479. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1480. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1481. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1482. EXDI_E_NOTIMPL: Not implemented
  1483. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1484. EXDI_E_INVALIDARG: One or more arguments are invalid
  1485. EXDI_E_ABORT: Operation aborted
  1486. EXDI_E_FAIL: Unspecified failure
  1487. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1488. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1489. --*/
  1490. HRESULT SetState
  1491. (
  1492. [in] BOOL fEnabled,
  1493. [in] BOOL fResetBypassedOccurences
  1494. );
  1495. }; // IeXdiDataBreakpoint
  1496. /////////////////////////////////////////////////////////////////////////////
  1497. /////////////////////////////////////////////////////////////////////////////
  1498. //
  1499. // IeXdiEnumCodeBreakpoint
  1500. //
  1501. /////////////////////////////////////////////////////////////////////////////
  1502. /////////////////////////////////////////////////////////////////////////////
  1503. // Code Breakpoint Enumeration List interface
  1504. [
  1505. object,
  1506. uuid(47486F67-6461-6C65-5844-495345425074),
  1507. helpstring("IeXdiEnumCodeBreakpoint interface - eXdi Server Enumerate Code Breakpoint 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1508. pointer_default(ref)
  1509. ]
  1510. interface IeXdiEnumCodeBreakpoint : IUnknown
  1511. {
  1512. /*++
  1513. Routine Name:
  1514. Next
  1515. Routine Description:
  1516. Get an array of a given number (celt requested - *pceltFetched actual) of pointers
  1517. to the next (from current position) Code Breakpoint objects in the enumerated list
  1518. Argument(s):
  1519. celt - Requested number of Code Breakpoint object pointers to be returned.
  1520. apieXdiCodeBreakpoint - Returns array of Code Breakpoint objects' interface pointers.
  1521. pceltFetched - Returns the actual number of pointers returned in rgelt
  1522. Return Value:
  1523. Error status:
  1524. S_OK: Function successful
  1525. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1526. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1527. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1528. EXDI_E_NOTIMPL: Not implemented
  1529. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1530. EXDI_E_INVALIDARG: One or more arguments are invalid
  1531. EXDI_E_ABORT: Operation aborted
  1532. EXDI_E_FAIL: Unspecified failure
  1533. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1534. --*/
  1535. HRESULT Next
  1536. (
  1537. [in] DWORD celt,
  1538. [out, size_is(celt), length_is(*pceltFetched)] IeXdiCodeBreakpoint *apieXdiCodeBreakpoint[],
  1539. [out] DWORD *pceltFetched
  1540. );
  1541. /*++
  1542. Routine Name:
  1543. Skip
  1544. Routine Description:
  1545. Skip a given number (celt) of Code Breakpoint objects next (from current position) in the enumerated list
  1546. Argument(s):
  1547. celt - Requested number of Code Breakpoint objects to be skipped.
  1548. Return Value:
  1549. Error status:
  1550. S_OK: Function successful
  1551. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1552. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1553. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1554. EXDI_E_NOTIMPL: Not implemented
  1555. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1556. EXDI_E_INVALIDARG: One or more arguments are invalid
  1557. EXDI_E_ABORT: Operation aborted
  1558. EXDI_E_FAIL: Unspecified failure
  1559. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1560. --*/
  1561. HRESULT Skip
  1562. (
  1563. [in] DWORD celt
  1564. );
  1565. /*++
  1566. Routine Name:
  1567. Reset
  1568. Routine Description:
  1569. Reset the current position in the enumerated list to first Code Breakpoint object
  1570. Argument(s):
  1571. none
  1572. Return Value:
  1573. Error status:
  1574. S_OK: Function successful
  1575. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1576. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1577. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1578. EXDI_E_NOTIMPL: Not implemented
  1579. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1580. EXDI_E_ABORT: Operation aborted
  1581. EXDI_E_FAIL: Unspecified failure
  1582. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1583. --*/
  1584. HRESULT Reset
  1585. (
  1586. void
  1587. );
  1588. /*++
  1589. Routine Name:
  1590. GetCount
  1591. Routine Description:
  1592. Gives the total number of Code Breakpoint objects in the enumerated list
  1593. Argument(s):
  1594. pcelt - Returns total number of Code Breakpoint objects in the enumerated list.
  1595. Return Value:
  1596. Error status:
  1597. S_OK: Function successful
  1598. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1599. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1600. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1601. EXDI_E_NOTIMPL: Not implemented
  1602. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1603. EXDI_E_INVALIDARG: One or more arguments are invalid
  1604. EXDI_E_ABORT: Operation aborted
  1605. EXDI_E_FAIL: Unspecified failure
  1606. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1607. --*/
  1608. HRESULT GetCount
  1609. (
  1610. [out] DWORD *pcelt
  1611. );
  1612. /*++
  1613. Routine Name:
  1614. GetNext
  1615. Routine Description:
  1616. Get a pointer to the next (from current position) Code Breakpoint object in the enumerated list
  1617. Argument(s):
  1618. ppieXdiCodeBreakpoint - Returns Code Breakpoint object's interface pointer.
  1619. Return Value:
  1620. Error status:
  1621. S_OK: Function successful
  1622. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1623. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1624. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1625. EXDI_E_NOTIMPL: Not implemented
  1626. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1627. EXDI_E_INVALIDARG: One or more arguments are invalid
  1628. EXDI_E_ABORT: Operation aborted
  1629. EXDI_E_FAIL: Unspecified failure
  1630. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1631. --*/
  1632. HRESULT GetNext
  1633. (
  1634. [out] IeXdiCodeBreakpoint **ppieXdiCodeBreakpoint
  1635. );
  1636. /*++
  1637. Routine Name:
  1638. DisableAll
  1639. Routine Description:
  1640. Disable all Code Breakpoints which objects are in the enumerated list
  1641. Argument(s):
  1642. none
  1643. Return Value:
  1644. Error status:
  1645. S_OK: Function successful
  1646. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1647. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1648. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  1649. EXDI_E_NOTIMPL: Not implemented
  1650. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1651. EXDI_E_ABORT: Operation aborted
  1652. EXDI_E_FAIL: Unspecified failure
  1653. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1654. --*/
  1655. HRESULT DisableAll
  1656. (
  1657. void
  1658. );
  1659. /*++
  1660. Routine Name:
  1661. EnableAll
  1662. Routine Description:
  1663. Enable all Code Breakpoints which objects are in the enumerated list
  1664. Argument(s):
  1665. none
  1666. Return Value:
  1667. Error status:
  1668. S_OK: Function successful
  1669. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1670. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1671. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  1672. EXDI_E_NOTIMPL: Not implemented
  1673. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1674. EXDI_E_ABORT: Operation aborted
  1675. EXDI_E_FAIL: Unspecified failure
  1676. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1677. --*/
  1678. HRESULT EnableAll
  1679. (
  1680. void
  1681. );
  1682. }; // IeXdiEnumCodeBreakpoint
  1683. /////////////////////////////////////////////////////////////////////////////
  1684. /////////////////////////////////////////////////////////////////////////////
  1685. //
  1686. // IeXdiEnumDataBreakpoint
  1687. //
  1688. /////////////////////////////////////////////////////////////////////////////
  1689. /////////////////////////////////////////////////////////////////////////////
  1690. // Data Breakpoint Enumeration List interface
  1691. [
  1692. object,
  1693. uuid(47486F67-6461-6C65-5844-495345575074),
  1694. helpstring("IeXdiEnumDataBreakpoint interface - eXdi Server Enumerate Data Breakpoint 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1695. pointer_default(ref)
  1696. ]
  1697. interface IeXdiEnumDataBreakpoint : IUnknown
  1698. {
  1699. /*++
  1700. Routine Name:
  1701. Next
  1702. Routine Description:
  1703. Get an array of a given number (celt requested - *pceltFetched actual) of pointers
  1704. to the next (from current position) Data Breakpoint objects in the enumerated list
  1705. Argument(s):
  1706. celt - Requested number of Data Breakpoint object pointers to be returned.
  1707. apieXdiDataBreakpoint - Returns array of Data Breakpoint objects interface pointers.
  1708. pceltFetched - Returns the actual number of pointers returned in rgelt
  1709. Return Value:
  1710. Error status:
  1711. S_OK: Function successful
  1712. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1713. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1714. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1715. EXDI_E_NOTIMPL: Not implemented
  1716. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1717. EXDI_E_INVALIDARG: One or more arguments are invalid
  1718. EXDI_E_ABORT: Operation aborted
  1719. EXDI_E_FAIL: Unspecified failure
  1720. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1721. --*/
  1722. HRESULT Next
  1723. (
  1724. [in] DWORD celt,
  1725. [out, size_is(celt), length_is(*pceltFetched)] IeXdiDataBreakpoint *apieXdiDataBreakpoint[],
  1726. [out] DWORD *pceltFetched
  1727. );
  1728. /*++
  1729. Routine Name:
  1730. Skip
  1731. Routine Description:
  1732. Skip a given number (celt) of Data Breakpoint objects next (from current position) in the enumerated list
  1733. Argument(s):
  1734. celt - Requested number of Data Breakpoint objects to be skipped.
  1735. Return Value:
  1736. Error status:
  1737. S_OK: Function successful
  1738. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1739. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1740. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1741. EXDI_E_NOTIMPL: Not implemented
  1742. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1743. EXDI_E_INVALIDARG: One or more arguments are invalid
  1744. EXDI_E_ABORT: Operation aborted
  1745. EXDI_E_FAIL: Unspecified failure
  1746. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1747. --*/
  1748. HRESULT Skip
  1749. (
  1750. [in] DWORD celt
  1751. );
  1752. /*++
  1753. Routine Name:
  1754. Reset
  1755. Routine Description:
  1756. Reset the current position in the enumerated list to first Data Breakpoint object
  1757. Argument(s):
  1758. none
  1759. Return Value:
  1760. Error status:
  1761. S_OK: Function successful
  1762. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1763. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1764. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1765. EXDI_E_NOTIMPL: Not implemented
  1766. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1767. EXDI_E_ABORT: Operation aborted
  1768. EXDI_E_FAIL: Unspecified failure
  1769. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1770. --*/
  1771. HRESULT Reset
  1772. (
  1773. void
  1774. );
  1775. /*++
  1776. Routine Name:
  1777. GetCount
  1778. Routine Description:
  1779. Gives the total number of Data Breakpoint objects in the enumerated list
  1780. Argument(s):
  1781. pcelt - Returns total number of Data Breakpoint objects in the enumerated list.
  1782. Return Value:
  1783. Error status:
  1784. S_OK: Function successful
  1785. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1786. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1787. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1788. EXDI_E_NOTIMPL: Not implemented
  1789. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1790. EXDI_E_INVALIDARG: One or more arguments are invalid
  1791. EXDI_E_ABORT: Operation aborted
  1792. EXDI_E_FAIL: Unspecified failure
  1793. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1794. --*/
  1795. HRESULT GetCount
  1796. (
  1797. [out] DWORD *pcelt
  1798. );
  1799. /*++
  1800. Routine Name:
  1801. GetNext
  1802. Routine Description:
  1803. Get a pointer to the next (from current position) Data Breakpoint object in the enumerated list
  1804. Argument(s):
  1805. ppieXdiDataBreakpoint - Returns Data Breakpoint object's interface pointer.
  1806. Return Value:
  1807. Error status:
  1808. S_OK: Function successful
  1809. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1810. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1811. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadCBPWhileRunning
  1812. EXDI_E_NOTIMPL: Not implemented
  1813. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1814. EXDI_E_INVALIDARG: One or more arguments are invalid
  1815. EXDI_E_ABORT: Operation aborted
  1816. EXDI_E_FAIL: Unspecified failure
  1817. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1818. --*/
  1819. HRESULT GetNext
  1820. (
  1821. [out] IeXdiDataBreakpoint **ppieXdiDataBreakpoint
  1822. );
  1823. /*++
  1824. Routine Name:
  1825. DisableAll
  1826. Routine Description:
  1827. Disable all Data Breakpoints which objects are in the enumerated list
  1828. Argument(s):
  1829. none
  1830. Return Value:
  1831. Error status:
  1832. S_OK: Function successful
  1833. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1834. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1835. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  1836. EXDI_E_NOTIMPL: Not implemented
  1837. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1838. EXDI_E_ABORT: Operation aborted
  1839. EXDI_E_FAIL: Unspecified failure
  1840. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1841. --*/
  1842. HRESULT DisableAll
  1843. (
  1844. void
  1845. );
  1846. /*++
  1847. Routine Name:
  1848. EnableAll
  1849. Routine Description:
  1850. Enable all Data Breakpoints which objects are in the enumerated list
  1851. Argument(s):
  1852. none
  1853. Return Value:
  1854. Error status:
  1855. S_OK: Function successful
  1856. EXDI_E_CANNOTWHILETGTRUNNING: Cannot proceed while target running. Must halt the target first.
  1857. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1858. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteCBPWhileRunning
  1859. EXDI_E_NOTIMPL: Not implemented
  1860. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1861. EXDI_E_ABORT: Operation aborted
  1862. EXDI_E_FAIL: Unspecified failure
  1863. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1864. --*/
  1865. HRESULT EnableAll
  1866. (
  1867. void
  1868. );
  1869. }; // IeXdiEnumDataBreakpoint
  1870. const DWORD SIZE_OF_80387_REGISTERS_IN_BYTES = 80;
  1871. typedef
  1872. struct _CONTEXT_X86
  1873. {
  1874. struct
  1875. {
  1876. BOOL fSegmentRegs;
  1877. BOOL fControlRegs;
  1878. BOOL fIntegerRegs;
  1879. BOOL fFloatingPointRegs;
  1880. BOOL fDebugRegs;
  1881. } RegGroupSelection; // These flags are used to select groups of registers only
  1882. // (instead of the totality) for reading or writing.
  1883. // both Segment & Control registers (used if either RegGroupSelection.fSegmentRegs or
  1884. // RegGroupSelection.fControlRegs is TRUE).
  1885. DWORD SegCs;
  1886. DWORD SegSs;
  1887. // Segment registers (used if RegGroupSelection.fSegmentRegs is TRUE).
  1888. // except CS and SS which are in "Segment and Control" - see above
  1889. DWORD SegGs;
  1890. DWORD SegFs;
  1891. DWORD SegEs;
  1892. DWORD SegDs;
  1893. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  1894. // except CS and SS which are in "Segment and Control" - see above
  1895. DWORD EFlags;
  1896. DWORD Ebp;
  1897. DWORD Eip;
  1898. DWORD Esp;
  1899. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  1900. DWORD Eax;
  1901. DWORD Ebx;
  1902. DWORD Ecx;
  1903. DWORD Edx;
  1904. DWORD Esi;
  1905. DWORD Edi;
  1906. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  1907. DWORD ControlWord;
  1908. DWORD StatusWord;
  1909. DWORD TagWord;
  1910. DWORD ErrorOffset;
  1911. DWORD ErrorSelector;
  1912. DWORD DataOffset;
  1913. DWORD DataSelector;
  1914. BYTE RegisterArea [SIZE_OF_80387_REGISTERS_IN_BYTES];
  1915. DWORD Cr0NpxState;
  1916. // Debug registers (used if RegGroupSelection.fDebugRegs is TRUE)
  1917. DWORD Dr0;
  1918. DWORD Dr1;
  1919. DWORD Dr2;
  1920. DWORD Dr3;
  1921. DWORD Dr6;
  1922. DWORD Dr7;
  1923. } CONTEXT_X86, *PCONTEXT_X86;
  1924. /////////////////////////////////////////////////////////////////////////////
  1925. /////////////////////////////////////////////////////////////////////////////
  1926. //
  1927. // IeXdiX86Context
  1928. //
  1929. /////////////////////////////////////////////////////////////////////////////
  1930. /////////////////////////////////////////////////////////////////////////////
  1931. // X86 context access interface
  1932. [
  1933. object,
  1934. uuid(47486F67-6461-6C65-5844-495358383643),
  1935. helpstring("IeXdiX86Context interface - eXdi Context access for X86 processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  1936. pointer_default(ref)
  1937. ]
  1938. interface IeXdiX86Context : IUnknown
  1939. {
  1940. /*++
  1941. Routine Name:
  1942. GetContext
  1943. Routine Description:
  1944. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  1945. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  1946. Argument(s):
  1947. pContext - Return context (CPU dependant structure).
  1948. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  1949. Return Value:
  1950. Error status:
  1951. S_OK: Function successful
  1952. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1953. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1954. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  1955. EXDI_E_NOTIMPL: Not implemented
  1956. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1957. EXDI_E_INVALIDARG: One or more arguments are invalid
  1958. EXDI_E_ABORT: Operation aborted
  1959. EXDI_E_FAIL: Unspecified failure
  1960. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1961. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1962. --*/
  1963. HRESULT GetContext
  1964. (
  1965. [in, out] PCONTEXT_X86 pContext
  1966. );
  1967. /*++
  1968. Routine Name:
  1969. SetContext
  1970. Routine Description:
  1971. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  1972. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  1973. Argument(s):
  1974. pContext - Return context (CPU dependant structure).
  1975. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  1976. Return Value:
  1977. Error status:
  1978. S_OK: Function successful
  1979. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  1980. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  1981. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  1982. EXDI_E_NOTIMPL: Not implemented
  1983. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  1984. EXDI_E_INVALIDARG: One or more arguments are invalid
  1985. EXDI_E_ABORT: Operation aborted
  1986. EXDI_E_FAIL: Unspecified failure
  1987. EXDI_E_COMMUNICATION: Communication error between host driver and target
  1988. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  1989. --*/
  1990. HRESULT SetContext
  1991. (
  1992. [in] CONTEXT_X86 Context
  1993. );
  1994. }; // interface IeXdiX86Context
  1995. typedef
  1996. struct _CONTEXT_SHX
  1997. {
  1998. struct
  1999. {
  2000. BOOL fControlRegs; // control and system registers
  2001. BOOL fIntegerRegs;
  2002. BOOL fFloatingPointRegs; // Only available for SH4
  2003. BOOL fDebugRegs;
  2004. } RegGroupSelection; // These flags are used to select groups of registers only
  2005. // (instead of the totality) for reading or writing.
  2006. // Control registers (used if RegGroupSelection.fControlRegs is TRUE)
  2007. // except R14 (Fp) and R15 (Sp) which are in "Integer and Control" - see further
  2008. DWORD Pr; // Procedure Register (Return Address)
  2009. DWORD Mach; // Multiply and accumulate High
  2010. DWORD Macl; // Multiply and accumulate Low
  2011. DWORD Gbr; // Global base register
  2012. DWORD Pc; // Program Counter
  2013. DWORD Sr; // Status register
  2014. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2015. // except R14 and R15 which are in "Integer and Control" - see further
  2016. DWORD R0; // Return val - Temp
  2017. DWORD R1; // Temp
  2018. DWORD R2; // Temp
  2019. DWORD R3; // Temp
  2020. DWORD R4; // Arg - Temp
  2021. DWORD R5; // Arg - Temp
  2022. DWORD R6; // Arg - Temp
  2023. DWORD R7; // Arg - Temp
  2024. DWORD R8; // Permanent
  2025. DWORD R9; // Permanent
  2026. DWORD R10; // Permanent
  2027. DWORD R11; // Permanent
  2028. DWORD R12; // Permanent
  2029. DWORD R13; // Permanent
  2030. // both Integer & Control registers (used if either RegGroupSelection.fIntegerRegs or
  2031. // RegGroupSelection.fControlRegs is TRUE).
  2032. DWORD R14; // Frame pointer (recommended)
  2033. DWORD R15; // Stack pointer
  2034. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  2035. // NOTE: this group is only used for SH4. On SH3, the data are just ignored
  2036. DWORD Fpscr; // Floating point status/control register
  2037. DWORD Fpul; // Floating point communication register
  2038. DWORD FR_B0 [16]; // Floating point regs bank 0
  2039. DWORD FR_B1 [16]; // Floating point regs bank 1
  2040. // Debug registers (used if RegGroupSelection.fDebugRegs is TRUE)
  2041. DWORD BarA;
  2042. BYTE BasrA;
  2043. BYTE BamrA;
  2044. WORD BbrA;
  2045. DWORD BarB;
  2046. BYTE BasrB;
  2047. BYTE BamrB;
  2048. WORD BbrB;
  2049. DWORD BdrB;
  2050. DWORD BdmrB;
  2051. WORD Brcr;
  2052. WORD Align;
  2053. } CONTEXT_SHX, *PCONTEXT_SHX;
  2054. /////////////////////////////////////////////////////////////////////////////
  2055. /////////////////////////////////////////////////////////////////////////////
  2056. //
  2057. // IeXdiSHXContext
  2058. //
  2059. /////////////////////////////////////////////////////////////////////////////
  2060. /////////////////////////////////////////////////////////////////////////////
  2061. // SHX context access interface
  2062. [
  2063. object,
  2064. uuid(47486F67-6461-6C65-5844-495353475843),
  2065. helpstring("IeXdiSHXContext interface - eXdi Context access for SHX processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2066. pointer_default(ref)
  2067. ]
  2068. interface IeXdiSHXContext : IUnknown
  2069. {
  2070. /*++
  2071. Routine Name:
  2072. GetContext
  2073. Routine Description:
  2074. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2075. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2076. Argument(s):
  2077. pContext - Return context (CPU dependant structure).
  2078. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2079. Return Value:
  2080. Error status:
  2081. S_OK: Function successful
  2082. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2083. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2084. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2085. EXDI_E_NOTIMPL: Not implemented
  2086. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2087. EXDI_E_INVALIDARG: One or more arguments are invalid
  2088. EXDI_E_ABORT: Operation aborted
  2089. EXDI_E_FAIL: Unspecified failure
  2090. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2091. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2092. --*/
  2093. HRESULT GetContext
  2094. (
  2095. [in, out] PCONTEXT_SHX pContext
  2096. );
  2097. /*++
  2098. Routine Name:
  2099. SetContext
  2100. Routine Description:
  2101. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2102. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2103. Argument(s):
  2104. pContext - Return context (CPU dependant structure).
  2105. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2106. Return Value:
  2107. Error status:
  2108. S_OK: Function successful
  2109. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2110. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2111. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2112. EXDI_E_NOTIMPL: Not implemented
  2113. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2114. EXDI_E_INVALIDARG: One or more arguments are invalid
  2115. EXDI_E_ABORT: Operation aborted
  2116. EXDI_E_FAIL: Unspecified failure
  2117. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2118. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2119. --*/
  2120. HRESULT SetContext
  2121. (
  2122. [in] CONTEXT_SHX Context
  2123. );
  2124. }; // interface IeXdiSHXContext
  2125. typedef
  2126. struct _CONTEXT_MIPS
  2127. {
  2128. struct
  2129. {
  2130. BOOL fMode64bits;
  2131. BOOL fControlRegs;
  2132. BOOL fIntegerRegs;
  2133. BOOL fFloatingPointRegs;
  2134. BOOL fExceptRegs; // Exception processing regs
  2135. BOOL fMemoryMgmRegs; // Memory Management regs
  2136. } RegGroupSelection; // These flags are used to select groups of registers only
  2137. // (instead of the totality) for reading or writing.
  2138. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2139. // Note: The registers gp, sp, and ra are both part of Integer register and Control register
  2140. // (used if either RegGroupSelection.fIntegerRegs or RegGroupSelection.fControlRegs is TRUE).
  2141. // Note: Register zero ($0) is not stored in the frame.
  2142. // 32 bit mode - 64 bit mode
  2143. DWORD IntAt; DWORD Hi32_IntAt; // $1
  2144. DWORD IntV0; DWORD Hi32_IntV0; // $2
  2145. DWORD IntV1; DWORD Hi32_IntV1; // $3
  2146. DWORD IntA0; DWORD Hi32_IntA0; // $4
  2147. DWORD IntA1; DWORD Hi32_IntA1; // $5
  2148. DWORD IntA2; DWORD Hi32_IntA2; // $6
  2149. DWORD IntA3; DWORD Hi32_IntA3; // $7
  2150. DWORD IntT0; DWORD Hi32_IntT0; // $8
  2151. DWORD IntT1; DWORD Hi32_IntT1; // $9
  2152. DWORD IntT2; DWORD Hi32_IntT2; // $10
  2153. DWORD IntT3; DWORD Hi32_IntT3; // $11
  2154. DWORD IntT4; DWORD Hi32_IntT4; // $12
  2155. DWORD IntT5; DWORD Hi32_IntT5; // $13
  2156. DWORD IntT6; DWORD Hi32_IntT6; // $14
  2157. DWORD IntT7; DWORD Hi32_IntT7; // $15
  2158. DWORD IntS0; DWORD Hi32_IntS0; // $16
  2159. DWORD IntS1; DWORD Hi32_IntS1; // $17
  2160. DWORD IntS2; DWORD Hi32_IntS2; // $18
  2161. DWORD IntS3; DWORD Hi32_IntS3; // $19
  2162. DWORD IntS4; DWORD Hi32_IntS4; // $20
  2163. DWORD IntS5; DWORD Hi32_IntS5; // $21
  2164. DWORD IntS6; DWORD Hi32_IntS6; // $22
  2165. DWORD IntS7; DWORD Hi32_IntS7; // $23
  2166. DWORD IntT8; DWORD Hi32_IntT8; // $24
  2167. DWORD IntT9; DWORD Hi32_IntT9; // $25
  2168. DWORD IntK0; DWORD Hi32_IntK0; // $26
  2169. DWORD IntK1; DWORD Hi32_IntK1; // $27
  2170. DWORD IntGp; DWORD Hi32_IntGp; // $28 - Also part of Control registers (in addition to Integer register)
  2171. DWORD IntSp; DWORD Hi32_IntSp; // $29 - Also part of Control registers (in addition to Integer register)
  2172. DWORD IntS8; DWORD Hi32_IntS8; // $30
  2173. DWORD IntRa; DWORD Hi32_IntRa; // $31 - Also part of Control registers (in addition to Integer register)
  2174. DWORD IntLo; DWORD Hi32_IntLo;
  2175. DWORD IntHi; DWORD Hi32_IntHi;
  2176. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  2177. // 32 bit mode - 64 bit mode
  2178. DWORD FltF0; DWORD Hi32_FltF0;
  2179. DWORD FltF1; DWORD Hi32_FltF1;
  2180. DWORD FltF2; DWORD Hi32_FltF2;
  2181. DWORD FltF3; DWORD Hi32_FltF3;
  2182. DWORD FltF4; DWORD Hi32_FltF4;
  2183. DWORD FltF5; DWORD Hi32_FltF5;
  2184. DWORD FltF6; DWORD Hi32_FltF6;
  2185. DWORD FltF7; DWORD Hi32_FltF7;
  2186. DWORD FltF8; DWORD Hi32_FltF8;
  2187. DWORD FltF9; DWORD Hi32_FltF9;
  2188. DWORD FltF10; DWORD Hi32_FltF10;
  2189. DWORD FltF11; DWORD Hi32_FltF11;
  2190. DWORD FltF12; DWORD Hi32_FltF12;
  2191. DWORD FltF13; DWORD Hi32_FltF13;
  2192. DWORD FltF14; DWORD Hi32_FltF14;
  2193. DWORD FltF15; DWORD Hi32_FltF15;
  2194. DWORD FltF16; DWORD Hi32_FltF16;
  2195. DWORD FltF17; DWORD Hi32_FltF17;
  2196. DWORD FltF18; DWORD Hi32_FltF18;
  2197. DWORD FltF19; DWORD Hi32_FltF19;
  2198. DWORD FltF20; DWORD Hi32_FltF20;
  2199. DWORD FltF21; DWORD Hi32_FltF21;
  2200. DWORD FltF22; DWORD Hi32_FltF22;
  2201. DWORD FltF23; DWORD Hi32_FltF23;
  2202. DWORD FltF24; DWORD Hi32_FltF24;
  2203. DWORD FltF25; DWORD Hi32_FltF25;
  2204. DWORD FltF26; DWORD Hi32_FltF26;
  2205. DWORD FltF27; DWORD Hi32_FltF27;
  2206. DWORD FltF28; DWORD Hi32_FltF28;
  2207. DWORD FltF29; DWORD Hi32_FltF29;
  2208. DWORD FltF30; DWORD Hi32_FltF30;
  2209. DWORD FltF31; DWORD Hi32_FltF31;
  2210. DWORD FCR0; // floating-point control register: implementation / revision
  2211. DWORD FCR31; // floating-point control register: control / status
  2212. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  2213. // Note: The registers gp, sp, and ra defined above are both part of Integer register and Control register
  2214. // (used if either RegGroupSelection.fControlRegs or RegGroupSelection.fControlRegs is TRUE).
  2215. // Note: The registers Sr defined later are both part of Exception registers and Control registers
  2216. // (used if either RegGroupSelection.fExceptRegs or RegGroupSelection.fControlRegs is TRUE).
  2217. // 32 bit mode - 64 bit mode
  2218. DWORD Pc; DWORD Hi32_Pc; // Program counter
  2219. // Exception processing registers (used if RegGroupSelection.fExceptRegs is TRUE).
  2220. DWORD Context; DWORD Hi32_Context; // Pointer to kernel virtual page table entry (PTE) in 32-bit addressing mode
  2221. DWORD BadVAddr; DWORD Hi32_BadVAddr; // Bad virtual address
  2222. DWORD EPC; DWORD Hi32_EPC; // Exception Program Counter
  2223. DWORD XContextReg; DWORD Hi32_XContextReg; // Pointer to kernel virtual PTE table in 64-bit addressing mode
  2224. DWORD ErrorEPC; DWORD Hi32_ErrorEPC; // Error Exception Program Counter
  2225. DWORD Count; // Timer Count
  2226. DWORD Compare; // Timer Compare
  2227. DWORD Sr; // Status register - Also part of Control registers (in addition to Exception registers)
  2228. DWORD Cause; // Cause of last exception
  2229. DWORD WatchLo; // Physical Memory Reference trap address low bits
  2230. DWORD WatchHi; // Physical Memory Reference trap address high bits
  2231. DWORD ECC; // Secondary-cache error checking and correcting (ECC) and Primary parity
  2232. DWORD CacheErr; // Cache Error and Status register
  2233. // Memory Management registers (used if RegGroupSelection.fMemoryMgmRegs is TRUE).
  2234. DWORD Index; // Programmable pointer into TLB array
  2235. DWORD Random; // Pseudorandom point into TLB array
  2236. DWORD EntryLo0; DWORD Hi32_EntryLo0; // Low half of TLB entry for even virtual address (VPN)
  2237. DWORD EntryLo1; DWORD Hi32_EntryLo1; // Low half of TLB entry for odd virtual address (VPN)
  2238. DWORD PageMask; // TLB Page Mask
  2239. DWORD Wired; // Number of wired TLB entries
  2240. DWORD EntryHi; DWORD Hi32_EntryHi; // High half of TLB entry
  2241. DWORD PRId; // Processor Revision Identifier
  2242. DWORD Config; // Configuration register
  2243. DWORD LLAddr; // Load Linked Address
  2244. DWORD TagLo; // Cache Tag register
  2245. DWORD TagHi; // Cache Tag register
  2246. } CONTEXT_MIPS, *PCONTEXT_MIPS;
  2247. /////////////////////////////////////////////////////////////////////////////
  2248. /////////////////////////////////////////////////////////////////////////////
  2249. //
  2250. // IeXdiMIPSContext
  2251. //
  2252. /////////////////////////////////////////////////////////////////////////////
  2253. /////////////////////////////////////////////////////////////////////////////
  2254. // MIPS context access interface
  2255. [
  2256. object,
  2257. uuid(47486F67-6461-6C65-5844-49534D495043),
  2258. helpstring("IeXdiMIPSContext interface - eXdi Context access for MIPS processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2259. pointer_default(ref)
  2260. ]
  2261. interface IeXdiMIPSContext : IUnknown
  2262. {
  2263. /*++
  2264. Routine Name:
  2265. GetContext
  2266. Routine Description:
  2267. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2268. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2269. Argument(s):
  2270. pContext - Return context (CPU dependant structure).
  2271. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2272. Return Value:
  2273. Error status:
  2274. S_OK: Function successful
  2275. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2276. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2277. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2278. EXDI_E_NOTIMPL: Not implemented
  2279. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2280. EXDI_E_INVALIDARG: One or more arguments are invalid
  2281. EXDI_E_ABORT: Operation aborted
  2282. EXDI_E_FAIL: Unspecified failure
  2283. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2284. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2285. --*/
  2286. HRESULT GetContext
  2287. (
  2288. [in, out] PCONTEXT_MIPS pContext
  2289. );
  2290. /*++
  2291. Routine Name:
  2292. SetContext
  2293. Routine Description:
  2294. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2295. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2296. Argument(s):
  2297. pContext - Return context (CPU dependant structure).
  2298. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2299. Return Value:
  2300. Error status:
  2301. S_OK: Function successful
  2302. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2303. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2304. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2305. EXDI_E_NOTIMPL: Not implemented
  2306. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2307. EXDI_E_INVALIDARG: One or more arguments are invalid
  2308. EXDI_E_ABORT: Operation aborted
  2309. EXDI_E_FAIL: Unspecified failure
  2310. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2311. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2312. --*/
  2313. HRESULT SetContext
  2314. (
  2315. [in] CONTEXT_MIPS Context
  2316. );
  2317. }; // interface IeXdiMIPSContext
  2318. typedef
  2319. struct _CONTEXT_ARM
  2320. {
  2321. struct
  2322. {
  2323. BOOL fControlRegs;
  2324. BOOL fIntegerRegs;
  2325. BOOL fDebugRegs;
  2326. } RegGroupSelection; // These flags are used to select groups of registers only
  2327. // (instead of the totality) for reading or writing.
  2328. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  2329. DWORD Sp;
  2330. DWORD Lr;
  2331. DWORD Pc;
  2332. DWORD Psr;
  2333. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2334. DWORD R0;
  2335. DWORD R1;
  2336. DWORD R2;
  2337. DWORD R3;
  2338. DWORD R4;
  2339. DWORD R5;
  2340. DWORD R6;
  2341. DWORD R7;
  2342. DWORD R8;
  2343. DWORD R9;
  2344. DWORD R10;
  2345. DWORD R11;
  2346. DWORD R12;
  2347. } CONTEXT_ARM, *PCONTEXT_ARM;
  2348. /////////////////////////////////////////////////////////////////////////////
  2349. /////////////////////////////////////////////////////////////////////////////
  2350. //
  2351. // IeXdiARMContext
  2352. //
  2353. /////////////////////////////////////////////////////////////////////////////
  2354. /////////////////////////////////////////////////////////////////////////////
  2355. // ARM context access interface
  2356. [
  2357. object,
  2358. uuid(47486F67-6461-6C65-5844-495341524D43),
  2359. helpstring("IeXdiARMContext interface - eXdi Context access for ARM processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2360. pointer_default(ref)
  2361. ]
  2362. interface IeXdiARMContext : IUnknown
  2363. {
  2364. /*++
  2365. Routine Name:
  2366. GetContext
  2367. Routine Description:
  2368. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2369. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2370. Argument(s):
  2371. pContext - Return context (CPU dependant structure).
  2372. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2373. Return Value:
  2374. Error status:
  2375. S_OK: Function successful
  2376. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2377. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2378. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2379. EXDI_E_NOTIMPL: Not implemented
  2380. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2381. EXDI_E_INVALIDARG: One or more arguments are invalid
  2382. EXDI_E_ABORT: Operation aborted
  2383. EXDI_E_FAIL: Unspecified failure
  2384. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2385. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2386. --*/
  2387. HRESULT GetContext
  2388. (
  2389. [in, out] PCONTEXT_ARM pContext
  2390. );
  2391. /*++
  2392. Routine Name:
  2393. SetContext
  2394. Routine Description:
  2395. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2396. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2397. Argument(s):
  2398. pContext - Return context (CPU dependant structure).
  2399. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2400. Return Value:
  2401. Error status:
  2402. S_OK: Function successful
  2403. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2404. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2405. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2406. EXDI_E_NOTIMPL: Not implemented
  2407. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2408. EXDI_E_INVALIDARG: One or more arguments are invalid
  2409. EXDI_E_ABORT: Operation aborted
  2410. EXDI_E_FAIL: Unspecified failure
  2411. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2412. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2413. --*/
  2414. HRESULT SetContext
  2415. (
  2416. [in] CONTEXT_ARM Context
  2417. );
  2418. }; // interface IeXdiARMContext
  2419. typedef
  2420. struct _CONTEXT_PPC
  2421. {
  2422. struct
  2423. {
  2424. BOOL fControlRegs;
  2425. BOOL fIntegerRegs;
  2426. BOOL fFloatingPointRegs;
  2427. BOOL fDebugRegs;
  2428. } RegGroupSelection; // These flags are used to select groups of registers only
  2429. // (instead of the totality) for reading or writing.
  2430. // Floating point registers (used if RegGroupSelection.fFloatingPointRegs is TRUE).
  2431. double Fpr0;
  2432. double Fpr1;
  2433. double Fpr2;
  2434. double Fpr3;
  2435. double Fpr4;
  2436. double Fpr5;
  2437. double Fpr6;
  2438. double Fpr7;
  2439. double Fpr8;
  2440. double Fpr9;
  2441. double Fpr10;
  2442. double Fpr11;
  2443. double Fpr12;
  2444. double Fpr13;
  2445. double Fpr14;
  2446. double Fpr15;
  2447. double Fpr16;
  2448. double Fpr17;
  2449. double Fpr18;
  2450. double Fpr19;
  2451. double Fpr20;
  2452. double Fpr21;
  2453. double Fpr22;
  2454. double Fpr23;
  2455. double Fpr24;
  2456. double Fpr25;
  2457. double Fpr26;
  2458. double Fpr27;
  2459. double Fpr28;
  2460. double Fpr29;
  2461. double Fpr30;
  2462. double Fpr31;
  2463. double Fpscr; // Floating point status/control reg
  2464. // Integer registers (used if RegGroupSelection.fIntegerRegs is TRUE).
  2465. DWORD Gpr0; // General registers 0..31
  2466. DWORD Gpr1;
  2467. DWORD Gpr2;
  2468. DWORD Gpr3;
  2469. DWORD Gpr4;
  2470. DWORD Gpr5;
  2471. DWORD Gpr6;
  2472. DWORD Gpr7;
  2473. DWORD Gpr8;
  2474. DWORD Gpr9;
  2475. DWORD Gpr10;
  2476. DWORD Gpr11;
  2477. DWORD Gpr12;
  2478. DWORD Gpr13;
  2479. DWORD Gpr14;
  2480. DWORD Gpr15;
  2481. DWORD Gpr16;
  2482. DWORD Gpr17;
  2483. DWORD Gpr18;
  2484. DWORD Gpr19;
  2485. DWORD Gpr20;
  2486. DWORD Gpr21;
  2487. DWORD Gpr22;
  2488. DWORD Gpr23;
  2489. DWORD Gpr24;
  2490. DWORD Gpr25;
  2491. DWORD Gpr26;
  2492. DWORD Gpr27;
  2493. DWORD Gpr28;
  2494. DWORD Gpr29;
  2495. DWORD Gpr30;
  2496. DWORD Gpr31;
  2497. // Control registers (used if RegGroupSelection.fControlRegs is TRUE).
  2498. DWORD Msr; // Machine status register
  2499. DWORD Iar; // Instruction address register
  2500. DWORD Lr; // Link register
  2501. DWORD Ctr; // Count register
  2502. DWORD Cr; // Condition register
  2503. DWORD Xer; // Fixed point exception register
  2504. // Debug registers (used if RegGroupSelection.fDebugRegs is TRUE)
  2505. DWORD Dr0; // Breakpoint Register 1
  2506. DWORD Dr1; // Breakpoint Register 2
  2507. DWORD Dr2; // Breakpoint Register 3
  2508. DWORD Dr3; // Breakpoint Register 4
  2509. DWORD Dr4; // Breakpoint Register 5
  2510. DWORD Dr5; // Breakpoint Register 6
  2511. DWORD Dr6; // Debug Status Register
  2512. DWORD Dr7; // Debug Control Register
  2513. } CONTEXT_PPC, *PCONTEXT_PPC;
  2514. /////////////////////////////////////////////////////////////////////////////
  2515. /////////////////////////////////////////////////////////////////////////////
  2516. //
  2517. // IeXdiPPCContext
  2518. //
  2519. /////////////////////////////////////////////////////////////////////////////
  2520. /////////////////////////////////////////////////////////////////////////////
  2521. // PPC context access interface
  2522. [
  2523. object,
  2524. uuid(47486F67-6461-6C65-5844-495350504343),
  2525. helpstring("IeXdiPPCContext interface - eXdi Context access for PPC processors 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2526. pointer_default(ref)
  2527. ]
  2528. interface IeXdiPPCContext : IUnknown
  2529. {
  2530. /*++
  2531. Routine Name:
  2532. GetContext
  2533. Routine Description:
  2534. Read Context - Read a set of CPU / Co-Proc registers that define the state of the target
  2535. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be read only
  2536. Argument(s):
  2537. pContext - Return context (CPU dependant structure).
  2538. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2539. Return Value:
  2540. Error status:
  2541. S_OK: Function successful
  2542. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2543. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2544. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fReadRegWhileRunning
  2545. EXDI_E_NOTIMPL: Not implemented
  2546. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2547. EXDI_E_INVALIDARG: One or more arguments are invalid
  2548. EXDI_E_ABORT: Operation aborted
  2549. EXDI_E_FAIL: Unspecified failure
  2550. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2551. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2552. --*/
  2553. HRESULT GetContext
  2554. (
  2555. [in, out] PCONTEXT_PPC pContext
  2556. );
  2557. /*++
  2558. Routine Name:
  2559. SetContext
  2560. Routine Description:
  2561. Write Context - Write a set of CPU / Co-Proc registers that define the state of the target
  2562. The CONTEXT.RegGroupSelection bitfield allow to select which group of register need to be written only
  2563. Argument(s):
  2564. pContext - Return context (CPU dependant structure).
  2565. Note: The context is also passed in to indicate only the RegGroupSelection (which reg groups are read)
  2566. Return Value:
  2567. Error status:
  2568. S_OK: Function successful
  2569. EXDI_E_CANNOTWHILETGTRUNNING Cannot proceed while target running. Must halt the target first.
  2570. Note: this error is generated only if the probe / target does not support this operation "on the fly".
  2571. see DEBUG_ACCESS_CAPABILITIES_STRUCT.fWriteRegWhileRunning
  2572. EXDI_E_NOTIMPL: Not implemented
  2573. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2574. EXDI_E_INVALIDARG: One or more arguments are invalid
  2575. EXDI_E_ABORT: Operation aborted
  2576. EXDI_E_FAIL: Unspecified failure
  2577. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2578. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2579. --*/
  2580. HRESULT SetContext
  2581. (
  2582. [in] CONTEXT_PPC Context
  2583. );
  2584. }; // interface IeXdiPPCContext
  2585. /////////////////////////////////////////////////////////////////////////////
  2586. /////////////////////////////////////////////////////////////////////////////
  2587. //
  2588. // IeXdiClientNotifyMemChg
  2589. //
  2590. /////////////////////////////////////////////////////////////////////////////
  2591. /////////////////////////////////////////////////////////////////////////////
  2592. /////////////////////////////////////////////////////////////////////////////
  2593. // Notify Memory/IO/Reg change
  2594. /////////////////////////////////////////////////////////////////////////////
  2595. [
  2596. object,
  2597. uuid(47486F67-6461-6C65-5844-49434E4D4300),
  2598. helpstring("IeXdiClientNotifyMemChg interface - eXdi Notify Memory Changes 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2599. pointer_default(ref)
  2600. ]
  2601. interface IeXdiClientNotifyMemChg : IUnknown
  2602. {
  2603. /*++
  2604. Routine Name:
  2605. NotifyMemoryChange
  2606. Routine Description:
  2607. 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.
  2608. 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.
  2609. Argument(s):
  2610. mtChanged - Memory change type. Indicates whether this memory change notification concerns virtual memory, physical memory or pheripherical IO, or CPU register
  2611. Address - Starting address of the data buffer to be accessed on the target.
  2612. 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)
  2613. otherwize, don't care.
  2614. dwNbElemChanged - Number of element(s) (of byDataWidth bits) to be accessed.
  2615. bAccessWidth - Data Width in bits (byte=8, word=16, dword=32, ddword=64, and other if supported by target).
  2616. Return Value:
  2617. Error status:
  2618. S_OK: Function successful
  2619. EXDI_E_NOTIMPL: Not implemented
  2620. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2621. EXDI_E_INVALIDARG: One or more arguments are invalid
  2622. EXDI_E_ABORT: Operation aborted
  2623. EXDI_E_FAIL: Unspecified failure
  2624. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2625. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2626. --*/
  2627. HRESULT NotifyMemoryChange
  2628. (
  2629. [in] MEM_TYPE mtChanged,
  2630. [in] ADDRESS_TYPE Address,
  2631. [in] BYTE bAddressSpace,
  2632. [in] DWORD dwNbElemChanged,
  2633. [in] BYTE bAccessWidth
  2634. );
  2635. }; // interface IeXdiClientNotifyMemChg
  2636. /////////////////////////////////////////////////////////////////////////////
  2637. /////////////////////////////////////////////////////////////////////////////
  2638. //
  2639. // IeXdiClientNotifyRunChg
  2640. //
  2641. /////////////////////////////////////////////////////////////////////////////
  2642. /////////////////////////////////////////////////////////////////////////////
  2643. /////////////////////////////////////////////////////////////////////////////
  2644. // Notify Run state change
  2645. /////////////////////////////////////////////////////////////////////////////
  2646. [
  2647. object,
  2648. uuid(47486F67-6461-6C65-5844-49434E525343),
  2649. helpstring("IeXdiClientNotifyRunChg interface - eXdi Notify Run State Changes 1.0 for Platform Builder 3.0 debugger - Microsoft 1999"),
  2650. pointer_default(ref)
  2651. ]
  2652. interface IeXdiClientNotifyRunChg : IUnknown
  2653. {
  2654. /*++
  2655. Routine Name:
  2656. NotifyRunStateChange
  2657. Routine Description:
  2658. Indicate a change in Run state - The debugger can use this function to invalidate its internal cache.
  2659. 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.
  2660. Argument(s):
  2661. ersCurrent - Supplies the current Run Status Type
  2662. ehrCurrent - Suppliest the current Halt Reason Type (hrNone if Run Status is not Halted)
  2663. CurrentExecAddress - Current program / instruction pointer if Run Status is Halted, undefined otherwise.
  2664. dwExceptionCode - indicate type / source of exception (Code is platform dependant) if Halted due to exception ((rsHalted == ersCurrent) && (hrException == ehrCurrent)), undefined otherwise.
  2665. Return Value:
  2666. Error status:
  2667. S_OK: Function successful
  2668. EXDI_E_NOTIMPL: Not implemented
  2669. EXDI_E_OUTOFMEMORY: Failed to allocate necessary memory
  2670. EXDI_E_INVALIDARG: One or more arguments are invalid
  2671. EXDI_E_ABORT: Operation aborted
  2672. EXDI_E_FAIL: Unspecified failure
  2673. EXDI_E_COMMUNICATION: Communication error between host driver and target
  2674. EXDI_E_USEDBYCONCURENTTHREAD: Cannot proceed immediately because resource is already used by concurent thread.
  2675. --*/
  2676. HRESULT NotifyRunStateChange
  2677. (
  2678. [in] RUN_STATUS_TYPE ersCurrent,
  2679. [in] HALT_REASON_TYPE ehrCurrent,
  2680. [in] ADDRESS_TYPE CurrentExecAddress,
  2681. [in] DWORD dwExceptionCode
  2682. );
  2683. }; // interface IeXdiClientNotifyRunChg
  2684. /////////////////////////////////////////////////////////////////////////////
  2685. /////////////////////////////////////////////////////////////////////////////
  2686. //
  2687. // IeXdiClientCfg
  2688. //
  2689. /////////////////////////////////////////////////////////////////////////////
  2690. /////////////////////////////////////////////////////////////////////////////
  2691. /////////////////////////////////////////////////////////////////////////////
  2692. // Probe / Emulator Configuration
  2693. /////////////////////////////////////////////////////////////////////////////
  2694. // This is totally probe vendor specific
  2695. /////////////////////////////////////////////////////////////////////////////
  2696. /////////////////////////////////////////////////////////////////////////////
  2697. //
  2698. // IeXdiClientTraceCtrl
  2699. //
  2700. /////////////////////////////////////////////////////////////////////////////
  2701. /////////////////////////////////////////////////////////////////////////////
  2702. /////////////////////////////////////////////////////////////////////////////
  2703. // Trace Control
  2704. /////////////////////////////////////////////////////////////////////////////
  2705. // This can be probe vendor specific because there are so many variation in
  2706. // probe support of trigger / event / trace type. The probe vendor will also
  2707. // write the data collectors. An example of complex trace control and trace
  2708. // notification APIs are described later.
  2709. /////////////////////////////////////////////////////////////////////////////
  2710. /////////////////////////////////////////////////////////////////////////////
  2711. //
  2712. // IeXdiClientSubstCtrl
  2713. //
  2714. /////////////////////////////////////////////////////////////////////////////
  2715. /////////////////////////////////////////////////////////////////////////////
  2716. /////////////////////////////////////////////////////////////////////////////
  2717. // Memory and IO Substitution Control
  2718. /////////////////////////////////////////////////////////////////////////////
  2719. // This can be probe vendor specific because there are so many variation in
  2720. // probe support of IO or Memory substition mechanism (overlay, query by
  2721. // port). The probe vendor will also write the data collectors. An example of
  2722. // complex trace control and trace notification APIs are described later.