From: Tom Tromey <tromey@redhat.com>
To: Vladimir Simonov <sv@sw.ru>
Cc: gdb-patches@sourceware.org
Subject: Re: gdb: Incorrect stack unwinding if compressed debug info is used
Date: Fri, 04 Feb 2011 16:34:00 -0000 [thread overview]
Message-ID: <m3y65vahdf.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4D46D872.6080407@sw.ru> (Vladimir Simonov's message of "Mon, 31 Jan 2011 18:42:42 +0300")
>>>>> "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?
I didn't audit the other uses of .size (yet) to see if this problem
occurs elsewhere.
Tom
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6a98d57..e1657b6 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -14361,6 +14361,13 @@ static void
dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
struct dwarf2_cu *cu)
{
+ 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)
/* ".debug_loc" may not exist at all, or the offset may be outside
the section. If so, fall through to the complaint in the
next prev parent reply other threads:[~2011-02-04 16:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1296238472.3009.ezmlm@sourceware.org>
2011-01-31 16:57 ` Vladimir Simonov
2011-02-02 19:55 ` Paul Pluzhnikov
2011-02-03 16:51 ` Vladimir Simonov
2011-02-04 16:35 ` Tom Tromey
2011-02-04 16:34 ` Tom Tromey [this message]
2011-02-04 17:47 ` Vladimir Simonov
2011-02-04 17:56 ` Tom Tromey
2011-02-04 18:43 ` Vladimir Simonov
2011-02-04 20:31 ` Tom Tromey
2011-02-05 13:53 ` Vladimir Simonov
2011-02-07 15:00 ` Tom Tromey
2011-02-01 7:34 ` gdb: Incorrect stack unwinding if debug info is compressed Vladimir Simonov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3y65vahdf.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=sv@sw.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox