2013-06-09 Sandra Loosemore <sandra@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / dwarf2-frame.c
index 986aaea2335e59f3fded32c487e337495c4cc014..5c88b039ae09cc6d8e617ef2b0ce7ff3d684e3b7 100644 (file)
@@ -1,6 +1,6 @@
 /* Frame unwinder for frames with DWARF Call Frame Information.
 
-   Copyright (C) 2003-2005, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
 
    Contributed by Mark Kettenis.
 
@@ -141,7 +141,7 @@ struct comp_unit
   struct objfile *objfile;
 
   /* Pointer to the .debug_frame section loaded into memory.  */
-  gdb_byte *dwarf_frame_buffer;
+  const gdb_byte *dwarf_frame_buffer;
 
   /* Length of the loaded .debug_frame section.  */
   bfd_size_type dwarf_frame_size;
@@ -410,7 +410,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
                     CORE_ADDR pc, struct dwarf2_frame_state *fs)
 {
   int eh_frame_p = fde->eh_frame_p;
-  int bytes_read;
+  unsigned int bytes_read;
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   while (insn_ptr < insn_end && fs->pc <= pc)
@@ -672,8 +672,8 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
            case DW_CFA_GNU_negative_offset_extended:
              insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
              reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
-             insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &offset);
-             offset *= fs->data_align;
+             insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
+             offset = utmp * fs->data_align;
              dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
              fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
              fs->regs.reg[reg].loc.offset = -offset;
@@ -888,8 +888,6 @@ dwarf2_compile_cfa_to_ax (struct agent_expr *expr, struct axs_value *loc,
                          CORE_ADDR pc,
                          struct dwarf2_per_cu_data *data)
 {
-  const int num_regs = gdbarch_num_regs (gdbarch)
-                      + gdbarch_num_pseudo_regs (gdbarch);
   struct dwarf2_fde *fde;
   CORE_ADDR text_offset;
   struct dwarf2_frame_state fs;
@@ -1065,7 +1063,8 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
 
   /* First decode all the insns in the CIE.  */
   execute_cfa_program (fde, fde->cie->initial_instructions,
-                      fde->cie->end, gdbarch, get_frame_pc (this_frame), fs);
+                      fde->cie->end, gdbarch,
+                      get_frame_address_in_block (this_frame), fs);
 
   /* Save the initialized register set.  */
   fs->initial = fs->regs;
@@ -1090,7 +1089,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
 
   /* Then decode the insns in the FDE up to our target PC.  */
   execute_cfa_program (fde, instr, fde->end, gdbarch,
-                      get_frame_pc (this_frame), fs);
+                      get_frame_address_in_block (this_frame), fs);
 
   TRY_CATCH (ex, RETURN_MASK_ERROR)
     {
@@ -1804,11 +1803,7 @@ add_fde (struct dwarf2_fde_table *fde_table, struct dwarf2_fde *fde)
   fde_table->entries[fde_table->num_entries - 1] = fde;
 }
 
-#ifdef CC_HAS_LONG_LONG
 #define DW64_CIE_ID 0xffffffffffffffffULL
-#else
-#define DW64_CIE_ID ~0
-#endif
 
 /* Defines the type of eh_frames that are expected to be decoded: CIE, FDE
    or any of them.  */
This page took 0.024837 seconds and 4 git commands to generate.