Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Do not add partial_symbol again and again to the list
Date: Tue, 12 Feb 2008 01:08:00 -0000	[thread overview]
Message-ID: <47B0F16B.9090308@qnx.com> (raw)
In-Reply-To: <20080211225314.GA5832@caradoc.them.org>

Daniel Jacobowitz wrote:
> On Mon, Feb 11, 2008 at 05:43:22PM -0500, Aleksandar Ristovski wrote:
>> If one compilation unit has a list of symbols and they appear more than 
>> once... do we really need to have all duplicate records in partial symbols 
>> list? The partial symbol lookup (by symbol name) will find only the first 
>> one matching and probably cause loading the full symbols at which point 
>> all works as before.
> 
> Sure.  But your patches aren't checking one compilation unit, they're
> checking every compilation unit in the objfile at once.  That's why
> they found duplicates.  I don't think any one compilation unit will
> have a duplicate.
Then I am definitely missing something big. Please correct me where I'm wrong.

struct dwarf2_cu has a pointer to struct objfile, which (if I'm not mistaken) 
get's allocated per compilation unit.

Further, struct objfile contains pointer to struct bcache: psymbol_cache which 
gets initialized in objfile initialization (allocate_objfile function). 
Therefore, there should be exactly one psymbol_cache per objfile.

bcache_data hashes objects in psymbol_cache, that is, it will hash only partial 
symbols of that particular compilation unit.

There are two pointers to struct psymbol_allocation_list, both declared in 
struct objfile: global_psymbols and static_psymbols. Therefore, there should be 
exactly one of each per each compilation unit.

In dwarf2read.c we determine whether a symbol belongs to the global or static 
psymbol list and we pass this list along with the objfile pointer to 
add_psymbol_to_list function.

Now we get to the point where I made the change:
The first patch I submitted allows for having a psymbol listed in each list, but 
only once (as opposed to many times before). The second patch I submitted will 
prevent adding a partial symbol to both lists.

What am I missing?

> 
>> Not sure if it is a valid indicator but I didn't have any regressions in 
>> 'make check'.
> 
> Yeah, I think I could write some testcases that were affected by this,
> but I'm not sure.  It's tricky because if something else causes the
> full symtab to load, the problem won't appear.

Yes, that is the tricky part. We want lookup by symbol name to occur in order to 
test this. Maybe adding a maintenance command that would explicitly lookup a 
partial symbol by name?

> 
> Maybe there's some way we can avoid needing psymbols for types at all.
> But I think we need to have a real design and some documentation for
> it instead of just accidentally omitting them.
> 

Not sure how would that work. But I think it would make sense to have only one 
global_psymbols list.


  reply	other threads:[~2008-02-12  1:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-11 20:23 Aleksandar Ristovski
2008-02-11 20:38 ` Daniel Jacobowitz
2008-02-11 20:52   ` Aleksandar Ristovski
2008-02-11 21:09     ` Daniel Jacobowitz
2008-02-11 21:41       ` Aleksandar Ristovski
2008-02-11 21:48         ` Daniel Jacobowitz
2008-02-11 22:10           ` Aleksandar Ristovski
2008-02-11 22:31             ` Daniel Jacobowitz
2008-02-11 22:43               ` Aleksandar Ristovski
2008-02-11 22:53                 ` Daniel Jacobowitz
2008-02-12  1:08                   ` Aleksandar Ristovski [this message]
2008-02-12  2:12                     ` Daniel Jacobowitz
2008-02-12  5:35                       ` Aleksandar Ristovski
2008-02-12 13:26                         ` Daniel Jacobowitz
2008-02-12 15:54                           ` Aleksandar Ristovski
2008-02-13  5:23                   ` Aleksandar Ristovski
2008-02-14  1:31                     ` Aleksandar Ristovski
2008-05-02 18:11                       ` Aleksandar Ristovski
2008-05-03 21:32                     ` Daniel Jacobowitz
2008-05-05 19:41                       ` Aleksandar Ristovski
2008-05-05 19:38                         ` Aleksandar Ristovski
2008-05-06 15:47                         ` Daniel Jacobowitz
2008-05-06 18:45                           ` Aleksandar Ristovski
2008-05-06 18:39                             ` Aleksandar Ristovski
2008-05-06 18:50                             ` Daniel Jacobowitz
2008-05-07  8:22                               ` Aleksandar Ristovski
2008-05-07  9:01                                 ` Aleksandar Ristovski
2008-06-05 18:17                                 ` Daniel Jacobowitz
2008-06-05 19:26                                   ` Aleksandar Ristovski

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=47B0F16B.9090308@qnx.com \
    --to=aristovski@qnx.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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