Пример #1
0
// initialize an instance of RemoteAddress for use in an IPC event buffer with values from this
// instance of a derived class of EnregisteredValueHome (see EnregisteredValueHome::CopyToIPCEType for full
// header comment)
void RegRegValueHome::CopyToIPCEType(RemoteAddress * pRegAddr)
{
    pRegAddr->kind = RAK_REGREG;
    pRegAddr->reg1 = m_reg1Info.m_kRegNumber;
    pRegAddr->reg1Addr = CORDB_ADDRESS_TO_PTR(m_reg1Info.m_regAddr);
    pRegAddr->reg1Value = m_reg1Info.m_regValue;
    pRegAddr->u.reg2 = m_reg2Info.m_kRegNumber;
    pRegAddr->u.reg2Addr = CORDB_ADDRESS_TO_PTR(m_reg2Info.m_regAddr); 
    pRegAddr->u.reg2Value = m_reg2Info.m_regValue;
} // RegRegValueHome::CopyToIPCEType
Пример #2
0
void InitEventForDebuggerNotification(DEBUG_EVENT *      pDebugEvent,
                                      CORDB_ADDRESS      pClrBaseAddress,
                                      DebuggerIPCEvent * pIPCEvent)
{
    pDebugEvent->dwDebugEventCode = EXCEPTION_DEBUG_EVENT;

    pDebugEvent->u.Exception.dwFirstChance = TRUE;
    pDebugEvent->u.Exception.ExceptionRecord.ExceptionCode    = CLRDBG_NOTIFICATION_EXCEPTION_CODE;
    pDebugEvent->u.Exception.ExceptionRecord.ExceptionFlags   = 0;
    pDebugEvent->u.Exception.ExceptionRecord.ExceptionRecord  = NULL;
    pDebugEvent->u.Exception.ExceptionRecord.ExceptionAddress = 0;

    //
    // Format of an ExceptionInformation parameter is:
    //  0: cookie (CLRDBG_EXCEPTION_DATA_CHECKSUM)
    //  1: Base address of mscorwks. This identifies the instance of the CLR.
    //  2: Target Address of DebuggerIPCEvent, which contains the "real" event.
    //
    pDebugEvent->u.Exception.ExceptionRecord.NumberParameters = 3;
    pDebugEvent->u.Exception.ExceptionRecord.ExceptionInformation[0] = CLRDBG_EXCEPTION_DATA_CHECKSUM;
    pDebugEvent->u.Exception.ExceptionRecord.ExceptionInformation[1] = (ULONG_PTR)CORDB_ADDRESS_TO_PTR(pClrBaseAddress);
    pDebugEvent->u.Exception.ExceptionRecord.ExceptionInformation[2] = (ULONG_PTR)pIPCEvent;

    _ASSERTE(IsEventDebuggerNotification(&(pDebugEvent->u.Exception.ExceptionRecord), pClrBaseAddress) ==
             PTR_TO_CORDB_ADDRESS(pIPCEvent));
}
Пример #3
0
// initialize an instance of RemoteAddress for use in an IPC event buffer with values from this
// instance of a derived class of EnregisteredValueHome (see EnregisteredValueHome::CopyToIPCEType for full
// header comment)
void RegMemValueHome::CopyToIPCEType(RemoteAddress * pRegAddr)
{
    pRegAddr->kind = RAK_REGMEM;
    pRegAddr->reg1 = m_reg1Info.m_kRegNumber;
    pRegAddr->reg1Addr = CORDB_ADDRESS_TO_PTR(m_reg1Info.m_regAddr);
    pRegAddr->reg1Value = m_reg1Info.m_regValue;
    pRegAddr->addr = m_memAddr;
} // RegMemValueHome::CopyToIPCEType
Пример #4
0
// impl of interface method ICorDebugMutableDataTarget::WriteVirtual
HRESULT STDMETHODCALLTYPE
ShimRemoteDataTarget::WriteVirtual( 
    CORDB_ADDRESS pAddress,
    const BYTE * pBuffer,
    ULONG32 cbRequestSize)
{
    ReturnFailureIfStateNotOk();

    HRESULT hr = E_FAIL;
    hr = m_pTransport->WriteMemory(reinterpret_cast<BYTE *>(CORDB_ADDRESS_TO_PTR(pAddress)), 
                                   const_cast<BYTE *>(pBuffer), 
                                   cbRequestSize);
    return hr;
}
Пример #5
0
// impl of interface method ICorDebugDataTarget::ReadVirtual
HRESULT STDMETHODCALLTYPE
ShimRemoteDataTarget::ReadVirtual( 
    CORDB_ADDRESS address,
    PBYTE pBuffer,
    ULONG32 cbRequestSize,
    ULONG32 *pcbRead)
{
    ReturnFailureIfStateNotOk();

    HRESULT hr = E_FAIL;
    hr = m_pTransport->ReadMemory(reinterpret_cast<BYTE *>(CORDB_ADDRESS_TO_PTR(address)), 
                                  pBuffer, 
                                  cbRequestSize);
    if (pcbRead != NULL)
    {
        *pcbRead = (SUCCEEDED(hr) ? cbRequestSize : 0);
    }
    return hr;
}