FAQ
Hi Go folks,

Is it expected that GDB commands like `goroutine 1 bt` don't work from core
files (as opposed to with a live process attached)? If it's a known limitation,
is there any chance it will be lifted at some point?

When I attempt to use such a command from a core file, I often get this:

     Python Exception <class 'gdb.error'> You can't do that without a
process to debug.:

and sometimes this:

     Python Exception <class 'gdb.MemoryError'> Cannot access memory at
address 0x7f0395b97bc0:

Transcript below.

Thanks,
Aaron

================================================

% go version
go version go1.5.2 linux/amd64

% gdb --version
GNU gdb (GDB) 7.9-gg17
[...]

% cat /tmp/foo.go
package main

func main() {
         panic(0)
}

% go build -o /tmp/foo /tmp/foo.go && GOTRACEBACK=crash /tmp/foo
panic: 0
[...]

% gdb /tmp/foo ./core
[...]
(gdb) source ~/clients/go/src/runtime/runtime-gdb.py
Loading Go Runtime support.
(gdb) info goroutines
* 1 running runtime.systemstack_switch
   2 waiting runtime.gopark
   3 waiting runtime.gopark
(gdb) goroutine 1 bt
Python Exception <class 'gdb.error'> You can't do that without a
process to debug.:
Error occurred in Python command: You can't do that without a process to debug.
(gdb) goroutine 2 bt
Python Exception <class 'gdb.error'> You can't do that without a
process to debug.:
Error occurred in Python command: You can't do that without a process to debug.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 19, '16 at 5:32a
activeJan 19, '16 at 6:08a
posts2
users2
websitegolang.org

2 users in discussion

Aaron Jacobs: 1 post Ian Lance Taylor: 1 post

People

Translate

site design / logo © 2021 Grokbase