From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 378303858D37; Thu, 31 Aug 2023 10:37:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 378303858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693478227; bh=BlPKvDl/qLpD40ayxn2ZAaQes9eTCG2vnOc9vsHL8o8=; h=From:To:Subject:Date:From; b=TR8qahKrJHxSGGsDxQRQCgEh8aZTHl37pU55xcF7UY9mCHG04aahSsTk77jb4W9Y6 gm0VfpV7lJFUTek/P3nQqYZG4RkVnJZUErRxtjcwdbpJzXgR/4xhKpGGFo/DTtHMLW OqfQDeYn1v2s69jbml7RfmU51MhlimbnXWOd8dFg= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/30814] New: [gdb/symtab, cc-with-dwz-m] FAIL: gdb.cp/cplusfuncs.exp: info function for "operator\*(" Date: Thu, 31 Aug 2023 10:37:06 +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: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D30814 Bug ID: 30814 Summary: [gdb/symtab, cc-with-dwz-m] FAIL: gdb.cp/cplusfuncs.exp: info function for "operator\*(" Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- With target board unix we get: ... (gdb) info function operator\*(^M All functions matching regular expression "operator\*(":^M ^M File /data/vries/gdb/src/gdb/testsuite/gdb.cp/cplusfuncs.cc:^M 72: void foo::operator*(foo&);^M ^M Non-debugging symbols:^M 0x00007ffff7c22ae0 std::filesystem::directory_iterator::operator*() const@plt^M 0x00007ffff7c23710 std::filesystem::__cxx11::directory_iterator::operator*= () const@plt^M 0x00007ffff7cf5f10 std::filesystem::__cxx11::directory_iterator::operator*= () const^M 0x00007ffff7cf5fa0=20 std::filesystem::__cxx11::recursive_directory_iterator::operator*() const^M 0x00007ffff7d0c680 std::filesystem::directory_iterator::operator*() const^M 0x00007ffff7d0c710 std::filesystem::recursive_directory_iterator::operator= *() const^M (gdb) PASS: gdb.cp/cplusfuncs.exp: info function for "operator\*(" ... but with target board cc-with-dwz-m: ... (gdb) PASS: gdb.cp/cplusfuncs.exp: print &hairyfunc7 info function operator\*(^M All functions matching regular expression "operator\*(":^M ^M File /usr/lib64/gcc/x86_64-suse-linux/7/include/stddef.h:^M 72: void foo::operator*(foo&);^M ^M Non-debugging symbols:^M 0x00007ffff7c22ae0 std::filesystem::directory_iterator::operator*() const@plt^M 0x00007ffff7c23710 std::filesystem::__cxx11::directory_iterator::operator*= () const@plt^M 0x00007ffff7cf5f10 std::filesystem::__cxx11::directory_iterator::operator*= () const^M 0x00007ffff7cf5fa0=20 std::filesystem::__cxx11::recursive_directory_iterator::operator*() const^M 0x00007ffff7d0c680 std::filesystem::directory_iterator::operator*() const^M 0x00007ffff7d0c710 std::filesystem::recursive_directory_iterator::operator= *() const^M (gdb) FAIL: gdb.cp/cplusfuncs.exp: info function for "operator\*(" ... The problem is that the operator is listed under the wrong file name. It should be listed under: ... File /data/vries/gdb/src/gdb/testsuite/gdb.cp/cplusfuncs.cc:^M ... but instead it's listed under: ... File /usr/lib64/gcc/x86_64-suse-linux/7/include/stddef.h:^M ... The DIE for the operator is: ... <2>: Abbrev Number: 25 (DW_TAG_subprogram) DW_AT_external : 1 DW_AT_name : (indirect string, offset: 0x61): operator* DW_AT_decl_file : 2 DW_AT_decl_line : 10 DW_AT_linkage_name: (indirect string, offset: 0x54c): _ZN3foomlE= RS_ DW_AT_accessibility: 1 (public) DW_AT_declaration : 1 DW_AT_object_pointer: <0xee> DW_AT_sibling : <0xf5> ... which is part of this CU: ... <0><4e>: Abbrev Number: 24 (DW_TAG_partial_unit) <4f> DW_AT_stmt_list : 0x0 ... which is part file .tmp/cplusfuncs.dwz, so the DW_AT_stmt_list 0x0 correspo= nds to this file name table: ... The File Name Table (offset 0x64): Entry Dir Time Size Name 1 1 0 0 stddef.h 2 2 0 0 cplusfuncs.cc 3 0 0 0 elf-init.c ... where selecting entry 2 gives us the correct filename. What seems to be the problem is that instead, entry 2 is picked from the fi= le name table at 0xe9: ... The File Name Table (offset 0x159): Entry Dir Time Size Name 1 1 0 0 cplusfuncs.cc 2 2 0 0 stddef.h ... which is the one corresponding to the CU that imports the PU: ... <0>: Abbrev Number: 11 (DW_TAG_compile_unit) DW_AT_name : cplusfuncs.cc DW_AT_stmt_list : 0xe9 <1>: Abbrev Number: 5 (DW_TAG_imported_unit) DW_AT_import : ... --=20 You are receiving this mail because: You are on the CC list for the bug.=