From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EAB9A3858D38; Thu, 25 Jan 2024 16:24:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAB9A3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706199869; bh=y7JfTX7FjLIU5FDm+maJb/jOjU5cQ1o3fWVMQMKwy1w=; h=From:To:Subject:Date:From; b=s9ldtnj4nTx2e0Yd87ZtKi3nJNnvwiJvO7lq8GGtFPepBB7bMovzWEKYPAH/KP0Pp cXf2+uJebNjWXgZgMAFjN09SOQtpZZGTegdT8doKbOVpTEZHuOTy6R+YUECi8r6W1b zQFJwe6ObIE03so4zXzT38FevRp0PmqWGfjazTcc= From: "dmitry.neverov at jetbrains dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: 14.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmitry.neverov at jetbrains dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31295 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=20 class wxString { public: static const size_t npos; }; const size_t wxString::npos =3D (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. --=20 You are receiving this mail because: You are on the CC list for the bug.=