@@ -5,7 +5,12 @@ Compile and begin tracing program.
...
@@ -5,7 +5,12 @@ Compile and begin tracing program.
### Synopsis
### Synopsis
Trace program execution. Will set a tracepoint on every function matching the provided regular expression and output information when tracepoint is hit.
Trace program execution.
The trace sub command will set a tracepoint on every function matching the
provided regular expression and output information when tracepoint is hit. This
is useful if you do not want to begin an entire debug session, but merely want
to know what functions your process is executing.
```
```
dlv trace [package] regexp
dlv trace [package] regexp
...
@@ -33,4 +38,4 @@ dlv trace [package] regexp
...
@@ -33,4 +38,4 @@ dlv trace [package] regexp
### SEE ALSO
### SEE ALSO
*[dlv](dlv.md) - Delve is a debugger for the Go programming language.
*[dlv](dlv.md) - Delve is a debugger for the Go programming language.
###### Auto generated by spf13/cobra on 11-Apr-2016
###### Auto generated by spf13/cobra on 20-May-2016
returnerrors.New("you must provide a path to a binary")
returnerrors.New("you must provide a path to a binary")
...
@@ -156,8 +171,13 @@ starts and attaches to it, and enables you to immediately begin debugging your p
...
@@ -156,8 +171,13 @@ starts and attaches to it, and enables you to immediately begin debugging your p
testCommand:=&cobra.Command{
testCommand:=&cobra.Command{
Use:"test [package]",
Use:"test [package]",
Short:"Compile test binary and begin debugging program.",
Short:"Compile test binary and begin debugging program.",
Long:`Compiles a test binary with optimizations disabled, starts and attaches to it, and enable you to immediately begin debugging your program.`,
Long:`Compiles a test binary with optimizations disabled and begins a new debug session.
Run:testCmd,
The test command allows you to begin a new debug session in the context of your
unit tests. By default Delve will debug the tests in the current directory.
Alternatively you can specify a package name, and Delve will debug the tests in
that package instead.`,
Run:testCmd,
}
}
RootCommand.AddCommand(testCommand)
RootCommand.AddCommand(testCommand)
...
@@ -165,8 +185,13 @@ starts and attaches to it, and enables you to immediately begin debugging your p
...
@@ -165,8 +185,13 @@ starts and attaches to it, and enables you to immediately begin debugging your p
traceCommand:=&cobra.Command{
traceCommand:=&cobra.Command{
Use:"trace [package] regexp",
Use:"trace [package] regexp",
Short:"Compile and begin tracing program.",
Short:"Compile and begin tracing program.",
Long:"Trace program execution. Will set a tracepoint on every function matching the provided regular expression and output information when tracepoint is hit.",
Long:`Trace program execution.
Run:traceCmd,
The trace sub command will set a tracepoint on every function matching the
provided regular expression and output information when tracepoint is hit. This
is useful if you do not want to begin an entire debug session, but merely want
to know what functions your process is executing.`,
Run:traceCmd,
}
}
traceCommand.Flags().IntVarP(&traceAttachPid,"pid","p",0,"Pid to attach to.")
traceCommand.Flags().IntVarP(&traceAttachPid,"pid","p",0,"Pid to attach to.")
traceCommand.Flags().IntVarP(&traceStackDepth,"stack","s",0,"Show stack trace with given depth.")
traceCommand.Flags().IntVarP(&traceStackDepth,"stack","s",0,"Show stack trace with given depth.")