* dwarf2-frame.h (enum dwarf2_frame_reg_rule): Add
authorAlexandre Oliva <aoliva@redhat.com>
Sun, 28 May 2006 05:56:50 +0000 (05:56 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sun, 28 May 2006 05:56:50 +0000 (05:56 +0000)
DWARF2_FRAME_REG_SAVED_VAL_OFFSET and
DWARF2_FRAME_REG_SAVED_VAL_EXP.
* dwarf2-frame.c (execute_cfa_program): Handle val_offset,
val_offset_sf and val_expression.
(dwarf2_frame_prev_register): Handle the new reg rules.
(dwarf2_frame_this_id): Use pc instead of function entry point.

gdb/ChangeLog
gdb/dwarf2-frame.c
gdb/dwarf2-frame.h

index d1fbeb6b7cfdfc55bf570eb0f0d5fffbb63bf47f..f96c664c796b316edb75fbbd0da7c4be3f1cc859 100644 (file)
@@ -1,3 +1,13 @@
+2006-05-28  Alexandre Oliva  <aoliva@redhat.com>
+
+       * dwarf2-frame.h (enum dwarf2_frame_reg_rule): Add
+       DWARF2_FRAME_REG_SAVED_VAL_OFFSET and
+       DWARF2_FRAME_REG_SAVED_VAL_EXP.
+       * dwarf2-frame.c (execute_cfa_program): Handle val_offset,
+       val_offset_sf and val_expression.
+       (dwarf2_frame_prev_register): Handle the new reg rules.
+       (dwarf2_frame_this_id): Use pc instead of function entry point.
+
 2006-05-28  Alexandre Oliva  <aoliva@redhat.com>
 
        * dwarf2-frame.c (struct dwarf2_cie): Add signal_frame field.
index 6b81dff7999e29fc4072020c4d733048f8a597a8..edd9a7536ae3b48d728221974f85ef49f250b430 100644 (file)
@@ -481,6 +481,34 @@ bad CFI data; mismatched DW_CFA_restore_state at 0x%s"), paddr (fs->pc));
              fs->regs.reg[reg].loc.offset = offset;
              break;
 
+           case DW_CFA_val_offset:
+             insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
+             dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
+             insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
+             offset = utmp * fs->data_align;
+             fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_VAL_OFFSET;
+             fs->regs.reg[reg].loc.offset = offset;
+             break;
+
+           case DW_CFA_val_offset_sf:
+             insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
+             dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
+             insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
+             offset *= fs->data_align;
+             fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_VAL_OFFSET;
+             fs->regs.reg[reg].loc.offset = offset;
+             break;
+
+           case DW_CFA_val_expression:
+             insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
+             dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
+             insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
+             fs->regs.reg[reg].loc.exp = insn_ptr;
+             fs->regs.reg[reg].exp_len = utmp;
+             fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_VAL_EXP;
+             insn_ptr += utmp;
+             break;
+
            case DW_CFA_def_cfa_sf:
              insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
              if (eh_frame_p)
@@ -965,6 +993,28 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
        }
       break;
 
+    case DWARF2_FRAME_REG_SAVED_VAL_OFFSET:
+      *optimizedp = 0;
+      *lvalp = not_lval;
+      *addrp = 0;
+      *realnump = -1;
+      if (valuep)
+       store_unsigned_integer (valuep, register_size (gdbarch, regnum),
+                               cache->cfa + cache->reg[regnum].loc.offset);
+      break;
+
+    case DWARF2_FRAME_REG_SAVED_VAL_EXP:
+      *optimizedp = 0;
+      *lvalp = not_lval;
+      *addrp = 0;
+      *realnump = -1;
+      if (valuep)
+       store_unsigned_integer (valuep, register_size (gdbarch, regnum),
+                               execute_stack_op (cache->reg[regnum].loc.exp,
+                                                 cache->reg[regnum].exp_len,
+                                                 next_frame, cache->cfa));
+      break;
+
     case DWARF2_FRAME_REG_UNSPECIFIED:
       /* GCC, in its infinite wisdom decided to not provide unwind
         information for registers that are "same value".  Since
index da9fe4788f1d616acfaa2fa919481596e96aa5da..15f456d75752fee337d1a42d3f1839d3e5c1f390 100644 (file)
@@ -51,6 +51,10 @@ enum dwarf2_frame_reg_rule
   DWARF2_FRAME_REG_SAVED_EXP,
   DWARF2_FRAME_REG_SAME_VALUE,
 
+  /* These are defined in Dwarf3.  */
+  DWARF2_FRAME_REG_SAVED_VAL_OFFSET,
+  DWARF2_FRAME_REG_SAVED_VAL_EXP,
+
   /* These aren't defined by the DWARF2 CFI specification, but are
      used internally by GDB.  */
   DWARF2_FRAME_REG_RA,         /* Return Address.  */