[llvm-dev] Initial State of the DWARF CFI register states

Keno Fischer via llvm-dev llvm-dev at lists.llvm.org
Fri Aug 26 18:28:22 PDT 2016


Hi All,

In reading the DWARF standard, it states with respect to the initial
disposition of the unwind rules for any particular register:

> The default rule for all columns before interpretation of 
> the initial instructions is the undefined rule. However,
> an ABI authoring body or a compilation system authoring body
> may specify an alternate default value for any or all columns.

Now, the first question is, do we know of such a definition
(I'm particularly interested in x86_64 here, but information on
other architecures would be appreciated as well), either in the ABI
docs or somewhere in LLVM?

Second, if I understand correctly what we're currently doing
(looking at X86FrameLowering::emitCalleeSavedFrameMoves), is
that we're looking at the callee saved registers for the current
frame and emitting cfi instructions if those get saved. That
seems sensible to me, but would imply that we're assuming that
the initial state for callee-saved registers is cfi_same_value.
That seems sensible to me, but if that's the definition, I am
worried about mixing calling conventions in the same compile
unit. Should we settle on some definition and add the extra unwind
info where we deviate (or even better add whatever definition
we settle on to initial_instructions)?

CFI clients (gdb, lldb, libunwind, etc.) seem to deviate in how they
handle this, treating it either as undefined or same_value.

Thanks,
Keno


More information about the llvm-dev mailing list