提交 71845350 编写于 作者: D Derek Parker

dlv/main: Add exec subcommand to debug existing binary

Added subcommand which takes a path to an existing binary, starts it,
and begins a debug session.
上级 32b499fa
......@@ -95,6 +95,16 @@ starts and attaches to it, and enables you to immediately begin debugging your p
}
rootCommand.AddCommand(debugCommand)
// 'exec' subcommand.
execCommand := &cobra.Command{
Use: "exec [./path/to/binary]",
Short: "Runs precompiled binary, attaches and begins debug session.",
Run: func(cmd *cobra.Command, args []string) {
os.Exit(execute(0, args))
},
}
rootCommand.AddCommand(execCommand)
// 'trace' subcommand.
var traceAttachPid int
traceCommand := &cobra.Command{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册