aboutsummaryrefslogtreecommitdiff
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
commit50ea776902f39c4966e4f88f14ee11da80d0cfef (patch)
tree4d2fe33df8cacc7093d69395dad1eacfceba9022 /gdb/dwarf2-frame.c
parent9a5d7be1ec7b1f210a6f69ff4ffa3c84cd293da4 (diff)
downloadgdb-50ea776902f39c4966e4f88f14ee11da80d0cfef.zip
gdb-50ea776902f39c4966e4f88f14ee11da80d0cfef.tar.gz
gdb-50ea776902f39c4966e4f88f14ee11da80d0cfef.tar.bz2
* 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 13c836e..fafc8fc 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;