Reading signal handler frame in AIX
[deliverable/binutils-gdb.git] / gdb / dwarf2-frame.c
index 58f1ba4f2fc71df74a29f3c60f7e03d876fe9c8a..2201c636590da55d9871241c430995be700212f2 100644 (file)
@@ -204,14 +204,13 @@ dwarf2_restore_rule (struct gdbarch *gdbarch, ULONGEST reg_num,
 {
   ULONGEST reg;
 
-  gdb_assert (fs->initial.reg);
   reg = dwarf2_frame_adjust_regnum (gdbarch, reg_num, eh_frame_p);
   fs->regs.alloc_regs (reg + 1);
 
   /* Check if this register was explicitly initialized in the
   CIE initial instructions.  If not, default the rule to
   UNSPECIFIED.  */
-  if (reg < fs->initial.num_regs)
+  if (reg < fs->initial.reg.size ())
     fs->regs.reg[reg] = fs->initial.reg[reg];
   else
     fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNSPECIFIED;
@@ -284,6 +283,11 @@ class dwarf_expr_executor : public dwarf_expr_context
     invalid ("DW_OP_call*");
   }
 
+  struct value *dwarf_variable_value (sect_offset sect_off) override
+  {
+    invalid ("DW_OP_GNU_variable_value");
+  }
+
   CORE_ADDR get_addr_index (unsigned int index) override
   {
     invalid ("DW_OP_GNU_addr_index");
@@ -597,7 +601,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
        }
     }
 
-  if (fs->initial.reg == NULL)
+  if (fs->initial.reg.empty ())
     {
       /* Don't allow remember/restore between CIE and FDE programs.  */
       delete fs->regs.prev;
@@ -648,12 +652,12 @@ execute_cfa_program_test (struct gdbarch *gdbarch)
   auto r1 = dwarf2_frame_adjust_regnum (gdbarch, 1, fde.eh_frame_p);
   auto r2 = dwarf2_frame_adjust_regnum (gdbarch, 2, fde.eh_frame_p);
 
-  SELF_CHECK (fs.regs.num_regs == (std::max (r1, r2) + 1));
+  SELF_CHECK (fs.regs.reg.size () == (std::max (r1, r2) + 1));
 
   SELF_CHECK (fs.regs.reg[r2].how == DWARF2_FRAME_REG_SAVED_OFFSET);
   SELF_CHECK (fs.regs.reg[r2].loc.offset == -4);
 
-  for (auto i = 0; i < fs.regs.num_regs; i++)
+  for (auto i = 0; i < fs.regs.reg.size (); i++)
     if (i != r2)
       SELF_CHECK (fs.regs.reg[i].how == DWARF2_FRAME_REG_UNSPECIFIED);
 
@@ -968,8 +972,7 @@ static struct dwarf2_frame_cache *
 dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  const int num_regs = gdbarch_num_regs (gdbarch)
-                      + gdbarch_num_pseudo_regs (gdbarch);
+  const int num_regs = gdbarch_num_cooked_regs (gdbarch);
   struct dwarf2_frame_cache *cache;
   struct dwarf2_fde *fde;
   CORE_ADDR entry_pc;
@@ -1092,7 +1095,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
   {
     int column;                /* CFI speak for "register number".  */
 
-    for (column = 0; column < fs.regs.num_regs; column++)
+    for (column = 0; column < fs.regs.reg.size (); column++)
       {
        /* Use the GDB register number as the destination index.  */
        int regnum = dwarf_reg_to_regnum (gdbarch, column);
@@ -1135,8 +1138,9 @@ incomplete CFI data; unspecified registers (e.g., %s) at %s"),
        if (cache->reg[regnum].how == DWARF2_FRAME_REG_RA
            || cache->reg[regnum].how == DWARF2_FRAME_REG_RA_OFFSET)
          {
-           struct dwarf2_frame_state_reg *retaddr_reg =
-             &fs.regs.reg[fs.retaddr_column];
+           const std::vector<struct dwarf2_frame_state_reg> &regs
+             = fs.regs.reg;
+           ULONGEST retaddr_column = fs.retaddr_column;
 
            /* It seems rather bizarre to specify an "empty" column as
                the return adress column.  However, this is exactly
@@ -1145,14 +1149,14 @@ incomplete CFI data; unspecified registers (e.g., %s) at %s"),
                register corresponding to the return address column.
                Incidentally, that's how we should treat a return
                address column specifying "same value" too.  */
-           if (fs.retaddr_column < fs.regs.num_regs
-               && retaddr_reg->how != DWARF2_FRAME_REG_UNSPECIFIED
-               && retaddr_reg->how != DWARF2_FRAME_REG_SAME_VALUE)
+           if (fs.retaddr_column < fs.regs.reg.size ()
+               && regs[retaddr_column].how != DWARF2_FRAME_REG_UNSPECIFIED
+               && regs[retaddr_column].how != DWARF2_FRAME_REG_SAME_VALUE)
              {
                if (cache->reg[regnum].how == DWARF2_FRAME_REG_RA)
-                 cache->reg[regnum] = *retaddr_reg;
+                 cache->reg[regnum] = regs[retaddr_column];
                else
-                 cache->retaddr_reg = *retaddr_reg;
+                 cache->retaddr_reg = regs[retaddr_column];
              }
            else
              {
@@ -1171,7 +1175,7 @@ incomplete CFI data; unspecified registers (e.g., %s) at %s"),
       }
   }
 
-  if (fs.retaddr_column < fs.regs.num_regs
+  if (fs.retaddr_column < fs.regs.reg.size ()
       && fs.regs.reg[fs.retaddr_column].how == DWARF2_FRAME_REG_UNDEFINED)
     cache->undefined_retaddr = 1;
 
@@ -1938,12 +1942,12 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
       cie->saw_z_augmentation = (*augmentation == 'z');
       if (cie->saw_z_augmentation)
        {
-         uint64_t length;
+         uint64_t uleb_length;
 
-         buf = gdb_read_uleb128 (buf, end, &length);
+         buf = gdb_read_uleb128 (buf, end, &uleb_length);
          if (buf == NULL)
            return NULL;
-         cie->initial_instructions = buf + length;
+         cie->initial_instructions = buf + uleb_length;
          augmentation++;
        }
 
@@ -2056,12 +2060,12 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
         can skip the whole thing.  */
       if (fde->cie->saw_z_augmentation)
        {
-         uint64_t length;
+         uint64_t uleb_length;
 
-         buf = gdb_read_uleb128 (buf, end, &length);
+         buf = gdb_read_uleb128 (buf, end, &uleb_length);
          if (buf == NULL)
            return NULL;
-         buf += length;
+         buf += uleb_length;
          if (buf > end)
            return NULL;
        }
This page took 0.028421 seconds and 4 git commands to generate.