Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#29665 - [go] gdb integration is broken
Attached to Project:
Community Packages
Opened by Csaba Henk (csheemea) - Monday, 30 April 2012, 06:55 GMT
Last edited by Alexander F. Rødseth (xyproto) - Friday, 28 September 2012, 22:51 GMT
Opened by Csaba Henk (csheemea) - Monday, 30 April 2012, 06:55 GMT
Last edited by Alexander F. Rødseth (xyproto) - Friday, 28 September 2012, 22:51 GMT
|
DetailsDescription:
When gdb'ing a go program, go runtime support and sources are not found. Additional info: * package version(s) * config and/or log files etc. Steps to reproduce: See the following transcribed gdb session. The issues are manifesting in the lines "warning: Missing auto-load scripts referenced in section .debug_gdb_scripts" and "204 /build/src/release-build/src/pkg/runtime/iface.c: No such file or directory." $ cat > hw.go package main import "fmt" func main() { fmt.Println("Hello, 世界") } $ go build hw.go $ gdb hw GNU gdb (GDB) 7.4.1 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /tmp/hw...done. warning: Missing auto-load scripts referenced in section .debug_gdb_scripts of file /tmp/hw Use `info auto-load-scripts [REGEXP]' to list them. (gdb) info auto-load-scripts Loaded Script Missing /build/src/release-build/src/pkg/runtime/runtime-gdb.py (gdb) !pacman -Ql go | grep runtime-gdb go /usr/lib/go/src/pkg/runtime/runtime-gdb.py (gdb) source /usr/lib/go/src/pkg/runtime/runtime-gdb.py Loading Go Runtime support. (gdb) br main.main Breakpoint 1 at 0x400c00: file /tmp/hw.go, line 5. (gdb) run Starting program: /tmp/hw [New LWP 25382] [Switching to LWP 25382] Breakpoint 1, main.main () at /tmp/hw.go:5 5 func main() { (gdb) n 6 fmt.Println("Hello, 世界") (gdb) s runtime.convT2E (t=void) at /build/src/release-build/src/pkg/runtime/iface.c:204 204 /build/src/release-build/src/pkg/runtime/iface.c: No such file or directory. (gdb) |
This task depends upon
Closed by Alexander F. Rødseth (xyproto)
Friday, 28 September 2012, 22:51 GMT
Reason for closing: Fixed
Additional comments about closing: Upstream fixed it
Friday, 28 September 2012, 22:51 GMT
Reason for closing: Fixed
Additional comments about closing: Upstream fixed it
go instance if I want to code in go. I was annoyed to see it does not work properly
either, until I realized that's because of the GOROOT setting /etc/profile.d/go.sh.
Is that necessary at all? GOROOT has a similar role to RUBYLIB and PYTHONPATH in
respective languages -- the language runtime knows well the native value for these,
it needs only be set if you want to do something extraordinaly.
I'm unable to reproduce:
gdb hello
GNU gdb (GDB) 7.4.1
[...]
Loading Go Runtime support.
(gdb) info auto-load-scripts
Loaded Script
Yes /usr/lib/go/src/pkg/runtime/runtime-gdb.py
(gdb) !pacman -Ql go | grep runtime-gdb
go /usr/lib/go/src/pkg/runtime/runtime-gdb.py
(gdb) br main.main
Breakpoint 1 at 0x400c00: file /home/alexander/goprojects/hello/hello.go, line 7.
(gdb) run
Starting program: /home/alexander/goprojects/hello/hello
[New LWP 14857]
[Switching to LWP 14857]
Breakpoint 1, main.main () at /home/alexander/goprojects/hello/hello.go:7
7 func main() {
(gdb) quit
A debugging session is active.
GOROOT is not set in /etc/profile.d/go.sh, only GOPATH.
Are you on x86_64 or i686?
What's the values of your GOROOT and GOPATH environment variables?
What is the package version for your go package?
However, the sources are still not found. You did not repeat my whole experiment -- after you break into main, do "n" and "s".
What you get is still the same as I give in the original report --
204 /build/src/release-build/src/pkg/runtime/iface.c: No such file or directory.
With my personal built go instance, I get:
Breakpoint 1, main.main () at /tmp/foog/hw.go:5
5 func main() {
(gdb) n
6 fmt.Println("Hello, 世界")
(gdb) s
runtime.convT2E (t=void) at /home/csaba/go/src/go/src/pkg/runtime/iface.c:205
205 runtime·convT2E(Type *t, ...)
(gdb) l
200 }
201
202 // func convT2E(typ *byte, elem any) (ret any)
203 #pragma textflag 7
204 void
205 runtime·convT2E(Type *t, ...)
206 {
207 byte *elem;
208 Eface *ret;
209 int32 wid;
(gdb)
Hence on locally browsing the docs I get:
godoc -http :6060
2012/06/12 12:33:28 lstat /usr/lib/go/favicon.ico: no such file or directory
Vesa or Remy, do you happen to know if there is a different way to build Go that will fix this? Is this an upstream issue, for the case where go is built for a system-wide installation?
I'll include the favicon.ico.
IT was fixed for Go sources but not for C and ASM sources in the release. Fixes have been committed on the master branch since then, but they were not backported to the stable branches. I suggest you drop an email or a comment saying that you would like the fixes in Go 1.0.3 (Go 1.0.2 was just released without them).
016c4fefed77 5c, 6c, 8c: take GOROOT_FINAL into consideration
a608a03df703 5a, 6a, 8a: take GOROOT_FINAL into consideration
http://code.google.com/p/go/source/list?r=016c4fefed77
Otherwise we can backport the patches ourselves, but it would be useful to have them in 1.0.3
However, I can still reproduce this issue with GDB 7.5.
Judging by the time it took from 1.0.1 to 1.0.2, I'm guessing 1.0.3 will be out in August or September.
Do you think this is too long to wait and that a patch should be applied in the meantime?
(gdb) s
runtime.convT2E (t=void) at /usr/lib/go/src/pkg/runtime/iface.c:204
204 runtime·convT2E(Type *t, ...)
(gdb)
1.0.3 will appear in [community] shortly. I hope the (possible) lack of cross compilation isn't too much of an issue, for now. Please open a bug report if it is.