News for hackers. Stuff that matters.
Re:How Tail Call Optimization Works by millstone on Friday January 08, 2021 @02:23AM (#25682428)
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.
Re:How Tail Call Optimization Works by manwe150 on Friday January 08, 2021 @02:44AM (#25682541)
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

Re:How Tail Call Optimization Works by eyelidlessness on Friday January 08, 2021 @02:42AM (#25682529)
Well, the point of TCO is to discard stack pressure. Discarding stack frames is just an unfortunate side effect.