From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 99321385770A; Thu, 5 Oct 2023 21:22:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99321385770A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1696540937; bh=U9wH9BAnWIprBzQbEm6tJCOFceVYaqHln13+JlYXdEY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=h46mdVq1zRDyjw2MMX8VyyTbhQ9gFqBFVpwZrtdTlEddNInXdiW2j2e1FVirFQVwf 5DELkqhXZyzRYoKkjwFhNDcBxKZQZJ1SWr3rh8tJct+v0ckRRz2ocKsWZ89HdNoktG XOulhm/YRLdhVBNRwGEIEzwZ6DwozO9Ke2MVV89Q= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug go/27238] [gcc-11] FAIL: gdb.go/package.exp: setting breakpoint at package2.Foo Date: Thu, 05 Oct 2023 21:22:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: 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=3D27238 --- Comment #15 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=3D3f577261903d= 4558451b005bbfee03fcdbb1d570 commit 3f577261903d4558451b005bbfee03fcdbb1d570 Author: Tom de Vries Date: Thu Oct 5 23:22:11 2023 +0200 [gdb/go] Handle v3 go_0 mangled prefix With gcc-10 we have: ... (gdb) break package2.Foo^M Breakpoint 2 at 0x402563: file package2.go, line 5.^M (gdb) PASS: gdb.go/package.exp: setting breakpoint 1 ... but with gcc-11: ... gdb) break package2.Foo^M Function "package2.Foo" not defined.^M Make breakpoint pending on future shared library load? (y or [n]) n^M (gdb) FAIL: gdb.go/package.exp: gdb_breakpoint: set breakpoint at package2.Foo ... In the gcc-10 case, though the exec contains dwarf, it's not used to set the breakpoint (which is an independent problem, filed as PR go/30941), ins= tead the minimal symbol information is used. The minimal symbol information changed between gcc-10 and gcc-11: ... $ nm a.out.10 | grep Foo 000000000040370d T go.package2.Foo 0000000000404e50 R go.package2.Foo..f $ nm a.out.11 | grep Foo 0000000000403857 T go_0package2.Foo 0000000000405030 R go_0package2.Foo..f ... A new v3 mangling scheme was used. The mangling schemes define a separ= ator character and mangling character: - for v2, dot is used both as separator character and mangling characte= r, and - for v3, dot is used as separator character and underscore as mangling character. For more details, see [1] and [2]. In v3, "_0" demangles to ".". [ See gcc commit a01dda3c23b ("compiler, libgo: change mangling scheme"), function Special_char_code::Special_char_code= . ] Handle the new go_0 prefix in unpack_mangled_go_symbol, which fixes the test-case. Note that this doesn't fix this regression: ... $ gccgo-10 package2.go -c -g0 $ gccgo-10 package1.go package2.o -g0 $ gdb -q -batch a.out -ex "break go.package2.Foo" Breakpoint 1 at 0x40370d $ gccgo-11 package2.go -c -g0 $ gccgo-11 package1.go package2.o -g0 $ gdb -q -batch a.out -ex "break go.package2.Foo" Function "go.package2.Foo" not defined. ... With gcc-10, we set a breakpoint on the mangled minimal symbol. That one has simply changed for gcc-11, so it's equivalent to using: ... $ gdb -q -batch a.out -ex "break go_0package2.Foo" Breakpoint 1 at 0x403857 ... which does work. Tested on x86_64-linux: - openSUSE Leap 15.4, using gccgo-7, - openSUSE Tumbleweed, using gccgo-13. PR go/27238 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D27238 [1] https://go-review.googlesource.com/c/gofrontend/+/271726 [2] https://github.com/golang/go/issues/41862#issuecomment-707244103 --=20 You are receiving this mail because: You are on the CC list for the bug.=