From 975a114c0f847a0b12a0384d0f804ca46f900281 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Sun, 31 Jan 2016 11:14:58 +0100 Subject: [PATCH] trace: Fix panic calling trace without arg --- cmd/dlv/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/dlv/main.go b/cmd/dlv/main.go index e6967b64..da245f0b 100644 --- a/cmd/dlv/main.go +++ b/cmd/dlv/main.go @@ -144,6 +144,10 @@ starts and attaches to it, and enables you to immediately begin debugging your p Long: "Trace program execution. Will set a tracepoint on every function matching [regexp] and output information when tracepoint is hit.", Run: func(cmd *cobra.Command, args []string) { status := func() int { + if len(args) == 0 { + fmt.Fprintln(os.Stderr, "You must provide a function to trace.") + return 1 + } const debugname = "debug" var processArgs []string if traceAttachPid == 0 {