This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[COMMIT] Add DW_CFA_GNU_window_save support
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Date: Sat, 26 Mar 2005 16:20:47 +0100 (CET)
- Subject: [COMMIT] Add DW_CFA_GNU_window_save support
Another step towards making the DWARF2 unwinder work on SPARC.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* dwarf2-frame.c (execute_cfa_program): Implement
DW_CFA_GNU_window_save.
Index: dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.49
diff -u -p -r1.49 dwarf2-frame.c
--- dwarf2-frame.c 25 Mar 2005 16:51:40 -0000 1.49
+++ dwarf2-frame.c 26 Mar 2005 15:18:52 -0000
@@ -445,6 +445,31 @@ bad CFI data; mismatched DW_CFA_restore_
/* 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);