This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/commit/dwarf] Create partial symbols for nested subprograms


Hi Daniel,

> > 2008-09-10  Joel Brobecker  <brobecker@adacore.com>
> > 
> >         * dwarf2read.c (add_partial_subprogram): New procedure.
> >         (scan_partial_symbols): Use it.
> >         (load_partial_dies): Read in children of subprogram and lexical
> >         blocks.
> 
> :-(

Sorry! :-(.

> Not that I see any useful way around it, if subprograms really can be
> children of lexical blocks.  But it's going to cause us to read in a
> ton more DIEs, including all scopes and local variables.

Unfortunately, it is possible to define a subprogram inside a lexical
block in Ada, so we have to search lexical blocks as well...
For instance:

  procedure Foo is
  begin
     declare
        procedure Bar is [...]
     begin
        Bar;
     end;
  end Foo;

> The lexical block check won't work as is; we'd walk children of
> lexical blocks, except we'll never read one in the first place.
> See the skip_one_die call earlier in load_partial_dies.

Arg, you are absolutely right. That's another part of the change
that we forgot to contribute (we now have setup strict rules where
all our changes should be contributed very soon after we make them,
precisely to avoid this sort of mistake). While I was at it, I also
noticed that we have a comment in our code that we also forgot to
contribute and which I find informative. Added as well. Let me know
if you don't think it bring anything.

> Do you have any performance data for GDB startup with this change?

I am not sure I am doing the right kind of performance test, so if you
have some better suggestions, please let me know. For now, here is what
I did:

  . I used one of the large Ada applications we have:
    It is 290MB in size - reduced to 160MB when I strip the debugging
    info => the debugging info size is roughly 130MB.
    The number of real lines of code is 700K spread in ~3500 files,
    and it has a total of 39,000 subprograms declared in the debugging
    info.

  . To measure the startup time, I used the --statistics command-line
    switch.

Here are the times reported before I apply the patch:

        Startup time: 12.076754
        Startup time: 12.096756
        Startup time: 12.200762
        Startup time: 11.904744
        (average = 12.069754)

        Startup size: data size 132330172

Here are the same times reported after:

        Startup time: 12.600787
        Startup time: 12.640790
        Startup time: 12.432777
        Startup time: 12.628789
        (average = 12.575786)
        
        Startup size: data size 133001788 (+700KB).

It looks like roughly a 4% increase in startup time. Not sure whether
that's considered a large increase or not - I just think that it's not
noticeable. None of our users have reported issues with startup time.

But, to make sure that only languages that have this feature get hit,
I adjusted the patch to only search nested procedure when the language
allows them.

2008-09-11  Joel Brobecker  <brobecker@adacore.com>

        * dwarf2read.c (add_partial_subprogram): New procedure.
        (scan_partial_symbols): Use it.
        (load_partial_dies): Read in children of subprogram and lexical
        blocks.

Tested on x86-linux. No regression.
OK to commit?

Thanks,
-- 
Joel

Attachment: nested.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]