Documentation: update recommended compiler flags for 'exec' command

On Go 1.10 -gcflags='all=-N -l' should be preferred, update the
documentation of 'exec' command to reflect this.
This commit is contained in:
Aurélien 2018-10-15 13:00:22 +02:00 committed by Derek Parker
parent 86c4b7209e
commit a86711f547
2 changed files with 4 additions and 2 deletions

@ -10,7 +10,8 @@ Execute a precompiled binary and begin a debug session.
This command will cause Delve to exec the binary and immediately attach to it to This command will cause Delve to exec the binary and immediately attach to it to
begin a new debug session. Please note that if the binary was not compiled with begin a new debug session. Please note that if the binary was not compiled with
optimizations disabled, it may be difficult to properly debug it. Please optimizations disabled, it may be difficult to properly debug it. Please
consider compiling debugging binaries with -gcflags="-N -l". consider compiling debugging binaries with -gcflags="all=-N -l" on Go 1.10
or later, -gcflags="-N -l" on earlier versions of Go.
``` ```
dlv exec <path/to/binary> dlv exec <path/to/binary>

@ -172,7 +172,8 @@ session.`,
This command will cause Delve to exec the binary and immediately attach to it to This command will cause Delve to exec the binary and immediately attach to it to
begin a new debug session. Please note that if the binary was not compiled with begin a new debug session. Please note that if the binary was not compiled with
optimizations disabled, it may be difficult to properly debug it. Please optimizations disabled, it may be difficult to properly debug it. Please
consider compiling debugging binaries with -gcflags="-N -l".`, consider compiling debugging binaries with -gcflags="all=-N -l" on Go 1.10
or later, -gcflags="-N -l" on earlier versions of Go.`,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error { PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 { if len(args) == 0 {
return errors.New("you must provide a path to a binary") return errors.New("you must provide a path to a binary")