summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/beam_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
-rw-r--r--erts/emulator/beam/beam_debug.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c
index 5b7e2a9414..3819de701f 100644
--- a/erts/emulator/beam/beam_debug.c
+++ b/erts/emulator/beam/beam_debug.c
@@ -165,10 +165,11 @@ erts_debug_breakpoint_2(BIF_ALIST_2)
mfa.arity = signed_val(tp[3]);
}
- if (!erts_try_seize_code_write_permission(BIF_P)) {
+ if (!erts_try_seize_code_mod_permission(BIF_P)) {
ERTS_BIF_YIELD2(BIF_TRAP_EXPORT(BIF_erts_debug_breakpoint_2),
BIF_P, BIF_ARG_1, BIF_ARG_2);
}
+
erts_proc_unlock(p, ERTS_PROC_LOCK_MAIN);
erts_thr_progress_block();
@@ -182,13 +183,17 @@ erts_debug_breakpoint_2(BIF_ALIST_2)
erts_commit_staged_bp();
erts_uninstall_breakpoints(&f);
}
- erts_consolidate_bp_data(&f, 1);
+ erts_consolidate_local_bp_data(&f);
res = make_small(f.matched);
erts_bp_free_matched_functions(&f);
+ erts_blocking_code_barrier();
+
erts_thr_progress_unblock();
erts_proc_lock(p, ERTS_PROC_LOCK_MAIN);
- erts_release_code_write_permission();
+
+ erts_release_code_mod_permission();
+
return res;
error:
@@ -682,7 +687,7 @@ print_op(fmtfn_t to, void *to_arg, int op, int size, BeamInstr* addr)
case 'F': /* Function definition */
{
ErlFunEntry* fe = (ErlFunEntry *) *ap;
- const ErtsCodeMFA *cmfa = erts_get_fun_mfa(fe);
+ const ErtsCodeMFA *cmfa = erts_get_fun_mfa(fe, erts_active_code_ix());
erts_print(to, to_arg, "fun(`%T`:`%T`/%bpu)", cmfa->module,
cmfa->function, cmfa->arity);
ap++;