diff options
author | Björn Gustavsson <[email protected]> | 2012-02-21 08:48:42 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-06-25 14:31:19 +0200 |
commit | aa340f8d8a13b86f2938a4ce0b3c7d5807dec716 (patch) | |
tree | 50fd1280fd85ea9ab2766d584f94739b6acbd554 /erts/emulator/beam/erl_nif.c | |
parent | 17263978bd05535251aba8ec37cbd0a6756f57f7 (diff) | |
download | otp-aa340f8d8a13b86f2938a4ce0b3c7d5807dec716.tar.gz otp-aa340f8d8a13b86f2938a4ce0b3c7d5807dec716.tar.bz2 otp-aa340f8d8a13b86f2938a4ce0b3c7d5807dec716.zip |
Change the data structures for breakpoints
Change the data structures for breakpoints to make it possible
(in a future commit) to manage breakpoints without taking down the
system to single-scheduling mode.
The current "breakpoint wheel" data structure (a circular,
double-linked list of breakpoints) was invented before the
SMP emulator. To support it in the SMP emulator, there is essentially
one breakpoint wheel per scheduler. As more breakpoint types have
been added, the implementation has become messy and hard to understand
and maintain.
Therefore, the time for a rewrite has come. Use one struct to hold
all breakpoint data for a breakpoint in a function. Use a flag field
to indicate what different type of break actions that are enabled.
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r-- | erts/emulator/beam/erl_nif.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index da4376fd0a..594c51a5db 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -1711,9 +1711,10 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2) code_ptr[5+0] = (BeamInstr) BeamOp(op_call_nif); } else { /* Function traced, patch the original instruction word */ - BpData** bps = (BpData**) code_ptr[1]; - BpData* bp = (BpData*) bps[erts_bp_sched2ix()]; - bp->orig_instr = (BeamInstr) BeamOp(op_call_nif); + GenericBp* g = (GenericBp *) code_ptr[1]; + ASSERT(code_ptr[5+0] == + (BeamInstr) BeamOp(op_i_generic_breakpoint)); + g->orig_instr = (BeamInstr) BeamOp(op_call_nif); } code_ptr[5+1] = (BeamInstr) entry->funcs[i].fptr; code_ptr[5+2] = (BeamInstr) lib; |