static int set_module_break(Module *modp, Eterm mfa[3], int specified, Binary *match_spec, Uint break_op, enum erts_break_op count_op, Eterm tracer_pid) { Uint** code_base; Uint* code_ptr; int num_processed = 0; Uint i,n; ASSERT(break_op); ASSERT(modp); code_base = (Uint **) modp->code; if (code_base == NULL) { return 0; } n = (Uint) code_base[MI_NUM_FUNCTIONS]; for (i = 0; i < n; ++i) { code_ptr = code_base[MI_FUNCTIONS+i]; ASSERT(code_ptr[0] == (Uint) BeamOp(op_i_func_info_IaaI)); if ((specified < 2 || mfa[1] == ((Eterm) code_ptr[3])) && (specified < 3 || ((int) mfa[2]) == ((int) code_ptr[4]))) { Uint *pc = code_ptr+5; num_processed += set_function_break(modp, pc, match_spec, break_op, count_op, tracer_pid); } } return num_processed; }
void erts_set_time_trace_bif(BeamInstr *pc, enum erts_break_op count_op) { set_function_break(pc, NULL, ERTS_BPF_TIME_TRACE|ERTS_BPF_TIME_TRACE_ACTIVE, count_op, erts_tracer_nil); }
void erts_set_call_trace_bif(BeamInstr *pc, Binary *match_spec, int local) { Uint flags = local ? ERTS_BPF_LOCAL_TRACE : ERTS_BPF_GLOBAL_TRACE; set_function_break(pc, match_spec, flags, 0, erts_tracer_nil); }
void erts_set_time_trace_bif(ErtsCodeInfo *ci, enum erts_break_op count_op) { set_function_break(ci, NULL, ERTS_BPF_TIME_TRACE|ERTS_BPF_TIME_TRACE_ACTIVE, count_op, erts_tracer_nil); }
void erts_set_call_trace_bif(ErtsCodeInfo *ci, Binary *match_spec, int local) { Uint flags = local ? ERTS_BPF_LOCAL_TRACE : ERTS_BPF_GLOBAL_TRACE; set_function_break(ci, match_spec, flags, 0, erts_tracer_nil); }
void erts_set_mtrace_bif(BeamInstr *pc, Binary *match_spec, ErtsTracer tracer) { set_function_break(pc, match_spec, ERTS_BPF_META_TRACE, 0, tracer); }
void erts_set_time_trace_bif(BeamInstr *pc, enum erts_break_op count_op) { set_function_break(NULL, pc, BREAK_IS_BIF, NULL, (BeamInstr) BeamOp(op_i_time_breakpoint), count_op, NIL); }
void erts_set_mtrace_bif(BeamInstr *pc, Binary *match_spec, Eterm tracer_pid) { ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking()); set_function_break(NULL, pc, BREAK_IS_BIF, match_spec, (BeamInstr) BeamOp(op_i_mtrace_breakpoint), 0, tracer_pid); }
void erts_set_mtrace_bif(ErtsCodeInfo *ci, Binary *match_spec, ErtsTracer tracer) { set_function_break(ci, match_spec, ERTS_BPF_META_TRACE, 0, tracer); }