From f7e403abcfd51e423b8864453b0d222f0bd258ac Mon Sep 17 00:00:00 2001 From: visualfc Date: Mon, 25 Apr 2016 01:27:02 +0800 Subject: [PATCH] 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 --- cmd/dlv/cmds/commands.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/dlv/cmds/commands.go b/cmd/dlv/cmds/commands.go index c7dee2b2..845587c6 100644 --- a/cmd/dlv/cmds/commands.go +++ b/cmd/dlv/cmds/commands.go @@ -353,7 +353,6 @@ func execute(attachPid int, processArgs []string, conf *config.Config) int { Stop(bool) error } - if !Headless { ApiVersion = 2 } @@ -386,6 +385,8 @@ func execute(attachPid int, processArgs []string, conf *config.Config) int { var status int if Headless { + // Print listener address + fmt.Printf("API server listening at: %s\n", listener.Addr()) ch := make(chan os.Signal) signal.Notify(ch, syscall.SIGINT) <-ch