From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2FA6F3836E5F; Tue, 31 May 2022 20:53:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FA6F3836E5F From: "dblaikie at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/29215] New: Can't find nested type under strange circumstances (outer namespace or unrelated code built without debug info) Date: Tue, 31 May 2022 20:53:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dblaikie at gmail 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 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 May 2022 20:53:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29215 Bug ID: 29215 Summary: Can't find nested type under strange circumstances (outer namespace or unrelated code built without debug info) Product: gdb Version: 10.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ Assignee: unassigned at sourceware dot org Reporter: dblaikie at gmail dot com Target Milestone: --- a.cpp: ``` void f1(); int main() { f1(); } ``` b.cpp: ``` namespace x { struct t1 { t1(); struct t2 { t2(); }; }; } x::t1::t1() { } x::t1::t2::t2() { } void f1() { } ``` Build the first without debug info, and the second with debug info and pubnames/gdb-index: ``` $ clang++ -c a.cpp $ clang++ -c b.cpp -g -ggnu-pubnames -Wl,--gdb-index $ clang++ a.o b.o -fuse-ld=3Dlld=20 $ gdb -ex "ptype x::t1::t2" -ex "ptype x::t1" -ex quit a.out No type "t1" within class or namespace "x". type =3D struct x::t1 { ... ``` But if you add `-g -ggnu-pubnames` to a.cpp, or if you remove the namespace, the name lookups do seem to work. (reproduces with GCC-built DWARF too) --=20 You are receiving this mail because: You are on the CC list for the bug.=