News for hackers. Stuff that matters.
Re:On libunwind and dynamically generated code on x86-64 by kazinator on Tuesday April 12, 2016 @11:07AM (#11480181)
In the "C ecosystem", there is no such thing as universal unwinding. Everything that needs unwinding rolls its own.

The "unwinding" that libunwind refers to is merely the restoration of the procedure state (stack pointer and callee-saved registers). It doesn't know the ad hoc schemes for cleaning up the resources associated with a frame.

So that is to say, we can't take this library into the implementation of some language, and gain the ability to unwind through the frames of a foreign library which we called (and which called back into us) for doing things like safely performing a non-local return across that library. It's not going to deal with its resources, even if that library has some sort of unwind-protect scheme.

Basically, it's hard to understand what libunwind is for; what do I gain by integrating libunwind, beyond dumping back traces? Maybe I can integrate an interactive mini-debugger into the program where you can step through frames and examine state?

There are no comments on this comment yet.