Tip of the day

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


--- Vlad Dumitrescu <>
wrote:

> 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
luck)

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

Best,
Thomas


		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 



More information about the erlang-questions mailing list