2007-12-20 Luis Machado * dwarf2-frame.c (execute_cfa_program): Check if a register's rule is explicitly defined in the CIE before assignment, else force the default rule. Index: gdb/dwarf2-frame.c =================================================================== --- gdb.orig/dwarf2-frame.c 2007-10-21 12:33:37.000000000 -0700 +++ gdb/dwarf2-frame.c 2007-12-20 11:19:56.000000000 -0800 @@ -382,7 +382,14 @@ insn_ptr = read_uleb128 (insn_ptr, insn_end, ®); reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p); dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1); - fs->regs.reg[reg] = fs->initial.reg[reg]; + + /* 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) + fs->regs.reg[reg] = fs->initial.reg[reg]; + else + fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNSPECIFIED; break; case DW_CFA_undefined: