[PATCH] Fix DW_CFA_restore_extended parsing

Luis Machado luisgpm@linux.vnet.ibm.com
Thu Dec 20 20:25:00 GMT 2007


Hi folks,

There appears to be a flaw during the execution of this instruction
(DW_CFA_restore_extended). Most of the time the registers are implicitly
defined to use an "unspecified" rule due to the lack of information (or
due to space optimization strategies) in the CIE's initial instructions.

Different from DW_CFA_restore, DW_CFA_restore_extended doesn't check if
the register rule in the current dwarf frame set's list of initialized
registers is valid prior to assigning the rule to it, so it might just
grab junk and fail eventually.

This is hard to reproduce as the extended restore instruction doesn't
show up very often, and you have to be lucky to grab the "wrong" kind of
junk for the rule, leading GDB to an internal error.

This simple patch fixes the issue. Any thoughts? Ok to commit?

Best regards,
-- 
Luis Machado
Software Engineer 
IBM Linux Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dwarf-fde-parse.diff
Type: text/x-patch
Size: 1059 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20071220/d13b9bed/attachment.bin>


More information about the Gdb-patches mailing list