This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] DW_CFA_restore handling causes memory fault
- From: Jim Blandy <jimb at red-bean dot com>
- To: Frederic RISS <frederic dot riss at st dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 17 Nov 2005 11:32:09 -0800
- Subject: Re: [RFC] DW_CFA_restore handling causes memory fault
- References: <1132242850.8685.47.camel@crx549.cro.st.com>
On 11/17/05, Frederic RISS <frederic.riss@st.com> wrote:
> The current handling of DW_CFA_restore in dwarf2-frame.c doesn't check
> if the value it tries to restore has actually been allocated. This
> produces strange results (from undeterministic behavour to a GDB crash).
> The attached patch tries to fix that by following the GCC 'convention'
> that an unspecified register implies "same value".
This replicates what we would have done had that register's slot been
allocated, but its value had been left unspecified --- right?
> It's debatable wether the compiler is right to produce DW_CFA_restore
> without specifying all the registers initial state in the CIE, but
> that's another story, isn't it ?
Right; we're supposed to be prepared for mis-formed input. It would
be nice to have a brief comment explaining that the 'else' half of the
'if' does constitute questionable behavior on the part of the
compiler.