aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2009-06-30 16:22:59 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2009-06-30 16:22:59 +0000
commit2fd481e1eabba97b05cb5dbd458b2687798f872f (patch)
tree63f8b27aac33cda0692a1ea690dc5597240cb874 /gdb/dwarf2-frame.c
parentc38f313db7f8010841c0436444b6bde74004a3a3 (diff)
downloadgdb-2fd481e1eabba97b05cb5dbd458b2687798f872f.zip
gdb-2fd481e1eabba97b05cb5dbd458b2687798f872f.tar.gz
gdb-2fd481e1eabba97b05cb5dbd458b2687798f872f.tar.bz2
ChangeLog:
2009-06-30 Paul Pluzhnikov <ppluzhnikov@google.com> gdb/10275 * dwarf2-frame.c (dwarf2_frame_state): Move cfa_offset, cfa_reg, cfa_how and cfa_exp into regs and adjust users. testsuite/ChangeLog: 2009-06-30 Paul Pluzhnikov <ppluzhnikov@google.com> gdb/10275 * gdb.dwarf2/dw2-restore.{S,exp}: New test.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r--gdb/dwarf2-frame.c67
1 files changed, 35 insertions, 32 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 67265f2..315d349 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -164,19 +164,19 @@ struct dwarf2_frame_state
struct dwarf2_frame_state_reg *reg;
int num_regs;
+ LONGEST cfa_offset;
+ ULONGEST cfa_reg;
+ enum {
+ CFA_UNSET,
+ CFA_REG_OFFSET,
+ CFA_EXP
+ } cfa_how;
+ gdb_byte *cfa_exp;
+
/* Used to implement DW_CFA_remember_state. */
struct dwarf2_frame_state_reg_info *prev;
} regs;
- LONGEST cfa_offset;
- ULONGEST cfa_reg;
- gdb_byte *cfa_exp;
- enum {
- CFA_UNSET,
- CFA_REG_OFFSET,
- CFA_EXP
- } cfa_how;
-
/* The PC described by the current frame state. */
CORE_ADDR pc;
@@ -502,21 +502,22 @@ bad CFI data; mismatched DW_CFA_restore_state at 0x%s"), paddr (fs->pc));
break;
case DW_CFA_def_cfa:
- insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
+ insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->regs.cfa_reg);
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
if (fs->armcc_cfa_offsets_sf)
utmp *= fs->data_align;
- fs->cfa_offset = utmp;
- fs->cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_offset = utmp;
+ fs->regs.cfa_how = CFA_REG_OFFSET;
break;
case DW_CFA_def_cfa_register:
- insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
- fs->cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, fs->cfa_reg,
- eh_frame_p);
- fs->cfa_how = CFA_REG_OFFSET;
+ insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->regs.cfa_reg);
+ fs->regs.cfa_reg = dwarf2_frame_adjust_regnum (gdbarch,
+ fs->regs.cfa_reg,
+ eh_frame_p);
+ fs->regs.cfa_how = CFA_REG_OFFSET;
break;
case DW_CFA_def_cfa_offset:
@@ -525,7 +526,7 @@ bad CFI data; mismatched DW_CFA_restore_state at 0x%s"), paddr (fs->pc));
if (fs->armcc_cfa_offsets_sf)
utmp *= fs->data_align;
- fs->cfa_offset = utmp;
+ fs->regs.cfa_offset = utmp;
/* cfa_how deliberately not set. */
break;
@@ -533,10 +534,11 @@ bad CFI data; mismatched DW_CFA_restore_state at 0x%s"), paddr (fs->pc));
break;
case DW_CFA_def_cfa_expression:
- insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_exp_len);
- fs->cfa_exp = insn_ptr;
- fs->cfa_how = CFA_EXP;
- insn_ptr += fs->cfa_exp_len;
+ insn_ptr = read_uleb128 (insn_ptr, insn_end,
+ &fs->regs.cfa_exp_len);
+ fs->regs.cfa_exp = insn_ptr;
+ fs->regs.cfa_how = CFA_EXP;
+ insn_ptr += fs->regs.cfa_exp_len;
break;
case DW_CFA_expression:
@@ -589,17 +591,18 @@ bad CFI data; mismatched DW_CFA_restore_state at 0x%s"), paddr (fs->pc));
break;
case DW_CFA_def_cfa_sf:
- insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
- fs->cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, fs->cfa_reg,
- eh_frame_p);
+ insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->regs.cfa_reg);
+ fs->regs.cfa_reg = dwarf2_frame_adjust_regnum (gdbarch,
+ fs->regs.cfa_reg,
+ eh_frame_p);
insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
- fs->cfa_offset = offset * fs->data_align;
- fs->cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_offset = offset * fs->data_align;
+ fs->regs.cfa_how = CFA_REG_OFFSET;
break;
case DW_CFA_def_cfa_offset_sf:
insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
- fs->cfa_offset = offset * fs->data_align;
+ fs->regs.cfa_offset = offset * fs->data_align;
/* cfa_how deliberately not set. */
break;
@@ -932,19 +935,19 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
execute_cfa_program (fde, fde->instructions, fde->end, this_frame, fs);
/* Calculate the CFA. */
- switch (fs->cfa_how)
+ switch (fs->regs.cfa_how)
{
case CFA_REG_OFFSET:
- cache->cfa = read_reg (this_frame, fs->cfa_reg);
+ cache->cfa = read_reg (this_frame, fs->regs.cfa_reg);
if (fs->armcc_cfa_offsets_reversed)
- cache->cfa -= fs->cfa_offset;
+ cache->cfa -= fs->regs.cfa_offset;
else
- cache->cfa += fs->cfa_offset;
+ cache->cfa += fs->regs.cfa_offset;
break;
case CFA_EXP:
cache->cfa =
- execute_stack_op (fs->cfa_exp, fs->cfa_exp_len,
+ execute_stack_op (fs->regs.cfa_exp, fs->regs.cfa_exp_len,
cache->addr_size, this_frame, 0);
break;