src/clients/zerospy_data_centric/trace.cpp
/* only valid on platforms where OPSZ_PTR != OPSZ_4 */
only valid on platforms where OPSZ_PTR != OPSZ_4
only valid on platforms where OPSZ_PTR ! = OPSZ_4
static bool
trace_buf_insert_buf_store_4bytes(void *drcontext, trace_buf_t *buf, instrlist_t *ilist,
                                instr_t *where, reg_id_t buf_ptr, reg_id_t scratch,
                                opnd_t opnd, short offset)
{
    instr_t *instr;
    if (!opnd_is_reg(opnd) && !opnd_is_immed(opnd))
        return false;
    if (opnd_is_immed(opnd)) {
#    ifdef X86_64
        instr = XINST_CREATE_store(drcontext, OPND_CREATE_MEM32(buf_ptr, offset), opnd);
#    elif defined(AARCH64)
        instrlist_insert_mov_immed_ptrsz(drcontext, opnd_get_immed_int(opnd),
                                         opnd_create_reg(scratch), ilist, where, NULL,
                                         NULL);
        instr = XINST_CREATE_store(drcontext, OPND_CREATE_MEM32(buf_ptr, offset),
                                   opnd_create_reg(scratch));
#    endif
    } else {
        instr = XINST_CREATE_store(drcontext, OPND_CREATE_MEM32(buf_ptr, offset), opnd);
    }
    INSTR_XL8(instr, instr_get_app_pc(where));
    MINSERT(ilist, where, instr);
    return true;
}
static bool trace_buf_insert_buf_store_4bytes ( void * drcontext , trace_buf_t * buf , instrlist_t * ilist , instr_t * where , reg_id_t buf_ptr , reg_id_t scratch , opnd_t opnd , short offset ) { instr_t * instr ; if ( ! opnd_is_reg ( opnd ) && ! opnd_is_immed ( opnd ) ) return false ; if ( opnd_is_immed ( opnd ) ) { #    ifdef X86_64 instr = XINST_CREATE_store ( drcontext , OPND_CREATE_MEM32 ( buf_ptr , offset ) , opnd ) ; #    elif defined ( AARCH64 ) instrlist_insert_mov_immed_ptrsz ( drcontext , opnd_get_immed_int ( opnd ) , opnd_create_reg ( scratch ) , ilist , where , NULL , NULL ) ; instr = XINST_CREATE_store ( drcontext , OPND_CREATE_MEM32 ( buf_ptr , offset ) , opnd_create_reg ( scratch ) ) ; #    endif } else { instr = XINST_CREATE_store ( drcontext , OPND_CREATE_MEM32 ( buf_ptr , offset ) , opnd ) ; } INSTR_XL8 ( instr , instr_get_app_pc ( where ) ) ; MINSERT ( ilist , where , instr ) ; return true ; }
only valid on platforms where OPSZ_PTR != OPSZ_4
only valid on platforms where OPSZ_PTR ! = OPSZ_4
/* this will certainly not fault, so don't set a translation */