diff options
author | Björn Gustavsson <[email protected]> | 2011-02-16 06:54:15 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-08-16 08:58:50 +0200 |
commit | be04820c070d01d7565b936fa14efc2941055e0b (patch) | |
tree | 059e5070b9597c0320e4f9c58ddeb24c30aa9e66 /erts/emulator/beam/beam_emu.c | |
parent | 87e639bef1cbe37f63fcd376ec17dc8fca77fe3f (diff) | |
download | otp-be04820c070d01d7565b936fa14efc2941055e0b.tar.gz otp-be04820c070d01d7565b936fa14efc2941055e0b.tar.bz2 otp-be04820c070d01d7565b936fa14efc2941055e0b.zip |
emulator: Add a fourth element in exception stacktraces
This commit is a preparation for introducing location information
(filename/line number) in stacktraces in exceptions. Currently
a stack trace looks like:
[{Mod1,Function1,Arity1},
.
.
.
{ModN,FunctionN,ArityN}]
Add a forth element to each tuple that can be used indication
the filename and line number of the source file:
[{Mod1,Function1,Arity1,Location1},
.
.
.
{ModN,FunctionN,ArityN,LocationN}]
In this commit, the fourth element will just be an empty list,
and we will change all code that look at or manipulate stacktraces.
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r-- | erts/emulator/beam/beam_emu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index ef992487be..0bd5e27843 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -5948,18 +5948,18 @@ build_stacktrace(Process* c_p, Eterm exc) { { int i; Eterm mfa; - Uint heap_size = 6*(depth+1); + Uint heap_size = 7*(depth+1); Eterm* hp = HAlloc(c_p, heap_size); Eterm* hp_end = hp + heap_size; if (args != am_true) { /* We have an arglist - use it */ - mfa = TUPLE3(hp, current[0], current[1], args); + mfa = TUPLE4(hp, current[0], current[1], args, NIL); } else { Eterm arity = make_small(current[2]); - mfa = TUPLE3(hp, current[0], current[1], arity); + mfa = TUPLE4(hp, current[0], current[1], arity, NIL); } - hp += 4; + hp += 5; ASSERT(*next_p == NIL); *next_p = CONS(hp, mfa, NIL); next_p = &CDR(list_val(*next_p)); @@ -5971,8 +5971,8 @@ build_stacktrace(Process* c_p, Eterm exc) { for (i = 0; i < depth; i++) { BeamInstr *fi = find_function_from_pc((BeamInstr *) s->trace[i]); if (fi == NULL) continue; - mfa = TUPLE3(hp, fi[0], fi[1], make_small(fi[2])); - hp += 4; + mfa = TUPLE4(hp, fi[0], fi[1], make_small(fi[2]), NIL); + hp += 5; ASSERT(*next_p == NIL); *next_p = CONS(hp, mfa, NIL); next_p = &CDR(list_val(*next_p)); |