From: Joel Brobecker <brobecker@gnat.com>
To: Eli Zaretskii <eliz@elta.co.il>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC/dwarf-2] Add support for included files
Date: Sat, 03 Jan 2004 17:47:00 -0000 [thread overview]
Message-ID: <20040103174726.GA820@gnat.com> (raw)
In-Reply-To: <1659-Sat03Jan2004183031+0200-eliz@elta.co.il>
> I made that suggestion because it sounded like the addition you made
> caused some percepted slow-down of the psymtab scan. If that is not
> true, consider my reservations to be withdrawn.
My original message probably wasn't clear. My concern was not exactly
about performance, but rather code duplication. Currently, the task
of scanning the symbols in the .debug_info data to build the psymtabs
is simplified by following the DW_AT_sibling attribute. This attribute
is not guaranteed to be always generated when convenient for the debugger,
but it helps when it is there.
In the .debug_line data, there are no such links. You really have
to read byte after byte to interpret the data, and the number of
bytes to read depends on the instruction. If you screw up at some
point, you will end up slightly off and will therefore necessarily
screw up the rest of the program (or you even fail to interpret it).
My prototype patch almost duplicates a piece of code that's not really
that complex, but the real problem is that it doesn't know how to
recover from an error. I was trying to describe this issue for which
I didn't see any simple solution, except doing some surgery in the
function we currently have that reads that data and stores it into
the full symtab.
Hmmm, maybe the best approach to mitigate my concerns would be
to actually make dwarf_decode_lines() a bit more general. Right
now, its purpose is limited to storing the data it read directly into
the appropriate symtabs. Modifying it to allow the us to build both
symtabs but also psymtabs would make it possible to share this code.
Hmmm, could I even keep it as it is? The only parts that tie this
function to symtab building seem to only be from using start_subfile()
and record_line() from buildsym.c. So maybe we can reuse this function
directly as is: it would build subfiles, and then we could dig out the
necessary information from there to build the psymtabs? I even believe
we could save these subfiles in the private part of the "main" psymtab
so we don't have to rescan these tables again during the psymtab to
symtab conversion?
Sounds like a good idea, doesn't it? Before I start experimenting,
does anybody know buildsym.c enough to tell me if it would be ok to
use the functions above outside of the context of building symtabs,
and then to save the subfiles chain for later use during the psymtab
to symtab conversion?
Thanks,
--
Joel
next prev parent reply other threads:[~2004-01-03 17:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-02 7:25 Joel Brobecker
2004-01-02 14:18 ` Daniel Jacobowitz
2004-01-03 14:42 ` Joel Brobecker
2004-01-03 16:34 ` Eli Zaretskii
2004-01-03 17:47 ` Joel Brobecker [this message]
2004-01-02 14:45 ` Eli Zaretskii
2004-01-05 16:18 ` Andrew Cagney
2004-01-05 19:17 ` Joel Brobecker
2004-04-07 16:05 Jim Blandy
2004-04-13 5:20 ` Joel Brobecker
2004-04-14 19:10 ` Jim Blandy
2004-04-15 22:13 ` Joel Brobecker
2004-04-16 4:24 ` Jim Blandy
2004-04-16 4:28 ` Joel Brobecker
2004-04-16 23:08 ` Joel Brobecker
2004-04-29 23:32 ` Jim Blandy
2004-05-01 1:14 ` Joel Brobecker
2004-05-01 4:57 ` Jim Blandy
2004-05-03 16:25 ` Joel Brobecker
2004-05-03 22:15 Andrew Pinski
2004-05-04 0:15 ` Joel Brobecker
2004-05-04 0:18 ` Andrew Pinski
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=20040103174726.GA820@gnat.com \
--to=brobecker@gnat.com \
--cc=eliz@elta.co.il \
--cc=gdb-patches@sources.redhat.com \
/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