From: Mark Kettenis Date: Sat, 1 May 2004 09:52:47 +0000 (+0000) Subject: * dwarf2-frame.c (execute_cfa_program): Complain if we encounter a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50ea776902f39c4966e4f88f14ee11da80d0cfef;p=binutils-gdb.git * dwarf2-frame.c (execute_cfa_program): Complain if we encounter a DW_CFA_restore state without a matching DW_CFA_remember_state instead of aborting. Fixes PR backtrace/1589. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3adcd0d07a4..937b6f3f0ff 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-05-01 Mark Kettenis + + * dwarf2-frame.c (execute_cfa_program): Complain if we encounter a + DW_CFA_restore state without a matching DW_CFA_remember_state + instead of aborting. Fixes PR backtrace/1589. + 2004-04-30 Joel Brobecker * MAINTAINERS: Add self as AIX maintainer. diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 13c836e7dc4..fafc8fc6574 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -372,11 +372,17 @@ execute_cfa_program (unsigned char *insn_ptr, unsigned char *insn_end, { struct dwarf2_frame_state_reg_info *old_rs = fs->regs.prev; - gdb_assert (old_rs); - - xfree (fs->regs.reg); - fs->regs = *old_rs; - xfree (old_rs); + if (old_rs == NULL) + { + complaint (&symfile_complaints, "\ +bad CFI data; mismatched DW_CFA_restore_state at 0x%s", paddr (fs->pc)); + } + else + { + xfree (fs->regs.reg); + fs->regs = *old_rs; + xfree (old_rs); + } } break;