Hacker News new | ask | show | jobs
by millstone 1992 days ago
They don't. The whole point of TCO is to discard stack frames, which means local variables cannot be recovered. Optimize or debug, pick one.
2 comments

My recollection (without references) is that they can do some amount of guess work. They might see the stack says A->C, but can see the code of A actually calls B, so logically it must have been A->B->C at some point.

Or you can use the rr-debugger, and just return back to the exact sequence of calls, and reject the need to pick between optimization and debugging :D

Well, the point of TCO is to discard stack pressure. Discarding stack frames is just an unfortunate side effect.