dlv: Headless mode print listener address info (#487)

* Headless mode print listener address info

* if Headless && Addr == localhost:0 print address

* update listen flag changed check

* terminal: headless print API server listening address
This commit is contained in:
visualfc
2016-04-25 01:27:02 +08:00
committed by Derek Parker
parent 7b7387fd1e
commit f7e403abcf

View File

@ -353,7 +353,6 @@ func execute(attachPid int, processArgs []string, conf *config.Config) int {
Stop(bool) error Stop(bool) error
} }
if !Headless { if !Headless {
ApiVersion = 2 ApiVersion = 2
} }
@ -386,6 +385,8 @@ func execute(attachPid int, processArgs []string, conf *config.Config) int {
var status int var status int
if Headless { if Headless {
// Print listener address
fmt.Printf("API server listening at: %s\n", listener.Addr())
ch := make(chan os.Signal) ch := make(chan os.Signal)
signal.Notify(ch, syscall.SIGINT) signal.Notify(ch, syscall.SIGINT)
<-ch <-ch