diff options
author | Frederic Riss <frederic.riss@st.com> | 2005-11-25 06:42:07 +0000 |
---|---|---|
committer | Frederic Riss <frederic.riss@st.com> | 2005-11-25 06:42:07 +0000 |
commit | 92ad9f6b57d841acf26aea784ad7f73feb2bfb99 (patch) | |
tree | fd1f303bcff8851e2ef097e56cf0091c494ead09 /gdb | |
parent | 58ad5041078a28873c32b697fc206e14a2fee5b1 (diff) | |
download | fsf-binutils-gdb-92ad9f6b57d841acf26aea784ad7f73feb2bfb99.zip fsf-binutils-gdb-92ad9f6b57d841acf26aea784ad7f73feb2bfb99.tar.gz fsf-binutils-gdb-92ad9f6b57d841acf26aea784ad7f73feb2bfb99.tar.bz2 |
* dwarf2-frame.c: (execute_cfa_program): Don't access past the
allocated dwarf2_frame_state.initial.regs.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dwarf2-frame.c | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dd8067f..de1c5c3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2005-11-25 Frederic Riss <frederic.riss@st.com> + * dwarf2-frame.c: (execute_cfa_program): Don't access past the + allocated dwarf2_frame_state.initial.regs. + +2005-11-25 Frederic Riss <frederic.riss@st.com> + * MAINTAINERS (Write After Approval): Add myself to the list. 2005-11-23 Andrew Stubbs <andrew.stubbs@st.com> diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index ef0d626..c65967f 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -294,7 +294,17 @@ execute_cfa_program (gdb_byte *insn_ptr, gdb_byte *insn_end, gdb_assert (fs->initial.reg); reg = insn & 0x3f; dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1); - fs->regs.reg[reg] = fs->initial.reg[reg]; + if (reg < fs->initial.num_regs) + fs->regs.reg[reg] = fs->initial.reg[reg]; + else + fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNSPECIFIED; + + if (fs->regs.reg[reg].how == DWARF2_FRAME_REG_UNSPECIFIED) + complaint (&symfile_complaints, _("\ +incomplete CFI data; DW_CFA_restore unspecified\n\ +register %s (#%d) at 0x%s"), + REGISTER_NAME(DWARF2_REG_TO_REGNUM(reg)), + DWARF2_REG_TO_REGNUM(reg), paddr (fs->pc)); } else { |