public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/23710] gdb is slow and memory hungry consuming debug generated with LTO by GCC
Date: Tue, 17 Mar 2020 07:56:45 +0000	[thread overview]
Message-ID: <bug-23710-4717-gGybdzQGkg@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-23710-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=23710

--- Comment #13 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=589902954da0d1dd140b33e578954746c9bfc374

commit 589902954da0d1dd140b33e578954746c9bfc374
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Mar 17 08:56:36 2020 +0100

    [gdb] Skip imports of c++ CUs

    The DWARF standard appendix E.1 describes techniques that can be used for
    compression and deduplication: DIEs can be factored out into a new
compilation
    unit, and referenced using DW_FORM_ref_addr.

    Such a new compilation unit can either use a DW_TAG_compile_unit or
    DW_TAG_partial_unit.  If a DW_TAG_compile_unit is used, its contents is
    evaluated by consumers as though it were an ordinary compilation unit.  If
a
    DW_TAG_partial_unit is used, it's only considered by consumers in the
context
    of a DW_TAG_imported_unit.

    An example of when DW_TAG_partial_unit is required is when the factored out
    DIEs are not top-level, f.i. because they were children of a namespace.  In
    such a case the corresponding DW_TAG_imported_unit will occur as child of
the
    namespace.

    In the case of factoring out DIEs from c++ compilation units, we can factor
    out into a new DW_TAG_compile_unit, and no DW_TAG_imported_unit is
required.

    This begs the question how to interpret a top-level DW_TAG_imported_unit of
a
    c++ DW_TAG_compile_unit compilation unit.  The semantics of
    DW_TAG_imported_unit describe that the imported unit logically appears at
the
    point of the DW_TAG_imported_unit entry.  But it's not clear what the
effect
    should be in this case, since all the imported DIEs are already globally
    visible anyway, due to the use of DW_TAG_compile_unit.

    So, skip top-level imports of c++ DW_TAG_compile_unit compilation units in
    process_imported_unit_die.

    Using the cc1 binary from PR23710 comment 1 and setting a breakpoint on
do_rpo_vn:
    ...
    $ gdb \
        -batch \
        -iex "maint set dwarf max-cache-age 316" \
        -iex "set language c++" \
        -ex "b do_rpo_vn" \
        cc1
    ...
    we get a 8.1% reduction in execution time, due to reducing the number of
    partial symtabs expanded into full symtabs from 212 to 175.

    Build and reg-tested on x86_64-linux.

    gdb/ChangeLog:

    2020-03-17  Tom de Vries  <tdevries@suse.de>

            PR gdb/23710
            * dwarf2/read.h (struct dwarf2_per_cu_data): Add unit_type and lang
            fields.
            * dwarf2/read.c (process_psymtab_comp_unit): Initialize unit_type
and lang
            fields.
            (process_imported_unit_die): Skip import of c++ CUs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-03-17  7:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-23710-4717@http.sourceware.org/bugzilla/>
2020-03-08 11:09 ` vries at gcc dot gnu.org
2020-03-08 13:14 ` jan.kratochvil at redhat dot com
2020-03-17  7:56 ` cvs-commit at gcc dot gnu.org [this message]
2020-03-20  9:06 ` vries at gcc dot gnu.org
2020-04-02 12:39 ` vries at gcc dot gnu.org
2020-07-15  9:43 ` rdiezmail-binutils at yahoo dot de
2020-07-16 12:51 ` rdiezmail-binutils at yahoo dot de
2020-11-24 11:03 ` rdiezmail-binutils at yahoo dot de
2021-03-09 19:08 ` hi-angel at yandex dot ru
2021-04-07  7:25 ` rdiezmail-binutils at yahoo dot de
2021-05-31 12:14 ` vries at gcc dot gnu.org
2021-06-10 18:35 ` tromey at sourceware dot org
2021-06-10 22:59 ` vries at gcc dot gnu.org
2021-06-11 15:02 ` tromey at sourceware dot org
2021-06-22 13:24 ` vries at gcc dot gnu.org
2022-06-17 19:06 ` jsm28 at gcc dot gnu.org
2022-06-17 19:12 ` dpmendenhall at gmail dot com
2022-06-18 18:13 ` tromey at sourceware dot org
2022-06-20  6:59 ` rguenth at gcc dot gnu.org
2023-01-18 13:47 ` fabian@ritter-vogt.de
2023-01-19  2:25 ` sam at gentoo dot org

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=bug-23710-4717-gGybdzQGkg@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).