[Dwarf-Discuss] Possible ambiguity with DW_CFA_remember_state/store_state

Cary Coutant ccoutant at gmail.com
Fri Jun 12 16:07:42 PDT 2009

In the description of DW_CFA_remember_state, the DWARF3 spec says this:

>   The DW_CFA_remember_state instruction takes no operands. The required action is to push
>   the set of rules for every register onto an implicit stack.

I can't find any text that explicitly says that "every register" is
intended to include the virtual CFA register itself, but the
description of the abstract CFI table in Section 6.4.1 subtly implies
it by including CFA as one of the columns along with all the
explicitly-numbered registers:

>   Abstractly, this mechanism describes a very large table that has the following structure:
>   LOC CFA R0 R1 ... RN
>   L0
>   L1
>   ...
>   LN

Unfortunately, these operators were interpreted one way for gcc (save
the CFA along with all the other registers), and the other way for gdb
(save only the explicitly-numbered registers, but not the CFA). This
has caused a regression in the gdb testsuite with a fairly recent
patch to gcc mainline, and a patch is being submitted to fix gdb based
on my interpretation that CFA ought to be saved.

Does anyone disagree with this interpretation? Should we fix gcc instead?


More information about the Dwarf-Discuss mailing list