From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C9EE5385F001; Thu, 5 Oct 2023 12:28:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9EE5385F001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1696508893; bh=Bwjjln9+YFFMFebJdVRbxkgQqNmeQyK89WdtnmJmVyE=; h=From:To:Subject:Date:From; b=ogPgAHqM1YIll8JcW7QDo3JfWFe1SZkaikX0cbwAu1wC9OwxCKxPIt2Y3l3ayIEmq MdjyGGccoKXnhkPvucDE7WHcyYK8u6XZy5SUsjhBiRZ5XFYMIQZ8JaNxbj4w6x2UWs tHXP0acy2zYBonj2tWHhioslrGT1VQ8ciaboBDsM= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug go/30941] New: [gdb/go] cannot find package2.Foo in expanded symtab containing go.package2.Foo Date: Thu, 05 Oct 2023 12:28:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: go 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=3D30941 Bug ID: 30941 Summary: [gdb/go] cannot find package2.Foo in expanded symtab containing go.package2.Foo Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: go Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- While investigating PR27238, I found that when not generating dwarf info: ... $ gccgo-7 ./src/gdb/testsuite/gdb.go/package2.go -c -g0 $ gccgo-7 ./src/gdb/testsuite/gdb.go/package1.go package2.o -g0 $ gdb -q -batch a.out -ex "break package2.Foo" Breakpoint 1 at 0x402563 ... the breakpoint is set just fine. When generating dwarf info: ... $ gccgo-7 ./src/gdb/testsuite/gdb.go/package2.go -c -g $ gccgo-7 ./src/gdb/testsuite/gdb.go/package1.go package2.o -g $ gdb -q -batch a.out -ex "break package2.Foo" Breakpoint 1 at 0x402563: file ./src/gdb/testsuite/gdb.go/package2.go, line= 5. ... we get line info in addition, but the dwarf is not actually used to find the function address. I only found this out during debugging, I didn't find a good way to demonst= rate it otherwise: ... (gdb) fin Run till exit from #0 find_linespec_symbols (state=3D0x7fffffffcd10,=20 file_symtabs=3Dstd::vector of length 1, capacity 1 =3D {...}, lookup_name=3D0x370a770 "package2.Foo",=20 name_match_type=3Dsymbol_name_match_type::WILD, symbols=3D0x7fffffffc980, minsyms=3D0x7fffffffc960) at /data/vries/gdb/src/gdb/linespec.c:3814 linespec_parse_basic (parser=3D0x7fffffffcce0) at linespec.c:1822 1822 if (!symbols.empty () || !minimal_symbols.empty ()) (gdb) p symbols.empty () $1 =3D true (gdb) p minimal_symbols.empty () $2 =3D false ... The expansion of the symtab seems to be happening, but the following search= in the expanded symtab fails to return anything. My guess is that package2.Foo fails to match on go.package2.Foo: ... block #000, object at 0x476a640, 2 symbols in 0x402563..0x40263f void go.package2.Foo(void); block object 0x476a4c0, 0x402563..0x40263f sec= tion .text package2; block #001, object at 0x476a5f0 under 0x476a640, 0 symbols in 0x402563..0x40263f block #002, object at 0x476a4c0 under 0x476a5f0, 0 symbols in 0x402563..0x40263f, function go.package2.Foo, go.package2.Foo ... I tried the same with -ex "break go.package2.Foo", and in that case gdb does manage to find it in the expanded symtab. --=20 You are receiving this mail because: You are on the CC list for the bug.=