Skip to content

Commit 695d5c9

Browse files
committed
Merge branch 'sverker/erts/trace-bif-session-fix/OTP-19840' into maint
2 parents 5470c1a + 3fb897a commit 695d5c9

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

erts/emulator/beam/beam_bp.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ erts_bp_init(void) {
178178

179179

180180
void
181-
erts_bp_match_functions(BpFunctions* f, ErtsCodeMFA *mfa, int specified)
181+
erts_bp_match_functions(BpFunctions* f, ErtsCodeMFA *mfa, int specified,
182+
int ignore_bifs)
182183
{
183184
ErtsCodeIndex code_ix = erts_active_code_ix();
184185
Uint max_funcs = 0;
@@ -235,6 +236,15 @@ erts_bp_match_functions(BpFunctions* f, ErtsCodeMFA *mfa, int specified)
235236
case 0:
236237
break;
237238
}
239+
240+
if (ignore_bifs) {
241+
Export *ep = erts_active_export_entry(ci->mfa.module,
242+
ci->mfa.function,
243+
ci->mfa.arity);
244+
if (ep && ep->bif_number >= 0) {
245+
continue;
246+
}
247+
}
238248
/* Store match */
239249
f->matching[i].code_info = ci;
240250
f->matching[i].mod = module[current];

erts/emulator/beam/beam_bp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void erts_commit_staged_bp(void);
136136
ERTS_GLB_INLINE ErtsBpIndex erts_active_bp_ix(void);
137137
ERTS_GLB_INLINE ErtsBpIndex erts_staging_bp_ix(void);
138138

139-
void erts_bp_match_functions(BpFunctions* f, ErtsCodeMFA *mfa, int specified);
139+
void erts_bp_match_functions(BpFunctions* f, ErtsCodeMFA *mfa, int specified, int ignore_bifs);
140140
void erts_bp_match_export(BpFunctions* f, ErtsCodeMFA *mfa, int specified);
141141
void erts_bp_free_matched_functions(BpFunctions* f);
142142

erts/emulator/beam/beam_debug.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ erts_debug_breakpoint_2(BIF_ALIST_2)
317317
ASSERT(erts_staging_trace_session == NULL);
318318
erts_staging_trace_session = &erts_trace_session_0;
319319

320-
erts_bp_match_functions(&finish_debug_bp.f, &mfa, specified);
320+
erts_bp_match_functions(&finish_debug_bp.f, &mfa, specified,
321+
1); // ignore bifs
321322

322323
ASSERT(finish_debug_bp.f.matched >= 0);
323324
ASSERT(finish_debug_bp.process == NULL);

erts/emulator/beam/erl_bif_trace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,7 @@ erts_set_trace_pattern(ErtsCodeMFA *mfa, int specified,
24222422
/*
24232423
* First do "local" code breakpoint tracing
24242424
*/
2425-
erts_bp_match_functions(&finish_bp.f, mfa, specified);
2425+
erts_bp_match_functions(&finish_bp.f, mfa, specified, 0);
24262426

24272427
if (on) {
24282428
if (! flags.breakpoint) {
@@ -2555,7 +2555,7 @@ prepare_clear_all_trace_pattern(ErtsTraceSession* session)
25552555
/*
25562556
* Clear all breakpoints in code for session
25572557
*/
2558-
erts_bp_match_functions(&finish_bp.f, NULL, 0);
2558+
erts_bp_match_functions(&finish_bp.f, NULL, 0, 0);
25592559
erts_clear_all_breaks(&finish_bp.f);
25602560

25612561
clear_event_trace(erts_staging_trace_session->send_tracing);

0 commit comments

Comments
 (0)