Ejemplo n.º 1
0
HRESULT CordbRegisterSet::GetRegisters(ULONG64 mask, ULONG32 regCount, CORDB_REGISTER regBuffer[])
{
    PUBLIC_REENTRANT_API_ENTRY(this);
    FAIL_IF_NEUTERED(this);
    ATT_REQUIRE_STOPPED_MAY_FAIL(GetProcess());

    UINT iRegister = 0;

    VALIDATE_POINTER_TO_OBJECT_ARRAY(regBuffer, CORDB_REGISTER, regCount, true, true);
    
    // @ARMTODO: floating point support

    for (int i = REGISTER_INSTRUCTION_POINTER;
         i <= REGISTER_ARM_LR && iRegister < regCount;
         i++)
    {
        if (mask &  SETBITULONG64(i))
        {
            switch (i)
            {
            case REGISTER_INSTRUCTION_POINTER: 
                regBuffer[iRegister++] = m_rd->PC; break;
            case REGISTER_STACK_POINTER:
                regBuffer[iRegister++] = m_rd->SP; break;
            case REGISTER_ARM_R0:
                regBuffer[iRegister++] = m_rd->R0; break;
            case REGISTER_ARM_R1:
                regBuffer[iRegister++] = m_rd->R1; break;
            case REGISTER_ARM_R2:
                regBuffer[iRegister++] = m_rd->R2; break;
            case REGISTER_ARM_R3:
                regBuffer[iRegister++] = m_rd->R3; break;
            case REGISTER_ARM_R4:
                regBuffer[iRegister++] = m_rd->R4; break;
            case REGISTER_ARM_R5:
                regBuffer[iRegister++] = m_rd->R5; break;
            case REGISTER_ARM_R6:
                regBuffer[iRegister++] = m_rd->R6; break;
            case REGISTER_ARM_R7:
                regBuffer[iRegister++] = m_rd->R7; break;
            case REGISTER_ARM_R8:
                regBuffer[iRegister++] = m_rd->R8; break;
            case REGISTER_ARM_R9:
                regBuffer[iRegister++] = m_rd->R9; break;
            case REGISTER_ARM_R10:
                regBuffer[iRegister++] = m_rd->R10; break;
            case REGISTER_ARM_R11:
                regBuffer[iRegister++] = m_rd->R11; break;
            case REGISTER_ARM_R12:
                regBuffer[iRegister++] = m_rd->R12; break;
            case REGISTER_ARM_LR:
                regBuffer[iRegister++] = m_rd->LR; break;
            }
        }
    }

    _ASSERTE (iRegister <= regCount);
    return S_OK;
}
HRESULT CordbRegisterSet::GetRegistersAvailable(ULONG64 *pAvailable)
{
    FAIL_IF_NEUTERED(this);
    VALIDATE_POINTER_TO_OBJECT(pAvailable, ULONG64 *);

    (*pAvailable) = SETBITULONG64( REGISTER_INSTRUCTION_POINTER );
    return S_OK;
}
HRESULT CordbRegisterSet::GetRegisters(ULONG64 mask, ULONG32 regCount,
                                       CORDB_REGISTER regBuffer[])
{ 
    FAIL_IF_NEUTERED(this);
    UINT iRegister = 0;

    VALIDATE_POINTER_TO_OBJECT_ARRAY(regBuffer, CORDB_REGISTER, regCount, true, true);
    
    if( mask &  SETBITULONG64(REGISTER_INSTRUCTION_POINTER) )
    {
        regBuffer[iRegister++] = m_rd->PC;
    }

    _ASSERTE( iRegister <= regCount );
    return S_OK;
}
Ejemplo n.º 4
0
HRESULT CordbRegisterSet::GetRegisters(ULONG64 mask, ULONG32 regCount,
                                       CORDB_REGISTER regBuffer[])
{ 
    PUBLIC_REENTRANT_API_ENTRY(this);
    FAIL_IF_NEUTERED(this);
    ATT_REQUIRE_STOPPED_MAY_FAIL(GetProcess());

    UINT iRegister = 0;

    VALIDATE_POINTER_TO_OBJECT_ARRAY(regBuffer, CORDB_REGISTER, regCount, true, true);
    
    // @ARM64TODO: floating point support

    for (int i = REGISTER_ARM64_X0;
         i <= REGISTER_ARM64_PC && iRegister < regCount;
         i++)
    {
        if (mask &  SETBITULONG64(i))
        {
            if ((i >= REGISTER_ARM64_X0) && (i <= REGISTER_ARM64_X28))
            {
                regBuffer[iRegister++] = m_rd->X[i - REGISTER_ARM64_X0];
                continue;
            }

            switch (i)
            {
            case REGISTER_ARM64_PC: 
                regBuffer[iRegister++] = m_rd->PC; break;
            case REGISTER_ARM64_SP:
                regBuffer[iRegister++] = m_rd->SP; break;
            case REGISTER_ARM64_FP:
                regBuffer[iRegister++] = m_rd->FP; break;
            case REGISTER_ARM64_LR:
                regBuffer[iRegister++] = m_rd->LR; break;
            default:
                _ASSERTE(false); break;
            }
        }
    }

    _ASSERTE (iRegister <= regCount);
    return S_OK;
}
Ejemplo n.º 5
0
HRESULT CordbRegisterSet::GetRegistersAvailable(ULONG64 *pAvailable)
{
    FAIL_IF_NEUTERED(this);
    VALIDATE_POINTER_TO_OBJECT(pAvailable, ULONG64 *);

    *pAvailable = SETBITULONG64(REGISTER_INSTRUCTION_POINTER)
                | SETBITULONG64(REGISTER_STACK_POINTER)
                | SETBITULONG64(REGISTER_ARM_R0)
                | SETBITULONG64(REGISTER_ARM_R1)
                | SETBITULONG64(REGISTER_ARM_R2)
                | SETBITULONG64(REGISTER_ARM_R3)
                | SETBITULONG64(REGISTER_ARM_R4)
                | SETBITULONG64(REGISTER_ARM_R5)
                | SETBITULONG64(REGISTER_ARM_R6)
                | SETBITULONG64(REGISTER_ARM_R7)
                | SETBITULONG64(REGISTER_ARM_R8)
                | SETBITULONG64(REGISTER_ARM_R9)
                | SETBITULONG64(REGISTER_ARM_R10)
                | SETBITULONG64(REGISTER_ARM_R11)
                | SETBITULONG64(REGISTER_ARM_R12)
                | SETBITULONG64(REGISTER_ARM_LR);

    return S_OK;
}
Ejemplo n.º 6
0
HRESULT CordbRegisterSet::GetRegistersAvailable(ULONG64* pAvailable)
{
    FAIL_IF_NEUTERED(this);
    VALIDATE_POINTER_TO_OBJECT(pAvailable, ULONG64 *);

    *pAvailable = SETBITULONG64(REGISTER_ARM64_PC)
                | SETBITULONG64(REGISTER_ARM64_SP)
                | SETBITULONG64(REGISTER_ARM64_X0)
                | SETBITULONG64(REGISTER_ARM64_X1)
                | SETBITULONG64(REGISTER_ARM64_X2)
                | SETBITULONG64(REGISTER_ARM64_X3)
                | SETBITULONG64(REGISTER_ARM64_X4)
                | SETBITULONG64(REGISTER_ARM64_X5)
                | SETBITULONG64(REGISTER_ARM64_X6)
                | SETBITULONG64(REGISTER_ARM64_X7)
                | SETBITULONG64(REGISTER_ARM64_X8)
                | SETBITULONG64(REGISTER_ARM64_X9)
                | SETBITULONG64(REGISTER_ARM64_X10)
                | SETBITULONG64(REGISTER_ARM64_X11)
                | SETBITULONG64(REGISTER_ARM64_X12)
                | SETBITULONG64(REGISTER_ARM64_X13)
                | SETBITULONG64(REGISTER_ARM64_X14)
                | SETBITULONG64(REGISTER_ARM64_X15)
                | SETBITULONG64(REGISTER_ARM64_X16)
                | SETBITULONG64(REGISTER_ARM64_X17)
                | SETBITULONG64(REGISTER_ARM64_X18)
                | SETBITULONG64(REGISTER_ARM64_X19)
                | SETBITULONG64(REGISTER_ARM64_X20)
                | SETBITULONG64(REGISTER_ARM64_X21)
                | SETBITULONG64(REGISTER_ARM64_X22)
                | SETBITULONG64(REGISTER_ARM64_X23)
                | SETBITULONG64(REGISTER_ARM64_X24)
                | SETBITULONG64(REGISTER_ARM64_X25)
                | SETBITULONG64(REGISTER_ARM64_X26)
                | SETBITULONG64(REGISTER_ARM64_X27)
                | SETBITULONG64(REGISTER_ARM64_X28)
                | SETBITULONG64(REGISTER_ARM64_FP)
                | SETBITULONG64(REGISTER_ARM64_LR);

    return S_OK;
}