public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/31295] New: Slow symbol lookup due to missing DW_AT_const_value attribute
@ 2024-01-25 16:24 dmitry.neverov at jetbrains dot com
  2024-01-25 18:58 ` [Bug symtab/31295] " dmitry.neverov at jetbrains dot com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: dmitry.neverov at jetbrains dot com @ 2024-01-25 16:24 UTC (permalink / raw)
  To: gdb-prs

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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-02-16  2:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 16:24 [Bug symtab/31295] New: Slow symbol lookup due to missing DW_AT_const_value attribute dmitry.neverov at jetbrains dot com
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

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).