From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5EA39385B835; Tue, 31 Mar 2020 10:17:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EA39385B835 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/25700] Forward-imported CU causes duplicate partial symtab Date: Tue, 31 Mar 2020 10:17:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: cvs-commit 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: Message-ID: In-Reply-To: References: 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: Tue, 31 Mar 2020 10:17:32 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25700 --- Comment #8 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D16b0db75af6b= 4b4d434aa84c74d58b7290e04143 commit 16b0db75af6b4b4d434aa84c74d58b7290e04143 Author: Tom de Vries Date: Tue Mar 31 12:17:27 2020 +0200 [gdb/testsuite] Fix c-linkage-name.exp with -flto When running test-case gdb.base/c-linkage-name.exp with target board unix/-flto/-O0/-flto-partition=3Dnone/-ffat-lto-objects, I run into: ... PASS: gdb.base/c-linkage-name.exp: maint info psymtab: c-linkage-name-2= .c: no FAIL: gdb.base/c-linkage-name.exp: print symada__cS before partial symt= ab \ expansion ... The test-case tries to print a symbol before and after symtab expansion. And it tries to ensure (since commit 13c3a74afb) that the symtab contai= ning the symbol is not yet expanded when doing the 'before' print, by placing the symbol in a different CU (c-linkage-name-2.c) from the one containing m= ain (c-linkage-name.c), such that when we load the exec and expand the symt= ab containing main, the symtab containing the symbol isn't. The generated debug info for the test-case when using mentioned target board however is structured like this: ... <0>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_name : <1>: Abbrev Number: 2 (DW_TAG_imported_unit) DW_AT_import : <0x16b> [Abbrev Number: 1] <1>: Abbrev Number: 2 (DW_TAG_imported_unit) DW_AT_import : <0x19c> [Abbrev Number: 1] <1>: Abbrev Number: 3 (DW_TAG_subprogram) DW_AT_abstract_origin: <0x17d> <1><115>: Abbrev Number: 4 (DW_TAG_variable) <116> DW_AT_abstract_origin: <0x1ce> <0><16b>: Abbrev Number: 1 (DW_TAG_compile_unit) <171> DW_AT_name : c-linkage-name.c <1><17d>: Abbrev Number: 2 (DW_TAG_subprogram) <17e> DW_AT_name : main <0><19c>: Abbrev Number: 1 (DW_TAG_compile_unit) <1a2> DW_AT_name : c-linkage-name-2.c <1><1ce>: Abbrev Number: 5 (DW_TAG_variable) <1cf> DW_AT_name : mundane <1d6> DW_AT_linkage_name: symada__cS ... So, the CU named contains both the concrete main and the concrete symbol, which explains the FAIL. The first test should fail, but passes for two reasons. First of all, due to PR symtab/25700, we have two regular partial symta= bs c-linkage-name-2.c instead of one, and one of them is expanded, the oth= er one not: ... { psymtab c-linkage-name-2.c ((struct partial_symtab *) 0x38d6f60) readin yes { psymtab c-linkage-name-2.c ((struct partial_symtab *) 0x38d6fe0) readin no ... And then there's the include symtab, which is also not expanded: ... { psymtab c-linkage-name-2.c ((struct partial_symtab *) 0x38143e0) readin no ... Fix the FAIL by explicitly setting the language before load, changing t= he language setting from auto/c to manual/c, such that the symtab containi= ng main is no longer expanded. And make the symtab expansion testing more robust by using the output of "maint info symtabs" instead of "maint info psymtabs". Tested on x86_64-linux, using native and target boards cc-with-gdb-index.exp, cc-with-debug-names.exp, readnow.exp and unix/-flto/-O0/-flto-partition=3Dnone/-ffat-lto-objects. gdb/testsuite/ChangeLog: 2020-03-31 Tom de Vries * gdb.base/c-linkage-name.exp: Fix test-case comment. Set lang= uage to c. Use "maint info symtabs" to check symtab expansion. --=20 You are receiving this mail because: You are on the CC list for the bug.=