Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb: gdb runtime-gdb.py is broken #4194

Closed
davecheney opened this issue Oct 5, 2012 · 10 comments
Closed

gdb: gdb runtime-gdb.py is broken #4194

davecheney opened this issue Oct 5, 2012 · 10 comments

Comments

@davecheney
Copy link
Contributor

Reported by developer on IRC

lucky(~/src) % gdb ./addr 
GNU gdb (GDB) 7.5
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 /home/dfc/src/addr...done.
(gdb) b main.main
Breakpoint 1 at 0x400c00: file /home/dfc/src/addr.go, line 9.
(gdb) r
Starting program: /home/dfc/src/addr 
[New LWP 3980]
[Switching to LWP 3980]

Breakpoint 1, main.main () at /home/dfc/src/addr.go:9
9       func main() {
(gdb) goroutines
Undefined command: "goroutines".  Try "help".

What is the expected output? What do you see instead?

gdb integration should work

Please use labels and text to provide additional information.
@davecheney
Copy link
Contributor Author

Comment 1:

Status changed to Duplicate.

Merged into issue #4193.

@minux
Copy link
Member

minux commented Oct 6, 2012

Comment 2:

i don't think this is a dup of 4193.
somehow gdb doesn't load runtime-gdb.py, one possible reason is that the
gdb doesn't support python plugins.
To verify, try this in gdb:
python print 1

Merged into issue #4193.

@minux
Copy link
Member

minux commented Oct 6, 2012

Comment 3:

Status changed to WaitingForReply.

@davecheney
Copy link
Contributor Author

Comment 4:

(gdb) python print 1
1
(gdb) goroutines
Undefined command: "goroutines".  Try "help".

Status changed to Accepted.

@remyoudompheng
Copy link
Contributor

Comment 5:

The command to list goroutines is "info goroutines", not "goroutines".
http://golang.org/doc/gdb

Status changed to WorkingAsIntended.

@gopherbot
Copy link

Comment 6 by burke@libbey.me:

It seems runtime-gdb.py isn't loading for me either, using a 6-day old build of tip,  OS
X 10.8, and gdb 7.5.1. I might be doing something wrong, though.
%%%%% go version
go version devel +b5b5c246be0c Fri Mar 15 17:08:07 2013 -0700 darwin/amd64
%%%%% gdb ./build/hookshot
GNU gdb (GDB) 7.5.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-apple-darwin12.2.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>;...
Reading symbols from
/Users/burke/go/src/github.com/shopify/hookshot/build/hookshot...done.
(gdb) b main.main
Breakpoint 1 at 0x2000: file
/Users/burke/go/src/github.com/Shopify/hookshot/hookshot.go, line 87.
(gdb) r
Starting program: /Users/burke/go/src/github.com/shopify/hookshot/build/hookshot
[New Thread 0x1903 of process 62333]
Breakpoint 1, main.main () at
/Users/burke/go/src/github.com/Shopify/hookshot/hookshot.go:87
87  func main() {
(gdb) python print 1
1
(gdb) info goroutines
Undefined info command: "goroutines".  Try "help info".
(gdb) goroutine 1 bt
Undefined command: "goroutine".  Try "help".
My binary was built with "GOARCH=amd64 go build -o (target) (package)".

@minux
Copy link
Member

minux commented Mar 21, 2013

Comment 7:

due to some bug in gdb, the runtime-gdb.py script won't load automatically on Mac OS X
(only).
you will have to load it manually by issuing "source /path/to/go/src/pkg/runtime-gdb.py"
after gdb finishes loading the executable.
it's a section name issue and we don't have any workarounds.

@wcn3
Copy link

wcn3 commented Jul 11, 2013

Comment 8:

FYI: I am working with the GDB maintainers to get a patch in to fix this.

@dnsco
Copy link

dnsco commented Jan 17, 2015

Does anyone know what's currently going on with this?

I'm still experiencing this problem, and was wondering if I'm the only one and/or if there are any work arounds.

Alternatively, is there anything I can do to help?

@dnsco
Copy link

dnsco commented Jan 17, 2015

Also, when I try to manually load it I get an error.
Loading Go Runtime support.
Traceback (most recent call last):
File "/usr/local/Cellar/go/1.4/libexec/src/runtime/runtime-gdb.py", line 27, in
goobjfile = gdb.current_objfile() or gdb.objfiles()[0]
IndexError: list index out of range

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants