From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C5D14387701E; Thu, 19 Mar 2020 13:36:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5D14387701E From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/25700] New: Forward-imported CU causes duplicate partial symtab Date: Thu, 19 Mar 2020 13:36:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2020 13:36:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25700 Bug ID: 25700 Summary: Forward-imported CU causes duplicate partial symtab Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider the executable generated for test-case gdb.dwarf2/imported-unit.ex= p. When loading the executable using various tracing: ... $ gdb \ outputs/gdb.dwarf2/imported-unit/imported-unit \ -batch \ -iex "set verbose on" \ -iex "set debug symtab-create 1"=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Reading symbols from outputs/gdb.dwarf2/imported-unit/imported-unit... Reading minimal symbols of objfile imported-unit ... Installing 30 minimal symbols of objfile imported-unit. Done reading minimal symbols. Creating one or more psymtabs for objfile imported-unit ... Created psymtab 0x2122960 for module ../sysdeps/x86_64/start.S. Created psymtab 0x21569f0 for module init.c. Created psymtab 0x213d620 for module ../sysdeps/x86_64/crti.S. Created psymtab 0x213f380 for module @0xc7. Created psymtab 0x20e7b00 for module imported_unit.c. Created psymtab 0x215da20 for module imported_unit.c. Created psymtab 0x2133630 for module elf-init.c. Created psymtab 0x215b910 for module ../sysdeps/x86_64/crtn.S. Reading in symbols for @0xc7... Created compunit symtab 0x20d6f70 for . Created compunit symtab 0x2177490 for imported_unit.c. ... we notice that there are two psymtabs generated for imported_unit.c. This seems to be related to the fact that CU imports CU imported_unit.c, and that the import is a forward reference. After reversing the order of two CUs, such that the import is a backward reference, we have instead: ... Reading symbols from outputs/gdb.dwarf2/imported-unit/imported-unit... Reading minimal symbols of objfile imported-unit ... Installing 30 minimal symbols of objfile imported-unit. Done reading minimal symbols. Creating one or more psymtabs for objfile imported-unit ... Created psymtab 0x217d410 for module ../sysdeps/x86_64/start.S. Created psymtab 0x21d84a0 for module init.c. Created psymtab 0x21419e0 for module ../sysdeps/x86_64/crti.S. Created psymtab 0x21dc190 for module imported_unit.c. Created psymtab 0x21c6fa0 for module @0x124. Created psymtab 0x2195e30 for module elf-init.c. Created psymtab 0x21c2c00 for module ../sysdeps/x86_64/crtn.S. Reading in symbols for @0x124... Created compunit symtab 0x214f0f0 for . Created compunit symtab 0x21dd6d0 for imported_unit.c. ... --=20 You are receiving this mail because: You are on the CC list for the bug.=