/* Get return address register for frame.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006, 2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
Dwarf_Frame *fs;
bool *signalp;
{
- *signalp = fs->cie->signal_frame;
- return fs->cie->return_address_register;
+ *signalp = fs->fde->cie->signal_frame;
+ return fs->fde->cie->return_address_register;
}
{
struct dwarf_cie *cie = arg;
- free (cie->initial_state);
+ free ((Dwarf_Frame *) cie->initial_state);
free (cie);
}
#define CFI_PRIMARY_MAX 0x3f
static Dwarf_Frame *
-duplicate_frame_state (Dwarf_Frame *original,
+duplicate_frame_state (const Dwarf_Frame *original,
Dwarf_Frame *prev)
{
size_t size = offsetof (Dwarf_Frame, regs[original->nregs]);
/* Now we have the initial state of things that all
FDEs using this CIE will start from. */
cie_fs->cache = cache;
- cie_fs->cie = fde->cie;
fde->cie->initial_state = cie_fs;
}
if (unlikely (fs == NULL))
return DWARF_E_NOMEM;
+ fs->fde = fde;
+
int result = execute_cfi (cache, fde->cie, &fs,
fde->instructions, fde->instructions_end, false,
fde->start, address);
const uint8_t *initial_instructions;
const uint8_t *initial_instructions_end;
- Dwarf_Frame *initial_state;
+ const Dwarf_Frame *initial_state;
uint8_t fde_encoding; /* DW_EH_PE_* for addresses in FDEs. */
uint8_t lsda_encoding; /* DW_EH_PE_* for LSDA in FDE augmentation. */
{
Dwarf_CFI *cache;
+ /* Previous state saved by DW_CFA_remember_state, or .cie->initial_state,
+ or NULL in an initial_state pseudo-frame. */
Dwarf_Frame *prev;
- /* The CIE we got this FDE from.
- This has the return_address_register and signal_frame flag. */
- struct dwarf_cie *cie;
+ /* The FDE that generated this frame state. This points to its CIE,
+ which has the return_address_register and signal_frame flag. */
+ struct dwarf_fde *fde;
/* The CFA is unknown, is R+N, or is computed by a DWARF expression. */
enum { cfa_undefined, cfa_offset, cfa_expr } cfa_rule;