I had to remove '-gcflags "-N -l"' because I could not set a breakpoint.
* * *
(gdb) b 'shconf.TestScanKeys'
Function "shconf.TestScanKeys" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 ('shconf.TestScanKeys') pending.
(gdb) run
Starting program:
/home/neo/go/src/github.com/kless/shutil/shconf/shconf.test
* * *
At this point, I had to interrupt it, since I follow having the same issue
that using "go test" directly.
The program does not exit, it remains halted.
* * *
^C
Program received signal SIGINT, Interrupt.
runtime.futex () at /usr/local/go/src/pkg/runtime/sys_linux_amd64.s:267
267 RET
* * *
But I want to know where it is halted. This is the information of "bt":
(gdb) bt
#0 runtime.futex () at /usr/local/go/src/pkg/runtime/sys_linux_amd64.s:267
#1 0x00000000004111f9 in runtime.futexsleep (addr=void, val=void, ns=void)
at /usr/local/go/src/pkg/runtime/os_linux.c:58
#2 0x0000000000409b49 in runtime.notesleep (n=void)
at /usr/local/go/src/pkg/runtime/lock_futex.c:125
#3 0x0000000000414b5f in stopm () at
/usr/local/go/src/pkg/runtime/proc.c:795
#4 0x00000000004163f8 in exitsyscall0 (gp=void)
at /usr/local/go/src/pkg/runtime/proc.c:1417
#5 0x0000000000420ed9 in runtime.mcall (fn=void)
at /usr/local/go/src/pkg/runtime/asm_amd64.s:195
#6 0x00000000005c1280 in runtime.g0 ()
#7 0x0000000000420da6 in _rt0_amd64 ()
at /usr/local/go/src/pkg/runtime/asm_amd64.s:86
#8 0x0000000000000001 in ?? ()
#9 0x00007fffffffe118 in ?? ()
#10 0x0000000000000001 in ?? ()
#11 0x00007fffffffe118 in ?? ()
#12 0x0000000000000000 in ?? ()
El lunes, 15 de julio de 2013 10:35:39 UTC+1, Alexander Sychev escribió:
Hi,
xxxx/_test/_testmain.go is a temporary source file, it is removed after a
producing of the test.
I don't think you need to read it.
Just set breakpoints in your test functions and that is it.
To avoid the warning at startup of gdb, you should add "set auto-load
safe-path <your $GOROOT>/src/pkg/runtime/" in $HOME/.gdbinit
Best regards,
santucco
On Mon, Jul 15, 2013 at 12:43 PM, Archos <raul...@sent.com <javascript:>>wrote:
I' trying to debug a test file using gdb, but it reports an error.
My actual working directory is:~/go/src/github.com/kless/shutil/shconf
go test -c -gcflags "-N -l"
LANG=C gdb shconf.test
It shows the next warning:
warning: File "/usr/local/go/src/pkg/runtime/runtime-gdb.py" auto-loading
has been declined by your `auto-load safe-path' set to
"$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /usr/local/go/src/pkg/runtime/runtime-gdb.py
line to your configuration file "/home/neo/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/neo/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the
shell:
info "(gdb)Auto-loading safe path"
Although I can continue with it.
(gdb) source /usr/local/go/src/pkg/runtime/runtime-gdb.py
Loading Go Runtime support.
(gdb) list
github.com/kless/shutil/shconf/_test/_testmain.go: No such file or
directory.
How to fix it?
--
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...@googlegroups.com <javascript:>.
For more options, visit
https://groups.google.com/groups/opt_out.--
Best regards,
santucco
--
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/groups/opt_out.