aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_util.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-02-09 17:21:28 +0100
committerBjörn Gustavsson <[email protected]>2010-03-10 14:25:21 +0100
commitc591f7b2a78b44ab321d0b99c100b349c8606c15 (patch)
tree492533e735efed799bb8ddd427594835bd41e142 /erts/emulator/beam/erl_db_util.c
parent64415f09de0691c2ccdf65df169a211b7917728b (diff)
downloadotp-c591f7b2a78b44ab321d0b99c100b349c8606c15.tar.gz
otp-c591f7b2a78b44ab321d0b99c100b349c8606c15.tar.bz2
otp-c591f7b2a78b44ab321d0b99c100b349c8606c15.zip
Make tracing and distribution work
Rewrite trace code and external coding. Also slightly correct the interface to the match-spec engine to make tracing work. That will make the test suites runnable.
Diffstat (limited to 'erts/emulator/beam/erl_db_util.c')
-rw-r--r--erts/emulator/beam/erl_db_util.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c
index f8baf44e10..165c56cbf1 100644
--- a/erts/emulator/beam/erl_db_util.c
+++ b/erts/emulator/beam/erl_db_util.c
@@ -1185,7 +1185,7 @@ Eterm erts_match_set_run(Process *p, Binary *mpsp,
Eterm ret;
ret = db_prog_match(p, mpsp,
- (Eterm) COMPRESS_POINTER(args),
+ NIL, args,
num_args, return_flags);
#if defined(HARDDEBUG)
if (is_non_value(ret)) {
@@ -1380,7 +1380,7 @@ restart:
/*
** There is one single top variable in the match expression
- ** iff the text is tho Uint's and the single instruction
+ ** iff the text is two Uint's and the single instruction
** is 'matchBind' or it is only a skip.
*/
context.special =
@@ -1591,6 +1591,7 @@ static Eterm dpm_array_to_list(Process *psp, Eterm *arr, int arity)
** i.e. 'DCOMP_TRACE' was specified
*/
Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm term,
+ Eterm *termp,
int arity,
Uint32 *return_flags)
{
@@ -1710,12 +1711,12 @@ restart:
n = *pc++;
if ((int) n != arity)
FAIL();
- ep = (Eterm *) EXPAND_POINTER(*ep);
+ ep = termp;
break;
case matchArrayBind: /* When the array size is unknown. */ /* XXX:PaN - where does
this array come from? */
n = *pc++;
- hp[n] = dpm_array_to_list(psp, (Eterm *) EXPAND_POINTER(term), arity);
+ hp[n] = dpm_array_to_list(psp, termp, arity);
break;
case matchTuple: /* *ep is a tuple of arity n */
if (!is_tuple(*ep))
@@ -2101,13 +2102,13 @@ restart:
*esp++ = am_undefined;
} else {
*esp++ = make_tuple(ehp);
- ehp[0] = make_arityval(3);
+ ehp[0] = make_arityval(3);
ehp[1] = cp[0];
ehp[2] = cp[1];
- ehp[3] = make_small((Uint) hp[2]);
- ehp += 4;
- }
- break;
+ ehp[3] = make_small((Uint) cp[2]);
+ ehp += 4;
+ }
+ break;
case matchSilent:
--esp;
if (*esp == am_true) {
@@ -4278,7 +4279,7 @@ static Eterm match_spec_test(Process *p, Eterm against, Eterm spec, int trace)
}
} else {
n = 0;
- arr = (Eterm *) EXPAND_POINTER(against);
+ arr = tuple_val(against);
}
/* We are in the context of a BIF,