Home | History | Annotate | Download | only in msandr

Lines Matching full:drcontext

177 void InstrumentMops(void *drcontext, instrlist_t *bb, instr_t *instr, opnd_t op,
192 dr_save_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_1);
193 dr_save_arith_flags_to_xax(drcontext, bb, instr);
194 dr_save_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_3);
195 dr_restore_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_1);
239 dr_save_reg(drcontext, bb, instr, R1, SPILL_SLOT_1);
241 dr_save_reg(drcontext, bb, instr, R2, SPILL_SLOT_2);
244 CHECK(drutil_insert_get_mem_addr(drcontext, bb, instr, op, R1, R2));
245 PRE(instr, mov_imm(drcontext, opnd_create_reg(R2),
247 PRE(instr, and(drcontext, opnd_create_reg(R1), opnd_create_reg(R2)));
254 mov_st(drcontext, opnd_create_base_disp(R1, DR_REG_NULL, 0, 0, op_size),
260 mov_st(drcontext, OPND_CREATE_MEM32(R1, ofs), OPND_CREATE_INT32(0)));
265 dr_restore_reg(drcontext, bb, instr, R1, SPILL_SLOT_1);
266 dr_restore_reg(drcontext, bb, instr, R2, SPILL_SLOT_2);
272 dr_save_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_1);
273 dr_restore_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_3);
274 dr_restore_arith_flags_from_xax(drcontext, bb, instr);
275 dr_restore_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_1);
282 void InstrumentReturn(void *drcontext, instrlist_t *bb, instr_t *instr) {
283 dr_save_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_1);
287 dr_insert_get_seg_base(drcontext, bb, instr, DR_SEG_FS, DR_REG_XAX);
292 mov_st(drcontext, OPND_CREATE_MEM64(DR_REG_XAX, msan_retval_tls_offset),
295 dr_restore_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_1);
301 void InstrumentIndirectBranch(void *drcontext, instrlist_t *bb,
303 dr_save_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_1);
307 dr_insert_get_seg_base(drcontext, bb, instr, DR_SEG_FS, DR_REG_XAX);
313 mov_st(drcontext, OPND_CREATE_MEMPTR(DR_REG_XAX, msan_param_tls_offset +
318 dr_restore_reg(drcontext, bb, instr, DR_REG_XAX, SPILL_SLOT_1);
381 event_basic_block_app2app(void *drcontext, void *tag, instrlist_t *bb,
386 CHECK(drutil_expand_rep_string(drcontext, bb));
391 dr_emit_flags_t event_basic_block(void *drcontext, void *tag, instrlist_t *bb,
417 instrlist_disassemble(drcontext, pc, bb, STDOUT);
427 InstrumentReturn(drcontext, bb, i);
439 InstrumentIndirectBranch(drcontext, bb, i);
463 InstrumentMops(drcontext, bb, i, op, true);
474 instrlist_disassemble(drcontext, pc, bb, STDOUT);
479 void event_module_load(void *drcontext, const module_data_t *info,
497 void event_module_unload(void *drcontext, const module_data_t *info) {
523 bool event_filter_syscall(void *drcontext, int sysnum) {
568 bool event_pre_syscall(void *drcontext, int sysnum) {
576 res = drsys_cur_syscall(drcontext, &syscall);
594 res = drsys_iterate_memargs(drcontext, drsys_iter_memarg_cb, NULL);
600 static bool IsInLoader(void *drcontext) {
604 bool need_swap = !dr_using_app_state(drcontext);
606 dr_switch_to_app_state(drcontext);
609 dr_switch_to_dr_state(drcontext);
613 void event_post_syscall(void *drcontext, int sysnum) {
619 res = drsys_cur_syscall(drcontext, &syscall);
626 res = drsys_syscall_succeeded(syscall, dr_syscall_get_result(drcontext),
632 drsys_iterate_memargs(drcontext, drsys_iter_memarg_cb, (void *)syscall);
647 if (IsInLoader(drcontext)) {
648 app_pc base = (app_pc)dr_syscall_get_result(drcontext);
650 drmf_status_t res = drsys_pre_syscall_arg(drcontext, 1, &size);
700 void *drcontext = dr_get_current_drcontext();
702 dr_switch_to_app_state(drcontext);
705 dr_switch_to_dr_state(drcontext);