This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Force DW_CFA_def_cfa after DW_CFA_def_cfa_expression if no longer indirect


> GCC as producer seems to assume the offset in that case is something
> get_cfa_from_loc_descr computes from the location expression (if
> there is DW_OP_plus_uconst after deref, then it is the offset),
> apparently e.g. libgcc unwinder assumes in that case offset is inherited
> from DW_CFA_def_cfa or DW_CFA_def_cfa_offset{,_sf} valid before
> the DW_CFA_def_cfa_expression.

What remains unclear to me is whether the old code in fact only ever
produces this pattern in ways that are correct given that assumption about
the consumer processing behavior, or might ever have produced actually
wrong calculations.  That is, when the old code decides to emit
DW_CFA_def_cfa_offset or DW_CFA_def_cfa_offset_sf, is the old_cfa.reg (with
old_cfa.indirect=1) always the correct register for the new offset?  And,
when the old code decides to emit DW_CFA_def_cfa_register, is
old_cfa.offset (with old_cfa.indirect=1) always the correct offset for the
new register?

> The following patch just forces DW_CFA_def_cfa so it is obvious what
> register and offset are in effect.

Everyone agrees that is valid and well-specified DWARF.  The current
behavior at least one person on the DWARF committee asserts is invalid
DWARF.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]