From: Doug Evans <dje@google.com>
To: Paul_Koning@dell.com
Cc: sivachandra@google.com, gdb-patches@sourceware.org
Subject: Re: [RFC - Python Scripting] New method Objfile.symtabs () - docs included
Date: Thu, 05 Apr 2012 20:26:00 -0000 [thread overview]
Message-ID: <CADPb22QhVip8xafOSPffWch-FUp+aY6J6+Ak-oyxQX01zAZadQ@mail.gmail.com> (raw)
In-Reply-To: <09787EF419216C41A903FD14EE5506DD0313D5C22C@AUSX7MCPC103.AMER.DELL.COM>
On Thu, Apr 5, 2012 at 12:56 PM, <Paul_Koning@dell.com> wrote:
> In this patch, you have an iterator that walks over the symtabs for an objfile, but that is only used internally in the symtabs() method which is written to return a list.
>
> How about having symtabs() return the iterator instead? An iterator is usually just as good as a list (and more efficient); in the rare cases where you actually need the list, simply doing list(objfile.symtabs()) will do that.
There is a lower fundamental problem that needs to be addressed.
In a nutshell: If "list (objfile.symtabs())" can increase gdb's memory
usage by gigabytes, then it's a non-starter (IMO).
Before we provide anything along these lines, we need to fix the
underlying problem.
I can think of a simple(quick) solution: create the symtab object when
the psymtab object is created (suitably modified to clean up anything
obvious), but not expand it. [btw, Psymtabs at the moment aren't as
much of an implementation detail as we want them to be (IMO).] It's
not perfect: Depending on what you want from the symtab you may
ultimately end up expanding everything anyway. But it's a step. One
way to go would be to build into gdb the ability to discard the
expansion say when memory gets tight. I think there's room for
improvement before we get to that though.
next prev parent reply other threads:[~2012-04-05 20:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 6:17 Siva Chandra
2012-04-02 17:08 ` Eli Zaretskii
2012-04-03 0:04 ` Doug Evans
2012-04-03 5:54 ` Siva Chandra
2012-04-05 16:30 ` Paul_Koning
2012-04-05 18:41 ` Tom Tromey
2012-04-05 18:37 ` Tom Tromey
2012-04-05 19:56 ` Paul_Koning
2012-04-05 20:26 ` Doug Evans [this message]
2012-04-06 16:42 ` Siva Chandra
2012-04-09 17:56 ` Tom Tromey
2012-04-09 17:59 ` Doug Evans
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=CADPb22QhVip8xafOSPffWch-FUp+aY6J6+Ak-oyxQX01zAZadQ@mail.gmail.com \
--to=dje@google.com \
--cc=Paul_Koning@dell.com \
--cc=gdb-patches@sourceware.org \
--cc=sivachandra@google.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