public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dmitry.neverov at jetbrains dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/31295] New: Slow symbol lookup due to missing DW_AT_const_value attribute
Date: Thu, 25 Jan 2024 16:24:29 +0000	[thread overview]
Message-ID: <bug-31295-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 31295
           Summary: Slow symbol lookup due to missing DW_AT_const_value
                    attribute
           Product: gdb
           Version: 14.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: dmitry.neverov at jetbrains dot com
  Target Milestone: ---

DWARF for npos in the following program 

class wxString
{
public:
  static const size_t npos;
};

const size_t wxString::npos = (size_t) -1;

int main() {
  return 0;
}

doesn't have the DW_AT_const_value attribute:

< 2><0x000005cd>      DW_TAG_variable
                        DW_AT_name                  npos
                        DW_AT_decl_file             0x00000001
/path/to/main.cpp
                        DW_AT_decl_line             0x00000006
                        DW_AT_decl_column           0x00000017
                        DW_AT_linkage_name          _ZN8wxString4nposE
                        DW_AT_type                  <0x0000003a>
                        DW_AT_external              yes(1)
                        DW_AT_accessibility         DW_ACCESS_public
                        DW_AT_declaration           yes(1)

If the wxString is used in many CUs, listing fields of the
wxString variable will lookup the wxString::npos name, which
triggers CU expansion. But the dwarf2_add_field (read.c:11699)
doesn't create a symbol if the DW_AT_const_value is missing, so
expansion is done, but the symbol is not found. As a result all
CUs with the symbol are expanded and symbol lookup takes around a
minute on a 500Mb .so file.

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

             reply	other threads:[~2024-01-25 16:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 16:24 dmitry.neverov at jetbrains dot com [this message]
2024-01-25 18:58 ` [Bug symtab/31295] " dmitry.neverov at jetbrains dot com
2024-01-26  3:26 ` tromey at sourceware dot org
2024-01-26  5:22 ` vries at gcc dot gnu.org
2024-01-26  9:31 ` dmitry.neverov at jetbrains dot com
2024-01-26 11:41 ` ssbssa at sourceware dot org
2024-01-26 12:28 ` vries at gcc dot gnu.org
2024-01-26 13:28 ` dmitry.neverov at jetbrains dot com
2024-01-26 15:43 ` vries at gcc dot gnu.org
2024-01-27 11:09 ` sam at gentoo dot org
2024-01-28 20:23 ` tromey at sourceware dot org
2024-01-29  1:10 ` tromey at sourceware dot org
2024-02-11 17:52 ` tromey at sourceware dot org
2024-02-11 20:37 ` tromey at sourceware dot org
2024-02-11 21:15 ` tromey at sourceware dot org
2024-02-12 15:44 ` vries at gcc dot gnu.org
2024-02-12 20:28 ` tromey at sourceware dot org
2024-02-16  2:32 ` tromey at sourceware 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-31295-4717@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).