set source path in delve

1,041 views
Skip to first unread message

YZ Xie

unread,
Apr 1, 2017, 12:58:24 AM4/1/17
to golang-nuts
Hi all, 

I have meet source path problem,

there exits two question.
1. when use ls to list source code, it prompts no source available, how to  spefic a source folder? in gdb, use directory command to add source search path, can dlv do it ?

2.when I set a breakpoints on function main, I know this was set a breakpoint to go runtime source file, but it didn't work as expected, I have moved go folder from  /usr/local/dev to /usr/local, and I have changed the .profile and /etc/profile environment variable, and rebooted, but dlv didn't find new go runtime.  I guess the runtime path was written into peer debug info, is there a way to change it? in gdb, can use source command.


if delve cannot do these, I think this is a important issue, because we offen move source code for same reasons. can delve add these features.

root@ubuntu:~/src/go/src/github.com/hyperledger/fabric/build/bin# dlv exec ./peer 
Type 'help' for list of commands.
(dlv) ls
Stopped at: 0x7fc70b02ccc0
=>no source available
(dlv) b main
Breakpoint 1 set at 0x45ddb0 for main() /usr/local/dev/go/src/runtime/rt0_linux_amd64.s:73
(dlv) 


Regards
Xie

YZ Xie

unread,
Apr 1, 2017, 1:19:48 AM4/1/17
to golang-nuts
I have read help with delve,  there is a command sources to show source files, but there exsit a  way to change it? gdb can do it

在 2017年4月1日星期六 UTC+8下午12:58:24,YZ Xie写道:

傅伟

unread,
May 23, 2017, 9:19:43 AM5/23/17
to golang-nuts
Hi, 

   I am switching from gdb to delve. I think the following statement can help you.

{{{
(dlv) funcs regep
(dlv) list funcName

}}}


在 2017年4月1日星期六 UTC+8下午12:58:24,YZ Xie写道:
Hi all, 
Reply all
Reply to author
Forward
0 new messages