[Dwarf-Discuss] .cfi_offset questions

Cary Coutant ccoutant@gmail.com
Thu Mar 24 16:01:40 GMT 2016


> By saying that .debug_frame supports shrink wrapping, do you also mean that it supports the ?two paths join with different register state? case? Which means it?s only a matter of the .cfi_xxx directives, and if I were to build the .debug_frame/.eh_frame section by hand I would be fine?

No, I don't believe that it can in general. There's no way to express
a conditional "if p then DW_CFA_def_offset else
DW_CFA_def_same_value", for example. If a register is spilled to the
stack in both paths, but at different offsets, you could encode it
with DW_CFA_def_offset, using a DWARF expression that evaluates to
different values based on a condition, but this technique would be
limited to the case where you could use DW_CFA_def_offset for both
paths. I think this would also lead to some undesirable bulk in your
.debug_frame or .eh_frame sections. And I'm not actually sure whether
the unwinder (Which unwinder? There are several!) completely supports
DWARF expressions in that context.

-cary



More information about the Dwarf-discuss mailing list