summaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-05-01 09:52:47 +0000
committerMark Kettenis <kettenis@gnu.org>2004-05-01 09:52:47 +0000
commit35f5232c3899182fabeaa919db80c91762dc5b7f (patch)
tree099827276c24d0a9c84beb5f99780af45a2ce4b8 /gdb/dwarf2-frame.c
parent7e06a7eff981ca196c2618d70c38736f8326da40 (diff)
downloadgdb-35f5232c3899182fabeaa919db80c91762dc5b7f.tar.gz
* 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.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r--gdb/dwarf2-frame.c16
1 files changed, 11 insertions, 5 deletions
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;