proc: detect when Launching non-executable files

This provides a better error message when the user tries to run dlv
debug on a directory that does not contain a main package, when `dlv
exec` is used with a source file.

Additionally the architecture of the executable is checked as suggested
by @alexbrainman in #443.

Fixes #509
This commit is contained in:
aarzilli
2016-04-21 12:19:21 +02:00
parent 5714aa548c
commit 51c39ed171
10 changed files with 133 additions and 14 deletions

View File

@ -10,6 +10,8 @@ import (
"github.com/derekparker/delve/proc"
)
var NotExecutableErr = proc.NotExecutableErr
// DebuggerState represents the current context of the debugger.
type DebuggerState struct {
// CurrentThread is the currently selected debugger thread.