diff options
author | Björn Gustavsson <[email protected]> | 2012-02-28 05:44:26 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-06-25 14:31:19 +0200 |
commit | df41b1ab56ad0186d1233b141861fbaa794d69aa (patch) | |
tree | 499f80906400d0c3476b2c7308c810ea73aa3eba /erts/emulator/beam/beam_debug.c | |
parent | aa340f8d8a13b86f2938a4ce0b3c7d5807dec716 (diff) | |
download | otp-df41b1ab56ad0186d1233b141861fbaa794d69aa.tar.gz otp-df41b1ab56ad0186d1233b141861fbaa794d69aa.tar.bz2 otp-df41b1ab56ad0186d1233b141861fbaa794d69aa.zip |
Refactor the code for managing breakpoints
To allow us to manage breakpoints without going to single-scheduler
mode, we will need to update the breakpoints in several stages with
memory barriers in between each stage. Prepare for that by splitting
up the breakpoint setting and clearing functions into several smaller
functions.
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
-rw-r--r-- | erts/emulator/beam/beam_debug.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index e69cbc3048..8d72627b38 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -84,6 +84,7 @@ erts_debug_breakpoint_2(BIF_ALIST_2) int i; int specified = 0; Eterm res; + BpFunctions f; if (bool != am_true && bool != am_false) goto error; @@ -121,11 +122,19 @@ erts_debug_breakpoint_2(BIF_ALIST_2) erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN); erts_smp_thr_progress_block(); + erts_bp_match_functions(&f, mfa, specified); if (bool == am_true) { - res = make_small(erts_set_debug_break(mfa, specified)); + erts_set_debug_break(&f); + erts_install_breakpoints(&f); + erts_commit_staged_bp(); } else { - res = make_small(erts_clear_debug_break(mfa, specified)); + erts_clear_debug_break(&f); + erts_commit_staged_bp(); + erts_uninstall_breakpoints(&f); } + erts_consolidate_bp_data(&f); + res = make_small(f.matched); + erts_bp_free_matched_functions(&f); erts_smp_thr_progress_unblock(); erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN); |