aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bif.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-11-08 09:51:03 +0100
committerRickard Green <[email protected]>2017-01-12 15:22:26 +0100
commit04e119e22a68d686b9e8df17c0a4836c4a5b91ea (patch)
tree59c7519927a8d72a31ae2ff609bd2db5acd29d4a /erts/emulator/beam/bif.c
parent95ec5d385cfba23c770d946871c0197bf374ff3c (diff)
downloadotp-04e119e22a68d686b9e8df17c0a4836c4a5b91ea.tar.gz
otp-04e119e22a68d686b9e8df17c0a4836c4a5b91ea.tar.bz2
otp-04e119e22a68d686b9e8df17c0a4836c4a5b91ea.zip
Return and exception trace for nif-export scheduled BIFs
The support is somewhat primitive, since it is determined at call time if trace on return or exception should be sent.
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r--erts/emulator/beam/bif.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index 5f0564474f..cae346267c 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -5047,7 +5047,7 @@ schedule(Process *c_p, Process *dirty_shadow_proc,
static BIF_RETTYPE dirty_bif_result(BIF_ALIST_1)
{
NifExport *nep = (NifExport *) ERTS_PROC_GET_NIF_TRAP_EXPORT(BIF_P);
- erts_nif_export_restore(BIF_P, nep);
+ erts_nif_export_restore(BIF_P, nep, BIF_ARG_1);
BIF_RET(BIF_ARG_1);
}
@@ -5062,7 +5062,7 @@ static BIF_RETTYPE dirty_bif_trap(BIF_ALIST)
ASSERT(BIF_P->arity == nep->exp.info.mfa.arity);
- erts_nif_export_restore(BIF_P, nep);
+ erts_nif_export_restore(BIF_P, nep, THE_NON_VALUE);
BIF_P->i = (BeamInstr *) nep->func;
BIF_P->freason = TRAP;
@@ -5216,12 +5216,12 @@ call_bif(Process *c_p, Eterm *reg, BeamInstr *I)
ret = (*bif)(c_p, reg, I);
if (is_value(ret))
- erts_nif_export_restore(c_p, nep);
+ erts_nif_export_restore(c_p, nep, ret);
else if (c_p->freason != TRAP)
c_p->freason |= EXF_RESTORE_NIF; /* restore in handle_error() */
else if (nep->func == ERTS_SCHED_BIF_TRAP_MARKER) {
/* BIF did an ordinary trap... */
- erts_nif_export_restore(c_p, nep);
+ erts_nif_export_restore(c_p, nep, ret);
}
/* else:
* BIF rescheduled itself using erts_schedule_bif().