[LLVMdev] [cfe-dev] Unwind behaviour in Clang/LLVM
Rafael EspĂndola
rafael.espindola at gmail.com
Tue Feb 18 05:44:40 PST 2014
> * The uwtable attribute guarantees that the unwind table will be generated
> for stack unwinding for profilers, debuggers, (possibly) exception handling
> mechansim and etc. This attribute guarantees that the complete stack trace
> can be obtained as long as the calling sequence does not contain the
> external function or the function marked with no-unwind.
>
> It is possible for some exception handling implemenation requires uwtable to
> unwind the stack, it is not necessary to do so. On the other hand, even if
> the stack unwind information for exception handling is encoded in ehtable,
> it might be insufficient to implement the stack unwinder. We will come back
> with this later.
>
> If a function has both no-uwnind and uwtable, then there must be a mechanism
> (might be an agreement between the compiler and the run-time library) to
> signal the stack unwinder to stop before passing through the function.
> Otherwise, the undefined behavior might be happened. Similarly, we need a
> similar mechanism for the function with both no-throw and ehtable
I would prefer to keep uwtable with its current meaning: It is
possible to unwind past this function. That has nothing to do with
exception handling, except that some ABIs might choose to use the same
tables for unwinding when an exception is thrown.
So any combination of uwtable and another attribute still gets an
entry in .eh_table and a debugger or profiler can go past it.
Cheers,
Rafael
More information about the llvm-dev
mailing list