)]}'
{
  "commit": "3f577261903d4558451b005bbfee03fcdbb1d570",
  "tree": "e8b05dac3d19aca1a324c04a86bdfa7255f9b43b",
  "parents": [
    "0b6a94ecbc8b39d6ea86f4337aa23c73a178897e"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Thu Oct 05 23:22:11 2023 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Thu Oct 05 23:22:11 2023 +0200"
  },
  "message": "[gdb/go] Handle v3 go_0 mangled prefix\n\nWith gcc-10 we have:\n...\n(gdb) break package2.Foo^M\nBreakpoint 2 at 0x402563: file package2.go, line 5.^M\n(gdb) PASS: gdb.go/package.exp: setting breakpoint 1\n...\nbut with gcc-11:\n...\ngdb) break package2.Foo^M\nFunction \"package2.Foo\" not defined.^M\nMake breakpoint pending on future shared library load? (y or [n]) n^M\n(gdb) FAIL: gdb.go/package.exp: gdb_breakpoint: set breakpoint at package2.Foo\n...\n\nIn the gcc-10 case, though the exec contains dwarf, it\u0027s not used to set the\nbreakpoint (which is an independent problem, filed as PR go/30941), instead\nthe minimal symbol information is used.\n\nThe minimal symbol information changed between gcc-10 and gcc-11:\n...\n$ nm a.out.10 | grep Foo\n000000000040370d T go.package2.Foo\n0000000000404e50 R go.package2.Foo..f\n$ nm a.out.11 | grep Foo\n0000000000403857 T go_0package2.Foo\n0000000000405030 R go_0package2.Foo..f\n...\n\nA new v3 mangling scheme was used.  The mangling schemes define a separator\ncharacter and mangling character:\n- for v2, dot is used both as separator character and mangling character, and\n- for v3, dot is used as separator character and underscore as mangling\n  character.\n\nFor more details, see [1] and [2].\n\nIn v3, \"_0\" demangles to \".\". [ See gcc commit a01dda3c23b (\"compiler, libgo:\nchange mangling scheme\"), function Special_char_code::Special_char_code. ]\n\nHandle the new go_0 prefix in unpack_mangled_go_symbol, which fixes the\ntest-case.\n\nNote that this doesn\u0027t fix this regression:\n...\n$ gccgo-10 package2.go -c -g0\n$ gccgo-10 package1.go package2.o -g0\n$ gdb -q -batch a.out -ex \"break go.package2.Foo\"\nBreakpoint 1 at 0x40370d\n$ gccgo-11 package2.go -c -g0\n$ gccgo-11 package1.go package2.o -g0\n$ gdb -q -batch a.out -ex \"break go.package2.Foo\"\nFunction \"go.package2.Foo\" not defined.\n...\n\nWith gcc-10, we set a breakpoint on the mangled minimal symbol.  That\none has simply changed for gcc-11, so it\u0027s equivalent to using:\n...\n$ gdb -q -batch a.out -ex \"break go_0package2.Foo\"\nBreakpoint 1 at 0x403857\n...\nwhich does work.\n\nTested on x86_64-linux:\n- openSUSE Leap 15.4, using gccgo-7,\n- openSUSE Tumbleweed, using gccgo-13.\n\nPR go/27238\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d27238\n\n[1] https://go-review.googlesource.com/c/gofrontend/+/271726\n[2] https://github.com/golang/go/issues/41862#issuecomment-707244103\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7561450b8e7c53c8847965d2148b9019d424568a",
      "old_mode": 33188,
      "old_path": "gdb/go-lang.c",
      "new_id": "72ed9e73cd0c1fdb621f21c185410cbeeafbf94b",
      "new_mode": 33188,
      "new_path": "gdb/go-lang.c"
    }
  ]
}
