I debug my code referencing Debugging Go Code
But when I run gdb xxx.test
, I get a list Warning:
Reading symbols from markdown.test...
warning: `/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/go-build765783040/runtime/cgo/_obj/gcc_amd64.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/go-build765783040/runtime/cgo/_obj/gcc_darwin_amd64.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/go-build765783040/runtime/cgo/_obj/gcc_setenv.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/go-build765783040/runtime/cgo/_obj/gcc_util.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/rn/ff65_68n0kg4_ml_v420yg5m0000gn/T/go-build619623895/github.com/glenn-brown/golang-pkg-pcre/src/pkg/pcre/_obj/pcre.cgo2.o': can't open to read symbols: No such file or directory.
(no debugging symbols found)...done.
Using go test -c -work
instead of go test -c
warning: `/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/go-build765783040/runtime/cgo/_obj/gcc_amd64.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/go-build765783040/runtime/cgo/_obj/gcc_darwin_amd64.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/go-build765783040/runtime/cgo/_obj/gcc_setenv.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/go-build765783040/runtime/cgo/_obj/gcc_util.o': can't open to read symbols: No such file or directory.
source /usr/local/go/src/runtime/runtime-gdb.py
within gdb
Loading Go Runtime support.
Traceback (most recent call last):
File "/usr/local/go/src/runtime/runtime-gdb.py", line 205, in <module>
_rctp_type = gdb.lookup_type("struct runtime.rtype").pointer()
gdb.error: No struct type named runtime.rtype.
After editing runtime-gdb.py
line 205: `#_rctp_type = gdb.lookup_type("struct runtime._type").pointer()`
line 216: `return go_type_ptr.cast(gdb.lookup_type("struct reflect.rtype").pointer()).dereference()`
source runtime-gdb.py within gdb
(gdb) source /usr/local/go/src/runtime/runtime-gdb.py
Loading Go Runtime support.
And then I cannot do next step.Is anyone know how to fix it?
- go version go1.4.2 darwin/amd64
- GDB:7.9 (using homebrew to install)
- OS:Mac OS X 10.10.3