From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 810AC3858409; Wed, 6 Sep 2023 09:00:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 810AC3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693990813; bh=14BUxC8LBUlKm44Ks0Zp/J6LKiEuw+4CNurWquV/YNA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UlTqzfI54bE6Yk0RG5y4eEMaKNFQYZ8gfBT2ulkZUrglyfXCPhoTfBMgtKFdYLVsR 6t9PIoZopr5ST6uzE5n0OUpi85RoSs3z7B5vqM74bw9J8DSMrKcoktym1QdIYcq9yC EUJEud7aYUbhREBFuubv4r9GxuIDROR4e8+ekJrM= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/25261] [cc-with-dwz-m] FAIL: gdb.python/py-symbol.exp: print (len (gdb.lookup_static_symbols ('rr'))) Date: Wed, 06 Sep 2023 09:00:13 +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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D25261 --- Comment #4 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=3De061219f5d60= 0af5b33418553f192e0cb9fc9ca9 commit e061219f5d600af5b33418553f192e0cb9fc9ca9 Author: Tom de Vries Date: Wed Sep 6 11:00:01 2023 +0200 [gdb/symtab] Fix too many symbols in gdbpy_lookup_static_symbols When running test-case gdb.python/py-symbol.exp with target board cc-with-dwz-m, we run into: ... (gdb) python print (len (gdb.lookup_static_symbols ('rr')))^M 4^M (gdb) FAIL: gdb.python/py-symbol.exp: \ print (len (gdb.lookup_static_symbols ('rr'))) ... while with target board unix we have instead: ... (gdb) python print (len (gdb.lookup_static_symbols ('rr')))^M 2^M (gdb) PASS: gdb.python/py-symbol.exp: \ print (len (gdb.lookup_static_symbols ('rr'))) ... The problem is that the loop in gdbpy_lookup_static_symbols loops over compunits representing both CUs and PUs: ... for (compunit_symtab *cust : objfile->compunits ()) ... When doing a lookup on a PU, the user link is followed until we end up = at a CU, and the lookup is done in that CU. In other words, when doing a lookup in the loop for a PU we duplicate t= he lookup for a CU that is already handled by the loop. Fix this by skipping PUs in the loop in gdb.lookup_static_symbols. Tested on x86_64-linux. PR symtab/25261 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D25261 --=20 You are receiving this mail because: You are on the CC list for the bug.=