KD_IOCTL_MAP_EXCEPTION (Compact 2013)

10/16/2014

This I/O control message requests exception code mapping and processor state management from the OEM. This message is called only when a data breakpoint has been encountered. The kernel debugger sends this message with OEMKDIoctl.

Syntax

BOOL OEMKDIoControl(
    DWORD dwIoControlCode,   // use KD_IOCTL_MAP_EXCEPTION
    LPVOID lpInBuffer,       // pointer to input buffer
    DWORD nInBufferSize      // input buffer size
);

Parameters

  • dwIoControlCode
    [in] Control code for the operation. Use KD_IOCTL_MAP_EXCEPTION for this operation.
  • lpInBuffer
    [in][out] Pointer to a buffer that contains a KD_EXCEPTION_INFO structure. The kernel debugger populates the ulExceptionCode and ulAddress members.
  • nInBufferSize
    [in] Size of the buffer pointed to by lpInBuffer.

Return Values

FALSE if the exception was not mapped from a different exception. TRUE if the exception was mapped from a different exception. If the function returns TRUE, the KD_EXCEPTION_INFO structure passed in the lpInBuffer parameter contains the following values:

  1. The ulExceptionCode field is reserved and unused.
  2. The ulAddress field contains the address of the exception.
  3. The uiFlags field contains one of two possible combinations:
    • Both KD_HBP_FLAG_READ and KD_HBP_FLAG_WRITE: The breakpoint occurred due to either a read or a write of the memory location indicated by ulAddress. It is indeterminate which occurred. Set only when a breakpoint occurred with both KD_HBP_FLAG_READ and KD_HBP_FLAG_WRITE set in KD_BPINFO of KD_IOCTL_SET_DBP.
    • Only KD_HBP_FLAG_WRITE: The breakpoint occurred due to a write of the memory location indicated by ulAddress. Set only when a breakpoint occurred with only KD_HBP_FLAG_WRITE set in KD_BPINFO of KD_IOCTL_SET_DBP.

If both the ulAddress and ulFlags fields are nonzero, the exception occurred due to a data breakpoint.

Remarks

The OEM must map exceptions as appropriate for the kernel debugger. For example, a hardware platform that is using a memory protection mechanism to implement breakpoints could convert the memory protection exception to a STATUS_BREAKPOINT exception. Another example is where the hardware data breakpoint and hardware single-step facilities use the same exception. The kernel debugger calls this I/O control, and the OEM returns a mapped exception that indicates which event actually occurred.

This I/O control must perform all necessary processor state management to return the processor to the state in effect before the breakpoint was encountered. For example, if a processor disables hardware data breakpoints when a hardware data breakpoint is encountered, this I/O control must re-enable hardware data breakpoints.

Requirements

Header

pkfuncs.h

See Also

Reference

Kernel Debugger IOCTLs
OEMKDIoctl