Tip of the day

Thomas Lindgren <>
Wed Aug 18 11:37:01 CEST 2004

--- Vlad Dumitrescu <>

> From: "Thomas Lindgren" <>
> > Finally, it would also be useful if one could
> inspect
> > the stack too at exceptions, in particular to see
> the
> > source lines of the callers. Perhaps a generic
> "stack
> > walker" BIF would be handy?
> A question popped out when reading this: can the
> stack really be traversed
> when we are using tail-call optimization?Or more
> precisely, would it be
> menaingful to traverse it in the presence of
> tail-calls?

Good question. The answers I have seen are basically
the following:

- ignore the problem, the result is still useful

- have VM settings not to optimize tail calls, use
them while debugging

- "dynamic deoptimization" as done in SELF, basically,
try to reconstruct the stack after the fact (good

"Ignoring the problem" is probably the easiest one to
get going :-)


Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

More information about the erlang-questions mailing list