Beispiel #1
0
BOOL types_store_value(struct dbg_lvalue* lvalue_to, const struct dbg_lvalue* lvalue_from)
{
    LONGLONG    val;
    DWORD64     size;
    BOOL        is_signed;

    if (!types_get_info(&lvalue_to->type, TI_GET_LENGTH, &size)) return FALSE;

    if (0 == lvalue_to->type.module)
    {
        lvalue_to->cookie = DLV_TARGET;
#if defined(__x86_64__)
        lvalue_to->addr.Offset = *(DWORD64*)(lvalue_to->addr.Offset);
#else
        lvalue_to->addr.Offset = *(DWORD64*)(DWORD)(lvalue_to->addr.Offset);
#endif
    }

    if (sizeof(val) < size)
    {
        dbg_printf("Unsufficient size\n");
        return FALSE;
    }
    /* FIXME: should support floats as well */
    val = types_extract_as_longlong(lvalue_from, NULL, &is_signed);
    return be_cpu->store_integer(lvalue_to, size, is_signed, val);
}
Beispiel #2
0
/******************************************************************
 *		types_extract_as_address
 *
 *
 */
void types_extract_as_address(const struct dbg_lvalue* lvalue, ADDRESS64* addr)
{
    if (lvalue->type.id == dbg_itype_segptr && lvalue->type.module == 0)
    {
        *addr = lvalue->addr;
    }
    else
    {
        addr->Mode = AddrModeFlat;
        addr->Offset = types_extract_as_longlong(lvalue, NULL, NULL);
    }
}
Beispiel #3
0
BOOL types_store_value(struct dbg_lvalue* lvalue_to, const struct dbg_lvalue* lvalue_from)
{
    LONGLONG    val;
    DWORD64     size;
    BOOL        is_signed;

    if (!types_get_info(&lvalue_to->type, TI_GET_LENGTH, &size)) return FALSE;
    if (sizeof(val) < size)
    {
        dbg_printf("Unsufficient size\n");
        return FALSE;
    }
    /* FIXME: should support floats as well */
    val = types_extract_as_longlong(lvalue_from, NULL, &is_signed);
    return be_cpu->store_integer(lvalue_to, size, is_signed, val);
}
Beispiel #4
0
/******************************************************************
 *		types_extract_as_integer
 *
 * Given a lvalue, try to get an integral (or pointer/address) value
 * out of it
 */
long int types_extract_as_integer(const struct dbg_lvalue* lvalue)
{
    return types_extract_as_longlong(lvalue, NULL, NULL);
}