How to debug go-ipfs by gdb or dlv

#go build -a -gcflags="-N -l" -v ./cmd/ipfs
#[root@home go-ipfs]# gdb ipfs
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7
Copyright © 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
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-redhat-linux-gnu”.
For bug reporting instructions, please see:
Reading symbols from /root/goproject/src/…done.
(gdb) l
1 _cgo_export.c: No such file or directory.
(gdb) q

and use dlv

[root@node175 go-ipfs]# dlv exec ./ipfs swarm peers
could not launch process: could not find .debug_frame section in binary
[root@node175 go-ipfs]# /ip4/
nessary info:

go version

go version go1.10.1 linux/amd64
[root@node175 go-ipfs]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)
[root@node175 go-ipfs]# uname -r

who can help me , thanks

Take a look at: