Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH][gdb] Fix missing symtab includes
Date: Tue, 14 Apr 2020 15:31:55 +0200	[thread overview]
Message-ID: <7e769d78-bd5e-c43f-99e3-d37cd42a44c2@suse.de> (raw)
In-Reply-To: <93eaa135-a031-e3cf-9fd5-293b3fc437fe@suse.de>

On 30-03-2020 19:42, Tom de Vries wrote:
> On 29-03-2020 23:44, Simon Marchi wrote:
>> On 2020-03-29 11:56 a.m., Tom de Vries wrote:
>>> diff --git a/gdb/psympriv.h b/gdb/psympriv.h
>>> index 0effedc4ec..4317392149 100644
>>> --- a/gdb/psympriv.h
>>> +++ b/gdb/psympriv.h
>>> @@ -124,16 +124,26 @@ struct partial_symtab
>>>    {
>>>    }
>>>  
>>> -  /* Read the full symbol table corresponding to this partial symbol
>>> -     table.  */
>>> +  /* Psymtab expansion is done in two steps:
>>> +     - a call to read_symtab
>>> +     - while that call is in progress, calls to expand_psymtab can be made,
>>> +       both for this psymtab, and its dependencies.
>>> +     This makes a distinction between a toplevel psymtab (for which both
>>> +     read_symtab and expand_psymtab will be called) and a non-toplevel
>>> +     psymtab (for which only expand_psymtab will be called). The
>>> +     distinction can be used f.i. to do things before and after all
>>> +     dependencies of a top-level psymtab have been expanded.
>>> +
>>> +     Read the full symbol table corresponding to this partial symbol
>>> +     table.  Typically calls expand_psymtab.  */
>>>    virtual void read_symtab (struct objfile *) = 0;
>>>  
>>> -  /* Psymtab expansion is done in two steps.  The first step is a call
>>> -     to read_symtab; but while that is in progress, calls to
>>> -     expand_psymtab can be made.  */
>>> +  /* Expand the full symbol table for this partial symbol table.  Typically
>>> +     calls read_dependencies.  */
>>>    virtual void expand_psymtab (struct objfile *) = 0;
>>>  
>>> -  /* Ensure that all the dependencies are read in.  */
>>> +  /* Ensure that all the dependencies are read in.  Typically calls
>>> +     expand_psymtab for each dependency.  */
>>>    void read_dependencies (struct objfile *);
>>
>> I don't think the "Typically" here is right.  This is not a virtual function that can
>> be implemented/overriden by sub-classes, it's a helper that sub-classes call, that calls
>> expand_psymtab on all dependencies.
> 
> Ack, comment updated accordingly.
> 
>>  As you probably saw, I renamed it to
>> expand_dependencies to be more accurate (since it calls expand, not read).
>>
> 
> Ack, patch rebased.
> 
>> But otherwise, I am starting to think that it's the right thing to to, to call read_symtab
>> on the includer (top-level psymtab) in dwarf2_include_psymtab::read_symtab.  To read in
>> an include psymtab, we read in the includer.
>>
>> Following this, I also came to the conclusion that dwarf2_include_psymtab::m_readin should
>> probably be removed.  An include psymtab can't be read in on its own.  It can be considered
>> read in when its includer is read in.  So it doesn't make sense to maintain a "read in" state
>> separate from its includer.
>>
> 
> That makes sense to me.
> 
>> Here's the version I came up with, if you want to get inspiration.
>>
> 
> I've integrated it into my patch and re-tested.
> 
> Also, added test-case.

And committed.

Thanks,
- Tom


  reply	other threads:[~2020-04-14 13:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 20:49 Tom de Vries
2020-03-28 16:32 ` Simon Marchi
2020-03-28 17:24   ` Tom de Vries
2020-03-29 15:39     ` Simon Marchi
2020-03-29 15:56       ` Tom de Vries
2020-03-29 21:44         ` Simon Marchi
2020-03-30 17:42           ` Tom de Vries
2020-04-14 13:31             ` Tom de Vries [this message]
2020-03-28 19:08 ` Tom Tromey

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=7e769d78-bd5e-c43f-99e3-d37cd42a44c2@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tom@tromey.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