* dwarf2-frame.c (execute_cfa_program): Implement
authorMark Kettenis <kettenis@gnu.org>
Sat, 26 Mar 2005 15:20:42 +0000 (15:20 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sat, 26 Mar 2005 15:20:42 +0000 (15:20 +0000)
DW_CFA_GNU_window_save.

gdb/ChangeLog
gdb/dwarf2-frame.c

index 208430307436d32bb9f98c08b274b3d855827a7f..a7b77fce82d3539f583fa8a52a49dec14d6fb7cc 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-26  Mark Kettenis  <kettenis@gnu.org>
+
+       * dwarf2-frame.c (execute_cfa_program): Implement
+       DW_CFA_GNU_window_save.
+
 2005-03-25  Mark Kettenis  <kettenis@gnu.org>
 
        * config/sparc/nbsd64.mh (NAT_FILE): Remove.
index 7b46c78dbaaee59754e78b42b9b078f401956133..1ac18598e64d4b3eeba120956e90f74789ebb5e0 100644 (file)
@@ -445,6 +445,31 @@ bad CFI data; mismatched DW_CFA_restore_state at 0x%s"), paddr (fs->pc));
              /* cfa_how deliberately not set.  */
              break;
 
+           case DW_CFA_GNU_window_save:
+             /* This is SPARC-specific code, and contains hard-coded
+                constants for the register numbering scheme used by
+                GCC.  Rather than having a architecture-specific
+                operation that's only ever used by a single
+                architecture, we provide the implementation here.
+                Incidentally that's what GCC does too in its
+                unwinder.  */
+             {
+               struct gdbarch *gdbarch = get_frame_arch (next_frame);
+               int size = register_size(gdbarch, 0);
+               dwarf2_frame_state_alloc_regs (&fs->regs, 32);
+               for (reg = 8; reg < 16; reg++)
+                 {
+                   fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_REG;
+                   fs->regs.reg[reg].loc.reg = reg + 16;
+                 }
+               for (reg = 16; reg < 32; reg++)
+                 {
+                   fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
+                   fs->regs.reg[reg].loc.offset = (reg - 16) * size;
+                 }
+             }
+             break;
+
            case DW_CFA_GNU_args_size:
              /* Ignored.  */
              insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);