This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: gdb: Incorrect stack unwinding if compressed debug info is used
- From: Vladimir Simonov <sv at sw dot ru>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 04 Feb 2011 20:32:42 +0300
- Subject: Re: gdb: Incorrect stack unwinding if compressed debug info is used
- References: <1296238472.3009.ezmlm@sourceware.org> <4D46D872.6080407@sw.ru> <m3y65vahdf.fsf@fleche.redhat.com>
On 02/04/2011 07:34 PM, Tom Tromey wrote:
"Vladimir" == Vladimir Simonov<sv@sw.ru> writes:
Vladimir> I've spend some time and, looks like, found the problem. It is in
Vladimir> dwarf2_symbol_mark_computed function (dwarf2read.c). Check
Vladimir> "DW_UNSND (attr)< dwarf2_per_objfile->loc.size"
Vladimir> is incorrect if compressed section is used.
Thanks for finding this.
Since fill_in_loclist_baton is going to read the loc section right away
anyhow, it seems to me that it is simpler to just have
dwarf2_symbol_mark_computed do it.
Could you try the appended?
All is OK with it.
I'd also suggest to remove dwarf2_read_section from
fill_in_loclist_baton. Without it all works ok also.
But resulted code looks a bit hackish:
dwarf2_symbol_mark_computed (...)
{
if (attr_form_is_section_offset (attr))
/* We need to read the section before we can check its size,
because the size is only valid once the section is
uncompressed. */
dwarf2_read_section (dwarf2_per_objfile->objfile,
&dwarf2_per_objfile->loc);
if (attr_form_is_section_offset (attr)
........
&& DW_UNSND (attr)< dwarf2_per_objfile->loc.size)
)
{
....
fill_in_loclist_baton /* which uses results of dwarf2_read_section */
....
}
...
Regards
Vladimir